polygon. Drawing polygons through joints coordinates

^image.polygon(line color)[table with junctions coordinates]

The method draws an unfilled polygon with the coordinates given in table outlined by specified color. The last joint is automatically connected to the first one with a line.

Example
$coordinates[^table::create{x   y
0   0
50   100
100   0
}]

$square[^image::
create(100;100;0x000000)]
^square.polygon(0x00FF00)[$coordinates]
$
response:body[^square.gif[]]

Browser will display isosceles triangle outlined with green against black background. The table gives coordinates of triangle's vertices.


Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 14.08.2010