Purpose
Opcode format | Opcode
[ASCII] (Hex) |
Operand Format | Comments |
Single-byte, readable operand | [P] (50) | [<ws>]<ICount>[<ws><IXi>,<IYi>]+ | Draws either a dot, a line, a polyline, or a polygon. Absolute coordinates. |
Single-byte, binary operand | [p] (70) | <BCount>[<USEcount>][<LXi><LYi>]+ | Polyline/polygon, relative coordinates |
- | [Ctrl-p] (10) | <BCount>[<USEcount>][<SXi><SYi>]+ | Polyline/polygon, relative coordinates |
Ecount When count is zero, a 2-byte extended count follows allowing for polylines/polygons with vertices from 256 through 65,791 which are encoded as an integer (0 to 65,535).
Xi,Yi The ith point (in logical coordinates) of the polyline/polygon.
There are two visual differences between a Polyline and the equivalent series of simple Draw Line calls:
When the "Fill Mode" attribute is active, a closed and colored-in polygon is drawn rather than a polyline. The polygon is rendered using the current "Color" and "Visibility" attributes. The value of count is equal to the number of sides of the polygon to be drawn. For example, a count of "3" would specify three logical points that define a filled-in triangular polygon.
To draw filled polygons with interior holes use the Draw Contour Set opcode.
Polygons are drawn by filling the specified region with the currently active color attribute.
Note: A visually apparent edge of the polygon is not rendered; however the Draw Polygon function can be followed by additional draw calls that render the desired edge. For example, to draw a red triangle with a black edge we could use the following:
(Color 255,0,0,255)
F
P 3 0,0 10,0 5,5
(Color 0,0,0,255)
f
P 4 0,0 10,0 5,5 0,0
The "Fill Mode" attribute is ignored when count is given a value less than three. In this case the Draw Line function would normally be used instead of Draw Polyline.