Navigation:  thinBasic Modules > UI (User Interface) > Dedicated Control Functions > Canvas Control >

Canvas_Polyline

Previous pageReturn to chapter overviewNext page

 

Description

 

Draw a series of connected line segments.

 

Syntax

 

n = Canvas_PolyLine points [,rgbColor]

 

Returns

 

Number

 

Parameters

 

Name

Type

Optional

Meaning

Points

UDT

No

User-defined type that defines the number of vertices and the location of each.

See Remarks for more info.

rgbColor

Number

Yes

RBG starting color

 

Remarks

 

Points is something like the following UDT:

 

Type PolyPoint

  x         As Single

  y         As Single

End Type

 

Type PolyArray

  count     As Long

  xy(1024)  As PolyPoint    '---Can be any number of elements from 2 to 1024

End Type

 

Points is any UDT that must have the following structure:

the first member is a LONG integer point count
followed directly by the appropriate number of SINGLE precision floats to specify the actual coordinates

 

There must be at least two, and no more than 1024 vertices

 

Restrictions

 

See also

 

Examples

 

Dim pa As PolyArray

'...

      pa.count = 4         '---Indicate you need 4 vertex

      pa.xy(1).x = x1      '---X1

      pa.xy(1).y = y1-150  '---Y1

      pa.xy(2).x = x1+150  '---X2

      pa.xy(2).y = y1      '---Y2

      pa.xy(3).x = x1      '---X3

      pa.xy(3).y = y1+150  '---Y3

      pa.xy(4).x = x1-150  '---X4

      pa.xy(4).y = y1      '---Y4

 

      CANVAS_Polygon pa, RGB(255, 0, 255), RGB(5,128,0), %CANVAS_FillStyle_DiagonalCrossedLines

 '... Number of vertex can be any from 2 to 1024