Graphics.DrawObject

From Xojo Documentation

Revision as of 22:57, 18 July 2019 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Method

Graphics.DrawObject(object2D As Object2D, [deltaX As Double, deltaY As Double])

Supported for all project types and targets.

Draws the passed Object2D object into the Graphics object. The optional parameters DeltaX and DeltaY are offsets from the top-left corner of the Graphics object to the top-left corner of the Object.

Notes

If Object is an OvalShape, then the offsets are from the top-left corner of the Graphics object to the center of the OvalShape.

Sample Code

The following method is in the Paint event of a Window. It draws a simple curve. The negative value of ControlY(0) places the control point above the imaginary straight line from x,y to x2,y2.

Var c As New CurveShape
c.ControlX(0) = 120
c.ControlY(0) = -40
c.Order = 1
c.X = 10
c.Y = 100
c.X2 = 250
c.Y2 = 100

g.DrawObject(c, c.X, c.Y)