Gets or sets whether drawing takes place.
Namespace: Cognex.VisionPro.DisplayAssembly: Cognex.VisionPro.Display.Controls (in Cognex.VisionPro.Display.Controls.dll) Version: 69.0.0.0 (69.0.0.0)
Syntax
Property Value
Type: BooleanTrue if drawing takes place.
Events
| Event Type | Reason |
|---|---|
| CogDisplay Changed | Fires when the property value is changed. |
Exceptions
| Exception | Condition |
|---|---|
| AxHost InvalidActiveXStateException | Thrown when the display control is invalid. |
Remarks
When this property is true (the default), then all methods and properties that would change the appearance of a display are rendered immediately.
If you are constructing a complex graphic display using many individual graphic objects, you can improve performance by disabling drawing, adding all the graphics, then enabling drawing. When you re-enable drawing, all rendering is performed.
Note that setting this property to false also disables any updates to the display of the image, so changes to pan or zoom values will not appear until after drawing is re-enabled
Examples
private void doDraw() { CogCircle mCircle = new CogCircle(); CogRectangle mRect = new CogRectangle(); cogDisplay1.DrawingEnabled = false; cogDisplay1.InteractiveGraphics.Add(mCircle, "Circle", false); cogDisplay1.InteractiveGraphics.Add(mRect, "Rect", false); mCircle.CenterX = cogDisplay1.Image.Width / 2; mCircle.CenterY = cogDisplay1.Image.Height / 2; mCircle.Radius = cogDisplay1.Image.Height / 4; mRect.SetCenterWidthHeight(mCircle.CenterX, mCircle.CenterY, cogDisplay1.Image.Width / 2, cogDisplay1.Image.Height /2); cogDisplay1.DrawingEnabled = true; }
Private Sub doDraw()
Dim mCircle As New CogCircle
Dim mRect As New CogRectangle
cogDisplay1.DrawingEnabled = False
cogDisplay1.InteractiveGraphics.Add(mCircle, "Circle", False)
cogDisplay1.InteractiveGraphics.Add(mRect, "Rect", False)
mCircle.CenterX = cogDisplay1.Image.Width / 2
mCircle.CenterY = cogDisplay1.Image.Height / 2
mCircle.Radius = cogDisplay1.Image.Height / 4
mRect.SetCenterWidthHeight(mCircle.CenterX, mCircle.CenterY, cogDisplay1.Image.Width / 2, cogDisplay1.Image.Height / 2)
cogDisplay1.DrawingEnabled = True
End SubSee Also