Figureshapes

From Examples…

The following example draws a triangle. The code is placed in the Paint event of a Window or Canvas.

Dim fx as New FigureShape
fx.AddLine 0, 100, 50, 0
fx.AddLine 50, 0, -50, 0

//How do the two lines above draw a triangle??? Shouldn’t there be three lines? I used this to put in a poly and as long as I put the coordinates in CC I can add all of the lines or leave out the last one (Why is that?)

fx.Border = 100 // opaque border
fx.BorderColor = &cFF0000 // red border
fx.FillColor = &cFFFF00 // yellow interior
g.DrawObject fx, 100,100

// Also what is the coordinates on the DrawOject for???

You can leave out the last line because it closes the shape for you - from the last point to the start point.

The coordinates on DrawObject are the coordinates in the graphics object where the top left corner of the object being drawn will go (0,0 for the figure shape will be placed at 100,100 on the graphics object in your example).

the coor INSIDE a figureshape (or any other 2d object) are the coordiantes of the lines (etc) relative to the shape itself.

The coordiaates in the DrawObject are the offset to the figureshapes (0,0)