Polygon Routines Don't Affect Total Area of Framed Polygon (59318)



The information in this article applies to:

  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0

This article was previously published under Q59318

SUMMARY

The CALLed Macintosh ROM routines ERASEPOLY, FILLPOLY, PAINTPOLY, and INVERTPOLY do not effect the entire area of a polygon drawn with FRAMEPOLY. For example, if a polygon is drawn with FRAMEPOLY and then the same polygon is erased with ERASEPOLY, not all of the polygon will be erased.

This same behavior occurs with the equivalent ROM routines ErasePgon, FillPgon, PaintPgon, and InvertPgon invoked with QuickBASIC's ToolBox statement. That is, they will not effect the entire area of a polygon drawn with FramePgon. Therefore, this is not a problem with QuickBASIC, because QuickBASIC behaves exactly the same as a direct call to the ROM routine itself.

This information applies to Microsoft QuickBASIC Compiler Version 1.00 for the Apple Macintosh. This is a limitation of the Apple Macintosh ROM routines.

MORE INFORMATION

The following example program illustrates this behavior. It first uses FRAMEPOLY to draw a polygon and then prompts the user to perform other operations (FILLPOLY, INVERTPOLY, ERASEPOLY, and PAINTPOLY) on the same polygon. These other operations do not effect the entire polygon. In this example, the behavior is very evident with ERASEPOLY and FILLPOLY, slightly evident with INVERTPOLY, and not evident with PAINTPOLY (it would be more evident with PAINTPOLY if the current pen pattern was changed to something else).

Code Example

DIM polygon%(12)
DIM pattern%(3)

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

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

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

FOR i = 0 to 3          'Create a pattern for use with FILLPOLY.
   pattern%(i) = 1234
NEXT i

FRAMEPOLY VARPTR(polygon%(0))

LOCATE 1,1
PRINT "Click to fill the polygon."
WHILE MOUSE(0) <> -1
WEND
FILLPOLY VARPTR(polygon%(0)),VARPTR(pattern%(0))

LOCATE 2,1
PRINT "Click to invert the polygon."
WHILE MOUSE(0) <> -1
WEND
INVERTPOLY VARPTR(polygon%(0))

LOCATE 3,1
PRINT "Click to erase the polygon."
WHILE MOUSE(0) <> -1
WEND
ERASEPOLY VARPTR(polygon%(0))

LOCATE 4,1
PRINT "Click to paint the polygon."
WHILE MOUSE(0) <> -1
WEND
PAINTPOLY VARPTR(polygon%(0))

LOCATE 5,1
PRINT "Click to end."
WHILE MOUSE(0) <> -1
WEND
				

Modification Type:MinorLast Reviewed:1/9/2003
Keywords:KB59318