|Navigation: Language Reference > 13 - Built-in Functions >====== POLYGON (draw a multi-sided figure) ======|
POLYGON( array [,fill] [,attributelist])
|POLYGON||Draws a multi-sided figure on the current window or report.|
|Array||An array of SIGNED integers that specify the x and y coordinates of each “corner point” of the polygon.|
|Fill||A LONG integer constant, constant EQUATE, or variable containing the red, green, and blue components that create the color in the three low-order bytes (bytes 0, 1, and 2) or an EQUATE for a standard Windows color value.|
|attributelist||A string constant, variable, or EQUATE containing an optional type of output document and its associated attributes. Only valid when the target is a REPORT. See EXTEND|
The POLYGON procedure places a multi-sided figure on the current window or report. The polygon is always closed. This procedure is valid in Clarion Win32 Windows, and also for REPORT structures in both Clarion Win32 and Clarion#.
The array parameter contains the x and y coordinates of each “corner point” of the polygon. The polygon will have as many corner points as the total number of array elements divided by two. For each corner point in turn, its x coordinate is taken from the odd-numbered array element and the y coordinate from the immediately following even-numbered element.
The border color is the current pen color set by SETPENCOLOR; the default color is the Windows system color for window text. The border width is the current width set by SETPENWIDTH; the default width is one pixel. The line's style is the current pen style set by SETPENSTYLE; the default style is a solid line.
MDIChild WINDOW('Child One'),AT(0,0,320,200),MDI,MAX,HVSCROLL
Corners = 0 !1st x position
Corners = 90 !1st y position
Corners = 90 !2nd x position
Corners = 190 !2nd y position
Corners = 100 !3rd x position
Corners = 200 !3rd y position
Corners = 50 !4th x position
Corners = 60 !4th y position
POLYGON(Corners,000000FFh) !Blue filled four-sided polygon