| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== POLYGON (draw a multi-sided figure) ====== | [[poke write to memory address .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[popastrings.htm|{{btn_next_n.gif|Next page}}]] | | || **POLYGON(**// array// [,//fill//] [,//attributelist//]**)** {{blk2blue.jpg|blk2blue.jpg}} | **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 [[comment set document formatting .htm|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. **Example:** **MDIChild WINDOW('Child One'),AT(0,0,320,200),MDI,MAX,HVSCROLL** **         !window controls** **         END** **Corners  SIGNED,DIM(8)** ** CODE** ** 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** ** OPEN(MDIChild)** ** POLYGON(Corners,000000FFh)   !Blue filled four-sided polygon** **See Also:** [[current target.htm|Current Target]] [[setpencolor set line draw color .htm|SETPENCOLOR]] [[setpenwidth set line draw thickness .htm|SETPENWIDTH]] [[setpenstyle set line draw style .htm|SETPENSTYLE]]