User Tools

Site Tools

Navigation:  Language Reference > 13 - Built-in Functions >====== POLYGON (draw a multi-sided figure) ====== Previous pageReturn to chapter overviewNext page

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

        !window controls


Corners  SIGNED,DIM(8)


Corners[1] = 0               !1st x position

Corners[2] = 90              !1st y position

Corners[3] = 90              !2nd x position

Corners[4] = 190             !2nd y position

Corners[5] = 100             !3rd x position

Corners[6] = 200             !3rd y position

Corners[7] = 50              !4th x position

Corners[8] = 60              !4th y position


POLYGON(Corners,000000FFh)   !Blue filled four-sided polygon

See Also:

Current Target




polygon_draw_a_multi_sided_figure_.htm.txt · Last modified: 2021/04/15 15:57 by