CVB.Net 14.0
Display Class Reference

.NET display control for Common Vision Blox More...

Inherits UserControl.

Classes

class  ZoomState
 Class that memorizes a Display's zoom state for the purpose of later on restoring that state. More...
 

Public Member Functions

 Display ()
 Default Constructor.
 
Point ClientToImage (Point pt)
 Convert client coordinates to image coordinates. More...
 
Point ImageToClient (Point pt)
 Convert image coordinates to display client coordinates. More...
 

Static Public Attributes

const double ClientRectUsageMin = 0.1
 Minimum fraction of the client rect to be used for painting the Cvb image.
 
const double ClientRectUsageMax = 1.0
 Maximum fraction of the client rect to be used for painting the Cvb image.
 
static readonly OverlayDictionary InstalledOverlays = new OverlayDictionary()
 The only instance of the collection of available overlay plug ins
 

Protected Member Functions

override void Dispose (bool disposing)
 Clean up any resources being used. More...
 
override void OnBackColorChanged (EventArgs e)
 Background color of the parent class has changed. Reflect the change in the display as well. More...
 
override void WndProc (ref Message m)
 Route those messages that may be handled by the CVCDisp.dll. More...
 
virtual void WndProcDisplay (ref Message m)
 Sub-Window procedure that processes the messages that are specific to the Cvb display. More...
 
virtual void OnLabelMouseOver (LabelEventArgs args)
 Overrideable function that takes care of the LabelMouseOver event. More...
 
virtual void OnOverlayPluginMouseOver (OverlayPluginMouseOverEventArgs args)
 Overrideable function that takes care of the OverlayPluginMouseOver event. More...
 
virtual void OnUserOverlayMouseOver (UserOverlayMouseOverEventArgs args)
 Overrideable function that takes care of the UserOverlayMouseOver event. More...
 
virtual void OnStatusLineUpdated (StatusLineUpdatedEventArgs args)
 Overrideable function that takes care of the StatusLineUpdated event. More...
 
virtual void OnArea2DAoiDrag (Area2DDragEventArgs args)
 Overrideable function that takes care of the RectangleAOIDrag event. More...
 
virtual void OnArea2DAoiDragged (Area2DDragEventArgs args)
 Overrideable function that takes care of the RectangleAOIChanged event. More...
 
virtual void OnRectAoiDrag (RectDragEventArgs args)
 Overrideable function that takes care of the RectangleAOIDrag event. More...
 
virtual void OnRectangleAoiDragged (RectDragEventArgs args)
 Overrideable function that takes care of the RectangleAOIChanged event. More...
 
virtual void OnOverlayPluginClicked (OverlayPluginEventArgs args)
 Overrideable function that takes care of the OverlayPluginClicked event. More...
 
virtual void OnUserOverlayClicked (UserOverlayEventArgs args)
 Overrideable function that takes care of the OverlayClicked event. More...
 
virtual void OnOverlayPluginDrag (OverlayPluginEventArgs args)
 Overrideable function that takes care of the OverlayClicked event. More...
 
virtual void OnUserOverlayDrag (UserOverlayEventArgs args)
 Overrideable function that takes care of the OverlayClicked event. More...
 
virtual void OnOverlayPluginDragged (OverlayPluginEventArgs args)
 Overrideable function that takes care of the OverlayDragged event. More...
 
virtual void OnUserOverlayDragged (UserOverlayEventArgs args)
 Overrideable function that takes care of the OverlayDragged event. More...
 
virtual void OnLabelClicked (LabelEventArgs args)
 Overrideable function that takes care of the LabelClicked event. More...
 
virtual void OnLabelDrag (LabelEventArgs args)
 Overrideable function that takes care of the LabelClicked event. More...
 
virtual void OnLabelDragged (LabelEventArgs args)
 Overrideable function that takes care of the LabelClicked event. More...
 
virtual void OnRubberMeasurement (RubberMeasurementEventArgs args)
 Overrideable function that takes care of the RubberMeasurement event. More...
 
virtual void OnRubberMeasurementFinished (RubberMeasurementEventArgs args)
 Overrideable function that takes care of the RubberMeasurementsFinished event. More...
 
