Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 3 - QuickDraw Drawing / QuickDraw Drawing Reference
Data Structures /


Polygon

After you use the OpenPoly function to create a polygon, QuickDraw begins collecting the line-drawing information you provide into a Polygon record, which is a data structure of type Polygon. The OpenPoly function returns a handle to the newly allocated Polygon record. Thereafter, your application normally refers to your new polygon by this handle, because QuickDraw routines such as FramePoly and PaintPoly expect a handle to a Polygon record as their first parameter.

A polygon is defined by a sequence of connected lines. A Polygon record consists of two fixed-length fields followed by a variable-length array of points: the starting point followed by each successive point to which a line is drawn.

Polygon =
   RECORD
      polySize:   Integer; {size in bytes}
      polyBBox:   Rect;    {bounding rectangle}
      polyPoints: ARRAY[0..0] OF Point;      {vertices of polygon}
   END;
Field Description
polySize
The size in bytes of this record.
polyBBox
The rectangle that bounds the polygon.
polyPoints
An array of points: the starting point followed by each successive point to which a line is drawn.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996