CanvasDrawPolygon
Revision as of 22:48, 31 May 2017 by Lchrisman (talk | contribs) (Created page with "Category:Image and canvas functions ''New to Analytica 5.0'' == CanvasDrawPolygon( canvas, x, y'', <code>I</code>, lineColor, fillColor, lineWidth, dash, alternate''...")
New to Analytica 5.0
CanvasDrawPolygon( canvas, x, y, I
, lineColor, fillColor, lineWidth, dash, alternate )
Draws a closed polygon on a canvas. The last point is connected to the first point.
- «canvas» is a canvas obtained from calling the
Canvas()
function, or a canvas context obtained by calling theCanvasContext()
function. - «x», «y»: Arrays both indexed by «
I
» containing the vertices of the polygon. - «
I
»: An index that dimensions «x» and «y». This can be omitted when «x» and «y» have only one index in common (such as when one is an index). - «lineColor», «fillColor»: (Optional) The color for the edge and fill respectively, each is either a textual color name or a color integer. (See CellFill for an enumeration of textual color names). A color integer encodes red, green, blue and optionally alpha as
0x01000000 * alpha + 0x00010000 * red + 0x0000100 * green + 0x000001 * blue
. Defaults to 'Black'. - «lineWidth»: (Optional) The width of the border line. Defaults to 1.0.
- «dash»; The dither style of the border line, one of:
'Solid', 'Dash', 'Dot', 'DashDot', 'DashDotDot'
. - «alternate»: (Optional). When set to true and the polygon has overlapping edges, fills every other enclosed region within the polygon, alternating which areas are filled or not. When False (default), fills all areas that were fully encircled by the polygon's path at least once.
When «fillColor» and «alternate» is omitted, the border is drawn and the polygon is not filled. When «fillColor» or «alternate» is specified but none of the line-relevant parameters is specified (i.e., «lineColor», «lineWidth» or «dash»), the polygon is filled and no border is drawn. When «fillColor» and at least one line-relevant parameter is specified, the rectangle is drawn filled with a border line.
Example
Var c := Canvas( 32,32 ); CanvasDrawPolygon( c, Array(I4,[1,13,25,16]), Array(I4,[6,1,5,11]), I4, fillColor:0x408080 ); CanvasDrawPolygon( c, Array(I4,[17,26,25,17]), Array(I4, [12,6,18,27]), fillColor:0xb40015); CanvasDrawPolygon( c, Array(I4,[15,3,2,15]), Array(I4, [26,21,6,10]), lineColor:0x60b2b9ba); CanvasImage(c)
See also
Comments
Enable comment auto-refresher