virtual void OnOverlayMaskChanged (EventArgs args)
 Overrideable function that takes care of the PaintingFinished event. More...
 
virtual void OnCoordinateSystemClicked (EventArgs args)
 Overrideable function that takes care of the CoordinateSystemClicked event. More...
 
virtual void OnCoordinateSystemChanged (EventArgs args)
 Overrideable function that takes care of the CoordinateSystemChanged event. More...
 

Properties

MouseWheelMode MouseWheelMode [get, set]
 Sets/gets the current use of the mouse wheel.
 
HighBitScaleMode HighBitScaleMode [get, set]
 Mode defining the treatment of images with more than 8 bits per pixel. See HighBitScaleMode for a description of the available modes. Note that floating point accuracy images will always be shown as if the mode More...
 
bool SuppressPaint [get, set]
 This property allows easy access to the same functionality "SetRedraw" offers in the MFC: By setting it to "true", repaints of the display are completely suppressed - until the properties is reset to "false". This can come in handy when assigning a new image to the display without while wanting to preserve the zoom state.
 
OverlayList Overlays [get]
 The overlays that are currently being displayed on the image
 
bool UseDirectDraw [get, set]
 Specifies whether DirectDraw or GDI functionality should be used to paint the display. Depending on hardware or driver versions switching the paint functions may yield performance benefits.
 
bool VSync [get, set]
 Enable or disable the VSync mode. VSync mode enabled means that painting of the display contents is synchronized to the Monitor's VSync signal. This helps suppress display artifacts that may appear if the ratio of your camera's speed and the display rate is unfavorable. However, VSync mode will also reduce the maximum achievable frame rate. More...
 
bool ManualOverlayRefresh [get, set]
 Enable or disable the overlay refresh mode. Take care because in Manual overlay refresh mode you may experience strange display behavior if you do not refresh your display often enough. Manual display refresh mode however yields better performance when adding or removing lots of display objects.
 
double ClientRectUsage [get, set]
 Get/Set the proportion of the control's client area to be used for painting the Cvb images.
 
LeftMouseButtonPaintMode PaintMode [get, set]
 Toggling setting/erasing the overlay pixels when in one of the left button drawing modes.
 
CoordinateDisplayStyle CoordinateDisplayStyle [get, set]
 Controls the way the coordinate system is being displayed when Left button mode is in 'DefineOrigin'.
 
bool ShowRuler [get, set]
 Toggle the display of the display ruler.
 
double PanoramaZoomFactor [get]
 The zoom factor that will be used in Panorama mode.
 
Point ZoomCenter [get, set]
 Center of the zoom. Note that setting this property while RestrictZoomPositions is set to true may result in the zoom center being adjusted automatically.
 
double ZoomFactor [get, set]
 magnification factor currently used More...
 
bool RedrawOnPixelContentChanged [get, set]
 Gets/sets whether the image should redraw itself when the image data is changed.
 
bool RestrictZoomPositions [get, set]
 Set the current state of the zoom restriction mode. When set to true, the display automatically applies a restriction to the possible center locations of the display zoom so that it cannot happen that a zoomed display consists of up to 75% background when zooming into one of the image's corners. This also means that when ZoomCenter is being set, the value of the ZoomCenter that can be read back may not actually be the position that has just been set.
More...
 
bool ShowScrollbars [get, set]
 Toggle the display of scroll bars when in zoomed mode.
 
bool ShowImageSize [get, set]
 Set to true to display the size of the current image in the display status line.
 
bool ShowZoomFactor [get, set]
 Set to true to display the size of the current image in the display status line.
 
bool ShowCursorPosition [get, set]
 Set to true to display the size of the current image in the display status line.
 
bool ShowGrayValue [get, set]
 Set to true to display the size of the current image in the display status line.
 
string StatusLineText [get, set]
 Set to true to display the size of the current image in the display status line.
 
StatusLineStyle StatusLine [get, set]
 Selects how the display uses the status line.
 
Area2D SelectedArea2D [get, set]
 Parallelogram-shaped area of interest. Setting this property will show no effect while the LeftButtonMode is not set to Stemmer.Cvb.Forms.Controls.LeftMouseButtonMode.DefineArea2DAoi because only in this mode the Area2D AOI will be visible. More...
 
