Articles 3D Audio Custom Controls General RB Graphics Hacks Mac OS X Menus Novelty Printing REALbasic 2005 REALbasic 2006 Registration Resources Reviews Serial Speech Sockets XML Video Resource Links News Current News February 2006 January 2006 December 2005 November 2005 October 2005 September 2005 August 2005 July 2005 June 2005 May 2005 April 2005 March 2005 ![]() REALbasic for Dummies by Erick Tejkowski ![]() Learning REALbasic through Applications REALbasic for Macintosh REALbasic Cross-Platform Application Development
Older files are in Stuffit 5 or greater format. Newer files are ".Zip". Download StuffIt Expander |
|
Drawing Dashed Lines
A Dashed DrawLine Method
Sub DrawLine(Extends g as Graphics, x1 as integer, y1 as integer, x2 as integer, y2 as integer, dash as integer, gap as integer)
What we do is find the length of the line, and count the number of dash-gap patterns will fit into it, loop that many times, and draw a line segment at the beginning of each of those pattern offsets, which are calculated by moving down the length of the line by adding the component (x and y seperately) lengths of the dash and gap added together. It's actually quite a simple idea, though it doesn't always yield peeerfect results. Sometimes the segments can appear to be at a slight angle from the slope of the line they're supposed to be building. This is simply a limitation of the DrawLine method. If we used a true pen pattern like from QuickDraw, we would no longer have cross-platform abilities, but it would work better on the Mac. Finished
|
||||
|
||||||||||||||||||||||||||||||||
Maintained by the Staff of ResExcellence. This entire site ©1997-2006 ResExcellence
Privacy Statement? Sure we gotta Privacy Statement.
[an error occurred while processing this directive]