svgaddpolygon
svgaddpolygon |
Purpose
Synopsis
procedure svgaddpolygon(gid: string, points: list of integer|real)
procedure svgaddpolygon(points: list of integer|real)
Arguments
|
gid
|
Object group ID.
|
|
points
|
A list of points.
|
Example
The following code draws two semi-transparent, partially overlapping polygons, the first is filled with the group color, the second with a different color:
svgaddgroup("p", "Polygons")
svgsetstyle(SVG_OPACITY, 0.5)
svgsetstyle(SVG_FILL, SVG_CURRENT)
svgaddpolygon([-2, -2, 0, 2, 2, -2)])
svgaddpolygon([-1, -2, 1, 2, 3, -2)])
svgsetstyle(svggetlastobj, SVG_FILL, SVG_GREY)
Further information
1. The last point in the list of points is automatically connected to the first point in the list to form a closed shape.
2. If no group ID is specified, the polygon is added to the last group that has been created.
Related topics