Rect SelectedRectangle [get, set]
 Rectangular area of interest. Setting this property will show no effect while the LeftButtonMode is not set to DefineRectangleAOI because only in this mode the rectangular AOI will be visible.
 
RightMouseButtonMode RightMouseButtonBehaviour [get, set]
 Display interaction with the right mouse button
 
LeftMouseButtonMode LeftMouseButtonBehaviour [get, set]
 Display interaction with the left mouse button
 
double Gain [get, set]
 Display gain.
 
int Offset [get, set]
 Display offset.
 
BevelStyle Bevels [get, set]
 Bevel display style
 
Stemmer.Cvb.Image Image [get, set]
 Image to be displayed
 

Events

EventHandler< EventArgs > CoordinateSystemChanged
 Event that will be fired when the coordinate system has been changed by clicking into the display.
 
EventHandler< EventArgs > CoordinateSystemClicked
 Event that will be fired when the coordinate system has been left-clicked.
 
EventHandler< EventArgs > OverlayMaskChanged
 Event that will be fired whenever the user has modified the overlay information of the image via mouse-painting.
 
EventHandler< RubberMeasurementEventArgsRubberDragged
 Event that will be when the user finished rubber measurements
 
EventHandler< RubberMeasurementEventArgsRubberDrag
 Event that will be when the user drags the rubber band to perform measurements on the display
 
EventHandler< RectDragEventArgsRectAoiDrag
 Event that will be raised when the Rectangular AOI changed and the user still holds down the left mouse button.
 
EventHandler< RectDragEventArgsRectAoiDragged
 Event that will be raised when the Rectangular AOI changed and the user no longer holds down the left mouse button (dragging finished)
 
EventHandler< Area2DDragEventArgsArea2DAoiDrag
 Event that will be raised when the Parallelogram AOI changed and the user still holds down the left mouse button.
 
EventHandler< Area2DDragEventArgsArea2DAoiDragged
 Event that will be raised when the Parallelogram AOI changed and the user no longer holds down the left mouse button (dragging finished)
 
EventHandler< LabelEventArgsLabelClicked
 Event that will be raised when the a display label has been clicked.
 
EventHandler< LabelEventArgsLabelDrag
 Event that will be raised while a display label is being dragged.
 
EventHandler< LabelEventArgsLabelDragged
 Event that will be raised when a display label is no longer being dragged.
 
EventHandler< OverlayPluginEventArgsOverlayPluginClicked
 Event that will be raised when the a display overlay has been clicked.
 
EventHandler< OverlayPluginEventArgsOverlayPluginDrag
 Event that will be raised while a display overlay is being dragged.
 
EventHandler< OverlayPluginEventArgsOverlayPluginDragged
 Event that will be raised when a display overlay is no longer being dragged.
 
EventHandler< UserOverlayEventArgsUserOverlayClicked
 Event that will be raised when the a display overlay has been clicked.
 
EventHandler< UserOverlayEventArgsUserOverlayDrag
 Event that will be raised while a display overlay is being dragged.
 
EventHandler< UserOverlayEventArgsUserOverlayDragged
 Event that will be raised when a display overlay is no longer being dragged.
 
EventHandler< StatusLineUpdatedEventArgsStatusLineUpdated
 Event that will be raised when the display's status line has been updated.
 
EventHandler< LabelEventArgsLabelMouseOver
 Event that will be raised when the the mouse cursor is located over a display label.
 
EventHandler< OverlayPluginMouseOverEventArgsOverlayPluginMouseOver
 Event that will be raised when the the mouse cursor is located over an overlay plugin.
 
EventHandler< UserOverlayMouseOverEventArgsUserOverlayMouseOver
 Event that will be raised when the the mouse cursor is located over an user overlay.
 

Detailed Description

.NET display control for Common Vision Blox

Member Function Documentation

◆ ClientToImage()

Point ClientToImage ( Point  pt)

Convert client coordinates to image coordinates.

Parameters
ptcoordinate to be converted
Returns
converted coordinate

