CVB.Net 14.0
UserOverlay Class Reference

User-definable overlay. This type of overlay does not use a predefined appearance, but needs to be user-drawn using a subset of the GDI functionality exported by the Stemmer.Cvb.Aux.Drawing.UnmanagedGraphics object. More...

Inherits OverlayBase.

Inherited by VisualToolBase< TResult >.

Public Member Functions

 UserOverlay (string text, bool canDrag, bool xorPaint, System.Drawing.Color color, bool addCenterVertex, Point[] vertices, Cursor[] cursors)
 Construct a user object. More...
 
 UserOverlay (string text, bool canDrag, bool xorPaint, System.Drawing.Color color, bool addCenterVertex, Point[] vertices, Cursor[] cursors, object tag)
 Construct a user object. More...
 
 UserOverlay (UserOverlay obj)
 copy ctor More...
 

Protected Member Functions

override void Overlay_ConnectedToDisplay ()
 Add a label to a display. More...
 
override void Overlay_DisconnectedFromDisplay (bool handBackID)
 Remove a label from its display More...
 
virtual void OnPaint (UserOverlayPaintEventArgs args)
 Inheritors may override this method to change behavior. More...
 
- Protected Member Functions inherited from OverlayBase
 OverlayBase (string text, bool canDrag, System.Drawing.Color color, object tag)
 ctor for DisplayObjects More...
 

Properties

Point[] Vertices [get]
 Pixel positions to paint the user object with. Modifying the Vertex positions will not change the appearance of the overlay and the changes will in fact be overwritten in the next Paint event. Positions are in image coordinates, NOT in client coordinates.
 
bool XORPaint [get, set]
 Use or don't use XOR mode for painting.
 
override System.Drawing.Color Color [get, set]
 Color of the overlay.
 
- Properties inherited from OverlayBase
Display Parent [get]
 The display on which the label lives (if any...). Note that a label may only be associated with one display at a time
 
object Tag [get, set]
 Field for user-definable data to be associated with the overlay object.
 
bool InvokeRequired [get]
 tell whether actions on the display object require an invoke action or not (being user interface objects, display objects should not be modified asynchronously)
 
string Text [get, set]
 Text being displayed on the label and/or in the status line
 
virtual System.Drawing.Color Color [get, set]
 Color of the label
 
bool IsDragable [get, set]
 Label dragable?
 

Events

EventHandler< UserOverlayPaintEventArgsPaint
 Paint event that will be raised if the object needs to be painted.
 

Additional Inherited Members

- Protected Attributes inherited from OverlayBase
System.Drawing.Color color_ = System.Drawing.Color.White
 Internally stored color.
 

Detailed Description

User-definable overlay. This type of overlay does not use a predefined appearance, but needs to be user-drawn using a subset of the GDI functionality exported by the Stemmer.Cvb.Aux.Drawing.UnmanagedGraphics object.

Constructor & Destructor Documentation

◆ UserOverlay() [1/3]

UserOverlay ( string  text,
bool  canDrag,
bool  xorPaint,
System.Drawing.Color  color,
bool  addCenterVertex,
Point[]  vertices,
Cursor[]  cursors 
)

Construct a user object.

Parameters
textstatus line text of the object
canDragIf true, the object becomes dragable, if false it will remain fixed
colorcolor to be memorized for painting
xorPaintset to true to paint the overlay in xor mode
verticesvertices to be used for painting
addCenterVertexwhen
true
, and additional drag handle will be created automatically in the object's center of mass
cursorsarray of cursors to use for the drag handles (may be null, in which case the default drag handle cursor will be used; if the array is not long enough, it will be filled up with default drag handle cursor entries internally)

◆ UserOverlay() [2/3]

UserOverlay ( string  text,
bool  canDrag,
bool  xorPaint,
System.Drawing.Color  color,
bool  addCenterVertex,
Point[]  vertices,
Cursor[]  cursors,
object  tag 
)

Construct a user object.

Parameters
textstatus line text of the object
canDragIf true, the object becomes dragable, if false it will remain fixed
xorPaintset to true to paint the overlay in xor mode
colorcolor to be memorized for painting
verticesvertices to be used for painting
tagobject with which this label is to be associated
addCenterVertexwhen
true
, and additional drag handle will be created automatically in the object's center of mass
cursorsarray of cursors to use for the drag handles (may be null, in which case the default drag handle cursor will be used; if the array is not long enough, it will be filled up with default drag handle cursor entries internally)

◆ UserOverlay() [3/3]

copy ctor

Parameters
obj

Member Function Documentation

◆ OnPaint()

virtual void OnPaint ( UserOverlayPaintEventArgs  args)
protectedvirtual

Inheritors may override this method to change behavior.

Parameters
argspaint event arguments

◆ Overlay_ConnectedToDisplay()

override void Overlay_ConnectedToDisplay ( )
protectedvirtual

Add a label to a display.

Exceptions
ObjectDisposedExceptionIf the display we are trying to work on has already been disposed

Implements OverlayBase.

◆ Overlay_DisconnectedFromDisplay()

override void Overlay_DisconnectedFromDisplay ( bool  handBackID)
protectedvirtual

Remove a label from its display

Parameters
handBackIDtrue if the overlay plugin's display ID is to be handed back to the owning display, false otherwise.
Exceptions
ObjectDisposedExceptionIf the display we are trying to work on has already been disposed

Implements OverlayBase.