The DrawObject Method is available in LEADTOOLS Document and Medical Imaging toolkits.
- graphics
- The Graphics surface on which to draw this AnnObject.
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As AnnObject Dim graphics As Graphics instance.DrawObject(graphics) |
Parameters
- graphics
- The Graphics surface on which to draw this AnnObject.
This method is called internally by the annotation framework whenever the AnnObject.Draw method is called. You do not need to call this method directly.
If an object is invisible (Visible is set to false), it will not draw itself.
By default, this method will draw the same graphics path returned from the AnnObject.GetGraphicsPath method when the AnnGetGraphicsPathMode is set to DrawObject. For simple objects such as lines and rectangles, this is sufficient. More complex objects that contain elements that either cannot be expressed by a graphics path (such as images) or elements that are too expensive to be expressed by a path (such as text) override this method to draw the object directly.
This method has the following logic:
- Calls the BeginDraw method that determines if the object is visible and sets up the object's AnnObject.PhysicalTransform matrix into the g graphics
- Calls AnnObject.GetGraphicsPath with AnnGetGraphicsPathMode set to DrawObject to get the graphics path that represents this object
- Uses the AnnDrawable.HasBrush method to check if this object implements a brush and if so, fills the interior of the graphics path with the System.Drawing.Brush
- Uses the AnnDrawable.HasPen method to check if this object implements a pen and if so, draws the outside of the graphics path with the System.Drawing.Pen
- Calls EndDraw to reset the g transformation
Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7