◆ Dispose()

override void Dispose ( bool  disposing)
protected

Clean up any resources being used.

Parameters
disposingtrue if managed resources should be disposed; otherwise, false.

◆ ImageToClient()

Point ImageToClient ( Point  pt)

Convert image coordinates to display client coordinates.

Parameters
ptcoordinate to be converted
Returns
converted coordinate

◆ OnArea2DAoiDrag()

virtual void OnArea2DAoiDrag ( Area2DDragEventArgs  args)
protectedvirtual

Overrideable function that takes care of the RectangleAOIDrag event.

Parameters
argsevent arguments

◆ OnArea2DAoiDragged()

virtual void OnArea2DAoiDragged ( Area2DDragEventArgs  args)
protectedvirtual

Overrideable function that takes care of the RectangleAOIChanged event.

Parameters
argsevent arguments

◆ OnBackColorChanged()

override void OnBackColorChanged ( EventArgs  e)
protected

Background color of the parent class has changed. Reflect the change in the display as well.

Parameters
eEvent arguments.

◆ OnCoordinateSystemChanged()

virtual void OnCoordinateSystemChanged ( EventArgs  args)
protectedvirtual

Overrideable function that takes care of the CoordinateSystemChanged event.

Parameters
argsevent arguments

◆ OnCoordinateSystemClicked()

virtual void OnCoordinateSystemClicked ( EventArgs  args)
protectedvirtual

Overrideable function that takes care of the CoordinateSystemClicked event.

Parameters
argsevent arguments

◆ OnLabelClicked()

virtual void OnLabelClicked ( LabelEventArgs  args)
protectedvirtual

Overrideable function that takes care of the LabelClicked event.

Parameters
argsevent arguments

◆ OnLabelDrag()

virtual void OnLabelDrag ( LabelEventArgs  args)
protectedvirtual

Overrideable function that takes care of the LabelClicked event.

Parameters
argsevent arguments

◆ OnLabelDragged()

virtual void OnLabelDragged ( LabelEventArgs  args)
protectedvirtual

Overrideable function that takes care of the LabelClicked event.

Parameters
argsevent arguments

◆ OnLabelMouseOver()

virtual void OnLabelMouseOver ( LabelEventArgs  args)
protectedvirtual

Overrideable function that takes care of the LabelMouseOver event.

Parameters
argsEvent argument.

◆ OnOverlayMaskChanged()

virtual void OnOverlayMaskChanged ( EventArgs  args)
protectedvirtual

Overrideable function that takes care of the PaintingFinished event.

Parameters
argsEvent argument.

◆ OnOverlayPluginClicked()

virtual void OnOverlayPluginClicked ( OverlayPluginEventArgs  args)
protectedvirtual

Overrideable function that takes care of the OverlayPluginClicked event.

Parameters
argsevent arguments

◆ OnOverlayPluginDrag()

virtual void OnOverlayPluginDrag ( OverlayPluginEventArgs  args)
protectedvirtual

Overrideable function that takes care of the OverlayClicked event.

Parameters
argsevent arguments

◆ OnOverlayPluginDragged()

virtual void OnOverlayPluginDragged ( OverlayPluginEventArgs  args)
protectedvirtual

Overrideable function that takes care of the OverlayDragged event.

Parameters
argsEvent argument.

◆ OnOverlayPluginMouseOver()

virtual void OnOverlayPluginMouseOver ( OverlayPluginMouseOverEventArgs  args)
protectedvirtual

Overrideable function that takes care of the OverlayPluginMouseOver event.

Parameters
argsevent arguments

◆ OnRectangleAoiDragged()

virtual void OnRectangleAoiDragged ( RectDragEventArgs  args)
protectedvirtual

Overrideable function that takes care of the RectangleAOIChanged event.

Parameters
argsevent arguments

◆ OnRectAoiDrag()

virtual void OnRectAoiDrag ( RectDragEventArgs  args)
protectedvirtual

Overrideable function that takes care of the RectangleAOIDrag event.

Parameters
argsevent arguments

◆ OnRubberMeasurement()

virtual void OnRubberMeasurement ( RubberMeasurementEventArgs  args)
protectedvirtual

