FigureShape.AddLine

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Method

FigureShape.AddLine(X as Single, Y as Single, X2 as Single, Y2 as Single)

Supported for all project types and targets.

Adds a straight line to the figure.

Notes

X and Y are the starting coordinates; X2 and Y2 are the end coordinates.

Example

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

Var fx As New FigureShape
fx.AddLine(0, 100, 50, 0)
fx.AddLine(50, 0, -50, 0)
fx.Border = 100 // opaque border
fx.BorderColor = &cFF0000 // red border
fx.FillColor = &cFFFF00 // yellow interior
g.DrawObject(fx, 100, 100)