FRAMEPOLY and FramePgon Don't Frame Same Polygon Twice (59317)



The information in this article applies to:

  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0

This article was previously published under Q59317

SUMMARY

Given the exact same polygon coordinates, the CALLed ROM routine FRAMEPOLY will not frame the exact same polygon on multiple calls. This same behavior occurs with the equivalent ROM routine FramePgon invoked with QuickBASIC's ToolBox statement. Therefore, this is a limitation of the Apple Macintosh ROM routines, not of Microsoft QuickBASIC.

MORE INFORMATION

This problem can be demonstrated by the following sample program. This program draws a polygon with FRAMEPOLY, changes the mode of the QuickDraw pen to XOR, and then executes the exact same FRAMEPOLY statement. By definition, you would expect this to erase the polygon. However, this does not happen and a few pixels are left visible, mostly at the corners. This same problem occurs when FramePgon is used in a similar manner.

Code Example

DIM polygon (12)

polygon%(0)  = 26                          'Number of bytes in array.

polygon%(1)  = 100  : polygon%(2)  = 10    'Coordinates of rectangle
polygon%(3)  = 300  : polygon%(4)  = 500   'enclosing the polygon.

polygon%(5)  = 100  : polygon%(6)  = 180   'Coordinates of the
polygon%(7)  = 260  : polygon%(8)  = 220   'endpoints of the polygon.
polygon%(9)  = 290  : polygon%(10) = 390
polygon%(11) = 100  : polygon%(12) = 180

FRAMEPOLY VARPTR(polygon%(0))   'Draw the polygon.
PENMODE 10                      'Switch QuickDraw pen to XOR mode.

LOCATE 1,1
PRINT "Click to redraw the polygon"
WHILE MOUSE(0) = 0
WEND

FRAMEPOLY VARPTR(polygon%(0))   'Redraw the same polygon.

LOCATE 1,2                      'Pause to view the results.
PRINT "Click to end"            'Some pixels around the corners of the
WHILE MOUSE(0) = 0              'polygon are still visible.
WEND
END
				

Modification Type:MinorLast Reviewed:1/8/2003
Keywords:KB59317