Overrideable function that takes care of the RubberMeasurement event.

Parameters
argsEvent argument.

◆ OnRubberMeasurementFinished()

virtual void OnRubberMeasurementFinished ( RubberMeasurementEventArgs  args)
protectedvirtual

Overrideable function that takes care of the RubberMeasurementsFinished event.

Parameters
argsEvent argument.

◆ OnStatusLineUpdated()

virtual void OnStatusLineUpdated ( StatusLineUpdatedEventArgs  args)
protectedvirtual

Overrideable function that takes care of the StatusLineUpdated event.

Parameters
argsEvent argument.

◆ OnUserOverlayClicked()

virtual void OnUserOverlayClicked ( UserOverlayEventArgs  args)
protectedvirtual

Overrideable function that takes care of the OverlayClicked event.

Parameters
argsevent arguments

◆ OnUserOverlayDrag()

virtual void OnUserOverlayDrag ( UserOverlayEventArgs  args)
protectedvirtual

Overrideable function that takes care of the OverlayClicked event.

Parameters
argsevent arguments

◆ OnUserOverlayDragged()

virtual void OnUserOverlayDragged ( UserOverlayEventArgs  args)
protectedvirtual

Overrideable function that takes care of the OverlayDragged event.

Parameters
argsEvent argument.

◆ OnUserOverlayMouseOver()

virtual void OnUserOverlayMouseOver ( UserOverlayMouseOverEventArgs  args)
protectedvirtual

Overrideable function that takes care of the UserOverlayMouseOver event.

Parameters
argsevent arguments

◆ WndProc()

override void WndProc ( ref Message  m)
protected

Route those messages that may be handled by the CVCDisp.dll.

Parameters
mWindows Message

◆ WndProcDisplay()

virtual void WndProcDisplay ( ref Message  m)
protectedvirtual

Sub-Window procedure that processes the messages that are specific to the Cvb display.

Parameters
mWindows message structure

Property Documentation

◆ HighBitScaleMode

Mode defining the treatment of images with more than 8 bits per pixel. See HighBitScaleMode for a description of the available modes. Note that floating point accuracy images will always be shown as if the mode

HighBitScaleMode.ViewPort was set, regardless of your actual setting. Also note that the HighBitScaleMode.ViewPort setting will cause the display to ignore the values of Gain and Offset.

◆ RestrictZoomPositions

bool RestrictZoomPositions
getset

Set the current state of the zoom restriction mode. When set to true, the display automatically applies a restriction to the possible center locations of the display zoom so that it cannot happen that a zoomed display consists of up to 75% background when zooming into one of the image's corners. This also means that when ZoomCenter is being set, the value of the ZoomCenter that can be read back may not actually be the position that has just been set.

Exceptions
ObjectDisposedExceptionIf this display has already been disposed.

◆ SelectedArea2D

Area2D SelectedArea2D
getset

Parallelogram-shaped area of interest. Setting this property will show no effect while the LeftButtonMode is not set to Stemmer.Cvb.Forms.Controls.LeftMouseButtonMode.DefineArea2DAoi because only in this mode the Area2D AOI will be visible.

Note that the Area2D object is always set and used in image coordinates, not in pixel coordinates!

Exceptions
ArgumentOutOfRangeExceptionwhen trying to specify an Area2D where P0 is located outside the image.
NullReferenceExceptionIf the Image property is null
ObjectDisposedExceptionIf the Image has already been disposed

◆ VSync

bool VSync
getset

Enable or disable the VSync mode. VSync mode enabled means that painting of the display contents is synchronized to the Monitor's VSync signal. This helps suppress display artifacts that may appear if the ratio of your camera's speed and the display rate is unfavorable. However, VSync mode will also reduce the maximum achievable frame rate.

Use this flag sparsely! Setting this property on more than one Display per UI thread will deadlock your application! Note that setting this property to true will only have an effect if DirectDraw is being used.

◆ ZoomFactor

double ZoomFactor
getset

magnification factor currently used

Exceptions
NullReferenceExceptionIf the Image property is null
ObjectDisposedExceptionIf the object has already been disposed