Microsoft KB Archive/59317

= FRAMEPOLY and FramePgon Don't Frame Same Polygon Twice =

Article ID: 59317

Article Last Modified on 1/8/2003

-

APPLIES TO


 * Microsoft QuickBasic Compiler for 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 &quot;Click to redraw the polygon&quot; WHILE MOUSE(0) = 0 WEND

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

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

Additional query words: MQuickB

Keywords: KB59317

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.