From Xojo Documentation
Jump to: navigation, search

Class (inherits from Object2D)

Used to draw vector graphic shapes composed of lines and curves. It is similar to a polygon except that a “side” may be curved. A figure consists of a set of CurveShapes, with the end point of one curve automatically joined to the starting point of the next.

Border Fill Scale
BorderColor FillColor X
BorderWidth Item Y
Count ReadOnlyProperty.png Rotation

AddCubic FillColor
AddLine Insert
AddQuad Remove
Append Remove
Border Rotation
BorderColor Scale
BorderWidth X
Fill Y


A figure is formed by drawing each curve it contains in order, joining the endpoint of one to the starting point of the next. The figure is degenerate if doing so does not enclose any area. This will be the case for a figure containing only one line, for example. The appearance of a degenerate figure is undefined.

AddLine, AddCubic, and AddQuad are convenience methods that make it easier to add curves to the figure. You could instead create your own CurveShapes, and add them with the Append or Insert methods.


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
fx.Border = 100 // opaque border
fx.BorderColor = &cFF0000 // red border
fx.FillColor = &cFFFF00 // yellow interior
g.DrawObject fx, 100,100

See Also

ArcShape, CurveShape, FolderItem, Graphics, Group2D, Object2D, OvalShape, Picture, PixmapShape, RectShape, RoundRectShape, StringShape classes.

Personal tools

Starting Out
Dig Deeper
More Help