<<

Contents

Search

>>

 

POLYGON

 

 

Function

 

 

Syntax:

POLYGON(<Coordinates>,<Red>,<Green>,<Blue>,<Fill>,<Line Width>[,<Handle>])

 

<Coordinates>

= <STRING-EXPRESSION>

<Red>

= <NUM-EXPRESSION>

<Green>

= <NUM-EXPRESSION>

<Blue>

= <NUM-EXPRESSION>

<Fill>

= <NUM-EXPRESSION>

<Line Width>

= <NUM-EXPRESSION>

<Handle>

= <NUM-EXPRESSION>

 

 

Meaning:

Draws a polygon on the screen.

 

If <Red> < 0 or <Green> < 0 or <Blue> < 0, a polygon of the same size previously drawn at the same position is deleted again.

 

<Handle> specifies the window in that the polygon shall be drawn. <Handle> can contain the window depth or the handle of a split window or a WINDOWCALL window. If the parameter <Handle> is missing, the polygon is drawn on the current mask.

 

POLYGON returns the following values:

 

1: no error

-1: Polygon to be deleted not found

-2: The coordinates do not have the form Y,X

-3: <Coordinates> is empty

 

Attention: In Html programs 1 is returned when NOREPAINT is active.

 

Parameter:

Coordinates

Contains separated by semis-colons the coordinates of the polygon. Each coordinate must be specified in the form: Y,X (Y = Y-coordinate, X = X-coordinate). If the last coordinate in <Coordinates> does not equal the first coordinate, a connecting line is automatically drawn between the last and the first coordinate. 

 

Red

Red value

 

Green

Green value

 

Blue

Blue value

 

Fill

= 0: The border of the polygon is drawn in the size <Border Size> in the color <Red>, <Green>, <Blue>.

= otherwise: The interior of the polygon is filled with the color <Red>, <Green>, <Blue>.

 

Line Width

Width of line in pixel

 

Handle

Window depth or handle of a split window or handle of a WINDOWCALL Window

 

Sample:

/* Draw a filled red triangle with the coordinates:

/* (5,10)  (5,12.5)  (3.5,11.25)

H% = POLYGON("5,10;5,12.5;3.5,11.25",255,0,0,1,2)

 

See also:

DRAWLINE

DRAWRECT

FILLRECT

LPPOLYGON

CIRCLE