Display Control Reference 14.1
Methods

Functions

void AboutBox ()
 Displays the About box of the Common Vision Display Control.
 
boolean AddLabel (BSTR Text, boolean CanDrag, long Color, long ID, long x, long y)
 Generates a label and displays it in the the display object. More...
 
boolean AddOverlayObject (BSTR ObjectName, BSTR Text, boolean CanDrag, boolean XorOnly, long Color, long HighLightColor, boolean Filled, long ID, long *Vertices, long *ObjectData)
 Generates an overlay object from a plug-in. More...
 
boolean AddOverlayObjectNET (BSTR ObjectName, BSTR Text, boolean CanDrag, boolean XorOnly, long Color, long HighLightColor, boolean Filled, long ID, __int3264 PixelList, void *ObjectData)
 Generates an overlay object from a plug-in. More...
 
boolean AddOverlayObjectNET2 (BSTR ObjectName, BSTR Text, boolean CanDrag, boolean XorOnly, long Color, long HighLightColor, boolean Filled, long ID, __int64 PixelList, __int64 ObjectData)
 Instantiates an overlay plugin object and adds it to this display. More...
 
boolean AddUserObject (BSTR Text, boolean CanDrag, boolean XorOnly, long NumVertices, long ID, __int3264 Vertices)
 Generates a graphic overlay object. More...
 
boolean AddUserObjectNET (BSTR Text, boolean CanDrag, boolean XorOnly, long ID, __int3264 PixelList)
 Generates a graphic overlay object. More...
 
boolean ClientToImage (long ClientX, long ClientY, long *ImageX, long *ImageY)
 Converts window coordinates to image coordinates. More...
 
boolean CopyImageToClipboard ()
 Copies the active AOI (refer to GetSelectedArea/ SetSelectedArea) from the display object to the Windows clipboard. More...
 
boolean GetDisplayZoom (long *CenterX, long *CenterY, long *ZoomFactor)
 Ascertain the current zoom factor and pixel position of the center of the window. More...
 
boolean GetDisplayZoomEx (long *CenterX, long *CenterY, double *ZoomFactor)
 Ascertain the current zoom factor and pixel position of the center of the window. More...
 
boolean GetLabelPosition (long ID, long *x, long *y)
 Determines the position of the selected label. More...
 
boolean GetOverlayObjectPosition (long ID, long Index, long *x, long *y)
 Determines the position of a vertex of the specified overlay object. More...
 
double GetPanoramaZoomFactor ()
 Returns the zoom factor used in panorama mode. More...
 
boolean GetSelectedArea (double *x0, double *y0, double *x1, double *y1, double *x2, double *y2)
 Determines the three corner points of a marked rectangle or parallelogram in the display object. More...
 
boolean GetUserObjectPosition (long ID, long Index, long *x, long *y)
 Determines the position of a vertex of the specified user object. More...
 
boolean HasLabel (long ID)
 Checks if a label of a given ID exits. More...
 
boolean HasOverlayObject (long ID)
 Checks if a overlay object of a given ID exists. More...
 
boolean HasUserObject (long ID)
 Checks if a user object of a given ID exists.
More...
 
boolean HighLightLabel (long ID, boolean Highlight)
 Enables or disables the highlighted display of a certain label. More...
 
boolean HighLightOverlayObject (long ID, boolean Highlight)
 Turns the highlighting of a certain overlay object on or off. More...
 
boolean ImageToClient (long ImageX, long ImageY, long *ClientX, long *ClientY)
 Converts image coordinates to coordinates based on the display window. More...
 
boolean IsOverlayObjectAvailable (BSTR ObjectName, long *ObjectType, long *NumVertices, long *NumVerticesUsed)
 Ascertain whether an overlay object is available or not. More...
 
void Lock ()
 Blocks all other instances of the Display Control in order to synchronize calls to the user interface. More...
 
boolean MakeOverlayImage ()
 Transforms the active image in the display object inot an overlay-capable image format. More...
 
boolean MoveOverlayObject (long ID, long x, long y, boolean MoveAbsolute)
 Moves an overlay object to the absolute x,y position or by x,y pixels. More...
 
void Refresh ()
 Forces the image to be redrawn. More...
 
boolean RemoveAllLabels ()
 Deletes all labels from the display object. More...
 
boolean RemoveAllOverlayObjects ()
 Removes all overlay objects from the display object. More...
 
boolean RemoveAllOverlays ()
 Removes all overlays, including labels, overlay Plug-Ins and user-defined objects from the display object. More...
 
boolean RemoveAllUserObjects ()
 Deletes all user-defined graphic objects from the display object. More...
 
boolean RemoveLabel (long ID)
 Deletes a selected label from the display object. More...
 
boolean RemoveOverlayObject (long ID)
 Removes a certain overlay object from the display object. More...
 
boolean RemoveUserObject (long ID)
 Removes a selected user-defined object from the display object. More...
 
boolean SaveImage (BSTR Filename)
 Saves an image to a file using the given file name. This method has the same effect as a change to the Filename property. The CVCError event is triggered if an error occurs. More...
 
boolean SaveImageByDialog ()
 Saves an image to a file using the options of a dialog box. More...
 
boolean SaveWindowToBitmap (__int3264 hWnd, BSTR Filename)
 Saves the contents of a window to a bitmap file. More...
 
boolean SetDisplayZoom (long CenterX, long CenterY, long ZoomFactor)
 Sets the zoom factor of the display on screen. More...
 
boolean SetDisplayZoomEx (long CenterX, long CenterY, double ZoomFactor)
 Sets the zoom factor of the display on screen. More...
 
boolean SetSelectedArea (double x0, double y0, double x1, double y1, double x2, double y2)
 Sets the three corner points of a marked rectangle or parallelogram in the display object. More...
 
boolean SubAreaSelected ()
 Checks whether an image is selected. More...
 
void Unlock ()
 Release the lock on all other instances of the Display Control. More...
 

Detailed Description

Function Documentation

◆ AddLabel()

boolean AddLabel ( BSTR  Text,
boolean  CanDrag,
long  Color,
long  ID,
long  x,
long  y 
)

Generates a label and displays it in the the display object.

Parameters
[in]TextAny string to be shown in the label.
[in]CanDragControls whether the label can be dragged.
TRUE specifies that the label can be dragged, otherwise FALSE;
[in]ColorColor of the label.
For example: to get thre red color enter the value RGC(255,0,0).
[in]IDUnique ID identifying the label.
[in]xX coordinate of the label.
[in]yY coordinate of the label.
Returns
TRUE if was successful, FALSE otherwise.
Examples:
Delphi - Delphi Polar Transformation Example
Visual Basic - VB Display Example
Visual C++ - VC Display Example

◆ AddOverlayObject()

boolean AddOverlayObject ( BSTR  ObjectName,
BSTR  Text,
boolean  CanDrag,
boolean  XorOnly,
long  Color,
long  HighLightColor,
boolean  Filled,
long  ID,
long *  Vertices,
long *  ObjectData 
)

Generates an overlay object from a plug-in.

The name of the overlay object must match a name of an available overlay object (see AOOxxx properties). An overlay object can be described by a sequence of points (vertices). A line contains two vertices, a triangle three, a circle also two (a centerpoint and a point located on the perimeter). The position of the vertices is passed as image coordinates.

Attention
This method not supported under the .NET framework. In this case use AddOverlayObjectNET.
Parameters
[in]ObjectNameSpecifies the name of the overlay object. This name must be in the list of available overlay objects.
[in]TextAny user-defined string that is displayed in the status bar when the mouse cursor is located over the user object.
[in]CanDragDetermines whether the user object can be dragged.
TRUE specifies that the object can be dragged, FALSE otherwise.
[in]XorOnlyDefines the mode in which the graphic element is drawn.
TRUE means that the overlay drawn is XORed to the image information, FALSE otherwise means that the used mode is CopyPen. During the dragging process the XorOnly mode is always used.
[in]ColorNormal character color.
[in]HighLightColorCharacter color when highlighted.
[in]FilledDefines whether the object is filled or not. Only overlay objects which have an area can be filled.
TRUE specifies that the object is filled, otherwise FALSE means that the object is drawn as a border only.
[in]IDUnique ID identifying the object.
[in]VerticesPOINT-type listing that has a length of AOONumVertices and contains the positions of vertices. POINT is a structure of two Long values standing for the x and y coordinate of a point.
[in]ObjectDataCan be used to pass additional information to the overlay plug-in. Whether this parameter is used or not depends on the plug-in.
Returns
TRUE if was successful, FALSE otherwise.
Visual Basic Test Code:
The last parameter ObjectData has to be declared as a variable!
Dim ObjectData As Long
Dim CrosshairPos(2) As TPoint
ObjectData = 0
cvDispSrc.AddOverlayObject "Crosshair", "Hallo", True, False, RGB(255, 0, 0), RGB(0, 255, 0), False, 5, CrosshairPos(0).x, ObjectData
boolean AddOverlayObject(BSTR ObjectName, BSTR Text, boolean CanDrag, boolean XorOnly, long Color, long HighLightColor, boolean Filled, long ID, long *Vertices, long *ObjectData)
Generates an overlay object from a plug-in.
VC++ Test Code:
// left, top, right, bottom
vertices[0].x = 0;
vertices[0].y = 0;
vertices[1].y = 0;
vertices[1].y = 100;
csOverlayObjectText.Format ("My Test Rectangle");
m_lColor = RGB (0, 255, 0);
m_lHighlightColor = RGB (255, 0, 0);
// add the overlay object to the display
m_cvDisp.AddOverlayObject ((LPCTSTR) csObjectName,
(LPCTSTR) csOverlayObjectText,
TRUE, // Dragable
TRUE, // XOROnly,
m_lColor,
m_lHighlightColor,
m_dwNumOverlayObjects++, // unique ID
(long*)vertices,
NULL);
m_cvDisp.Refresh (); // refresh display
Examples:
Delphi - Delphi Overlay PlugIn Example
Visual Basic - VB Overlay PlugIn Example
Visual C++ - VC Overlay PlugIn Example

◆ AddOverlayObjectNET()

boolean AddOverlayObjectNET ( BSTR  ObjectName,
BSTR  Text,
boolean  CanDrag,
boolean  XorOnly,
long  Color,
long  HighLightColor,
boolean  Filled,
long  ID,
__int3264  PixelList,
void *  ObjectData 
)

Generates an overlay object from a plug-in.

The name of the overlay object must match a name of an available overlay object (see AOOxxx properties). An overlay object can be described by a sequence of points (vertices). A line contains two vertices, a triangle three, a circle also two (a centerpoint and a point located on the perimeter). The position of the vertices is passed as image coordinates in form of a pixel list.

Attention
Using Pascal, Visual Basic or C++ use the AddOverlayObject instead. This method is supported for all .Net languages.
Parameters
[in]ObjectNameSpecifies the name of the overlay object. This name must be in the list of available overlay objects.
[in]TextAny user-defined string that is displayed in the status bar when the mouse cursor is located over the user object.
[in]CanDragDetermines whether the user object can be dragged.
TRUE specifies that the object can be dragged, FALSE otherwise.
[in]XorOnlyDefines the mode in which the graphic element is drawn.
TRUE means that the overlay drawn is XORed to the image information, FALSE otherwise means that the used mode is CopyPen. During the dragging process the XorOnly mode is always used.
[in]ColorNormal character color.
[in]HighLightColorCharacter color when highlighted.
[in]FilledDefines whether the object is filled or not. Only overlay objects which have an area can be filled.
TRUE specifies that the object is filled, otherwise FALSE means that the object is drawn as a border only.
[in]IDUnique ID identifying the object.
[in]PixelListCVB PixelList type listing that has a length of AOONumVertices and contains the positions of vertices. The PixelList needs to have a Dimension of >= 2 having X and Y stored as the first two elements.
[in]ObjectDataCan be used to pass additional information to the overlay plug-in. Whether this parameter is used or not depends on the plug-in.
iCVcPlugIn.DLL contains a list of structures for all currently supported Plug-Ins. Use the ToIntPtr() function of one of this structures to retrieve a pointer to it's data and pass this pointer to this method.
Returns
TRUE if was successful, FALSE otherwise.
VB.NET Example Code:
Private Sub DoPolyLine()
Dim polyLinePos As PIXELLIST = CreatePixelList(3)
Dim polyData As New TPolyLinePlugInData(TPenStyle.DOT, 1, 37)
Dim i As Integer
// created sinus curve
For i = 0 To 360 Step 10
AddPixel(polyLinePos, New Double() {CDbl(i * cvImg.ImageWidth) / 360.0, _ CDbl(cvImg.ImageHeight) / 2.0 + (Math.Sin(CDbl(i) * 2.0 * 3.14 / 360.0) * CDbl(cvImg.ImageHeight) / 2.0), 0})
Next
// add overlay object
cvDisp.AddOverlayObjectNET("PolyLine", "My PolyLine", cDragable.Checked, cXOROnly.Checked, Color, Color, cFilled.CheckState, NumObjects, polyLinePos.ToInt32(), polyData.ToIntPtr())
// release pixel list
ReleaseIUnknown(ToCvbOBJ(polyLinePos.ToInt32()))
// refresh display
m_cvDisp.Refresh ();
End Sub
C# Example Code:
public void DrawRectangle(AxCVDISPLAYLib.AxCVdisplay display, string text, int color, int index, Point TopLeft, Point BottomRight, int OffsetX, int OffsetY)
{
Cvb.SharedPixelList pixelList;
Cvb.Image.CreatePixelList(2, out pixelList);
double[] pixelTopLeft = new double[2];
double[] pixelBottomRight = new double[2];
pixelTopLeft[0] = TopLeft.X;
pixelTopLeft[1] = TopLeft.Y;
pixelBottomRight[0] = BottomRight.X;
pixelBottomRight[1] = BottomRight.Y;
Cvb.Image.AddPixel(pixelList, pixelTopLeft);
Cvb.Image.AddPixel(pixelList, pixelBottomRight);
display.AddOverlayObjectNET("Rectangle", "", false, false, color, color, false, index, pixelList, IntPtr.Zero);
pixelList.Dispose();
//create pixel list
double[] textPosition = new double[2];
textPosition[0] = ((BottomRight.X - TopLeft.X) / 2) + TopLeft.X + OffsetX;
textPosition[1] = ((BottomRight.Y - TopLeft.Y) / 2) + TopLeft.Y + OffsetY;
Cvb.SharedPixelList pixels;
Cvb.Image.CreatePixelList(3, out pixels);
bool result = Cvb.Image.AddPixel(pixels, textPosition);
if (text.Length != 0)
{
Cvb.Plugin.TStaticTextOutPlugInData textData = new Cvb.Plugin.TStaticTextOutPlugInData(text, false);
//draw text
display.AddOverlayObjectNET("StaticTextOut", text, false, false, color, color, true, 1, pixels.Handle.ToInt32(), textData.ToIntPtr());
}
pixels.Dispose();
}
Examples:
Visual Basic .NET - VB Overlay PlugIn Example

◆ AddOverlayObjectNET2()

boolean AddOverlayObjectNET2 ( BSTR  ObjectName,
BSTR  Text,
boolean  CanDrag,
boolean  XorOnly,
long  Color,
long  HighLightColor,
boolean  Filled,
long  ID,
__int64  PixelList,
__int64  ObjectData 
)

Instantiates an overlay plugin object and adds it to this display.

For a general discussion of overlay plugins and a list of available overlay plugins please refer to the Image Manager documentation. Available overlay objects may also be enumerated with the Display control's AOOCount, AOOIndex, AOOName, AOONumVertices and AOONumVerticesUsed properties.

Attention
This method is intended for use with the .Net languages. Users of Pascal or C++ may call it, but they can make use of the slightly simpler AddOverlayObject method instead.
This method supersedes the flawed AddOverlayObjectNET function which should no longer be used.
Parameters
[in]ObjectNameName of the type of overlay plugin to be instantiated (overlay plugin names may be queried using AOOCount, AOOIndex and AOOName). When specifying a
[in]TextA user-definable text that will be displayed in the Display control's status bar whenever the mouse pointer hovers over one of the overlay plugin's drag handles.
[in]CanDragDetermines whether the overlay plugin may be dragged (TRUE) or not (FALSE).
[in]XorOnlyWhen set to TRUE, the overlay plugin will be painted in the XOR raster mode over the image (giving a colored and slightly inverted impression). Otherwise a solid paint mode will be used. Note that while dragging the overlay plugin over the display, the paint mode will always be XOR.
[in]ColorRegular color of the overlay plugin. Color values need to be given as integers with the red value stored in bit 0 to 7, the green value stored in bit 8 to 15 and the blue value stored in bit 16 to 23. Bit 24 and higher will not be evaluated and should be set to zero.
[in]ColorHighlight color of the overlay plugin. The highlight color will be used if the HighLightOverlayObject method has been called with an overlay plugin's creation ID to set it to highlighted mode. Color values need to be given as integers with the red value stored in bit 0 to 7, the green value stored in bit 8 to 15 and the blue value stored in bit 16 to 23. Bit 24 and higher will not be evaluated and should be set to zero.
[in]FilledWhen set to TRUE the overlay plugin area may be filled, otherwise only the outline may be painted. Note that this depends on the overlay plugin - not all plugins actually evaluate this parameter.
[in]IDUnique ID under which the overlay plugin shall be addressed after its creation (in function calls like MoveOverlayObject or RemoveOverlayObject). Note that these IDs must be unique and it is the caller's responsibility to make sure that this requirement is met. Using the same ID multiple times may lead to undefined behavior and/or memory leaks.
[in]PixelListCVB pixel list (i.e. the reference counted object addressed through a PIXELLIST handle) that contains the vertices that define the location and/or appearance of the overlay plugin. This list must have AOONumVertices entries and a dimension of at least two (additional entries will be ignored). Due to the limitations of the MIDL language the pixel list pointer will need to be passed as an integer (make sure to use ToInt64() on the CLR's IntPtr type).
[in]ObjectDataSome overlay plugins accept or even require additional data for completely defining their appearance. If that is the case, the iCVCPlugIn.dll wrapper contains an accompanying structure that should be used to pass these additional data. The structures all have a ToPointer() member that generates an IntPtr that may then be converted to a long (through ToInt64() which may then be passed to this function.
Returns
TRUE if the instantiation of the overlay plugin was successful, FALSE otherwise.
VB.NET Example Code:
Private Sub DoPolyLine()
Dim polyLinePos As PIXELLIST = CreatePixelList(3)
Dim polyData As New TPolyLinePlugInData(TPenStyle.DOT, 1, 37)
Dim i As Integer
// created sinus curve
For i = 0 To 360 Step 10
AddPixel(polyLinePos, New Double() {CDbl(i * cvImg.ImageWidth) / 360.0, _ CDbl(cvImg.ImageHeight) / 2.0 + (Math.Sin(CDbl(i) * 2.0 * 3.14 / 360.0) * CDbl(cvImg.ImageHeight) / 2.0), 0})
Next
// add overlay object
cvDisp.AddOverlayObjectNET2("PolyLine", "My PolyLine", cDragable.Checked, cXOROnly.Checked, Color, Color, cFilled.CheckState, NumObjects, polyLinePos.ToInt32(), polyData.ToIntPtr().ToInt64())
// release pixel list
Cvb.Image.ReleaseObj(polyLinePos)
// refresh display
m_cvDisp.Refresh ();
End Sub
C# Example Code:
public void DrawRectangle(AxCVDISPLAYLib.AxCVdisplay display, string text, int color, int index, Point TopLeft, Point BottomRight, int OffsetX, int OffsetY)
{
Cvb.SharedPixelList pixelList;
Cvb.Image.CreatePixelList(2, out pixelList);
double[] pixelTopLeft = new double[2];
double[] pixelBottomRight = new double[2];
pixelTopLeft[0] = TopLeft.X;
pixelTopLeft[1] = TopLeft.Y;
pixelBottomRight[0] = BottomRight.X;
pixelBottomRight[1] = BottomRight.Y;
Cvb.Image.AddPixel(pixelList, pixelTopLeft);
Cvb.Image.AddPixel(pixelList, pixelBottomRight);
display.AddOverlayObjectNET2("Rectangle", "", false, false, color, color, false, index, pixelList, 0);
pixelList.Dispose();
//create pixel list
double[] textPosition = new double[2];
textPosition[0] = ((BottomRight.X - TopLeft.X) / 2) + TopLeft.X + OffsetX;
textPosition[1] = ((BottomRight.Y - TopLeft.Y) / 2) + TopLeft.Y + OffsetY;
Cvb.SharedPixelList pixels;
Cvb.Image.CreatePixelList(3, out pixels);
bool result = Cvb.Image.AddPixel(pixels, textPosition);
if (text.Length != 0)
{
Cvb.Plugin.TStaticTextOutPlugInData textData = new Cvb.Plugin.TStaticTextOutPlugInData(text, false);
//draw text
display.AddOverlayObjectNET2("StaticTextOut", text, false, false, color, color, true, 1, pixels.Handle.ToInt32(), textData.ToIntPtr().ToInt64());
}
pixels.Dispose();
}
Examples:
Visual Basic .NET - VB Overlay PlugIn Example

◆ AddUserObject()

boolean AddUserObject ( BSTR  Text,
boolean  CanDrag,
boolean  XorOnly,
long  NumVertices,
long  ID,
__int3264  Vertices 
)

Generates a graphic overlay object.

A graphic object can be defined through a sequence of points (vertices). A line contains two vertices, a triangle three, a circle also two (a centerpoint and a point located on the perimeter). The vertices position is given in image coordinates. For a new image display the UserPaint event has to be triggered. This event tells the application which user object must be drawn again and where the object vertices are located now. This time the position is given in display coordinates. The user graphic can now be drawn by using the DCs.

Attention
This function is not supported in Visual Basic.
It is also not supported under the .NET framework. In this case use AddUserObjectNET.
Parameters
[in]TextAny string to be displayed in the status bar as soon as the mouse position is located on the user-defined object.
[in]CanDragDetermines whether the user object can be dragged.
TRUE specifies that the object can be dragged, FALSE otherwise.
[in]XorOnlyDetermines the mode used to draw the graphic.
TRUE means that the overlay drawn is XORed to the image information, FALSE otherwise means that the used mode is CopyPen. During the dragging process the XorOnly mode is always used.
[in]NumVerticesNumber of vertices of the graphic object.
[in]IDUnique ID identifying the object.
[in]VerticesPOINT-type listening that has length of NumVertices and contains the position of the vertices. POINT is a structure of two Long values standing for the x and y coordinate of a point.
Returns
TRUE if was successful, FALSE otherwise.
VC++ Test Code:
typedef POINT TLine [2]; TLine l;
// init position
l[0].x = 0; l[0].y = 0;
l[1].x = m_cvImg.GetImageWidth() / 2;
l[1].y = m_cvImg.GetImageHeight() / 2;
// remove previous line
m_cvDisp.RemoveUserObject (ID_LINE);
// draw new line
m_cvDisp.AddUserObject("My dotted Line", m_Dragable, m_XorOnly, 2, ID_LINE, (long) &l);
m_cvDisp.Refresh (); //...
void COverlayDlg::OnUserPaintCvdisplayctrl1(long ID, long NumVertices, long Vertices, BOOL Dragging, long hDC)
{ TLine* l; TTriangle* t; HDC dc; HBRUSH hBrush; HPEN hPen;
// dc to the client window dc = (HDC) hDC;
// switch user object switch (ID)
{
case ID_LINE:
// get black pen
SelectObject (dc, GetStockObject (BLACK_PEN));
// our vertices now in window coordinates
l = (TLine*) Vertices;
// draw the line
MoveToEx(dc, (((POINT*)l)[0]).x, (((POINT*)l)[0]).y, NULL);
LineTo (dc, (((POINT*)l)[1]).x, (((POINT*)l)[1]).y); break;
case ID_DOTTEDLINE:
}
Related Topics:
UserPaint event
Examples:
Visual C++ - VC Blob Example - from the CVB Blob Tool

◆ AddUserObjectNET()

boolean AddUserObjectNET ( BSTR  Text,
boolean  CanDrag,
boolean  XorOnly,
long  ID,
__int3264  PixelList 
)

Generates a graphic overlay object.

A graphic object can be defined through a sequence of points (vertices). A line contains two vertices, a triangle three, a circle also two (a centerpoint and a point located on the perimeter). The vertices position is given in image coordinates. For a new image display the UserPaint event has to be triggered. This event tells the application which user object must be drawn again and where the object vertices are located now. This time the position is given in display coordinates. The user graphic can now be drawn by using the DCs.

Attention
Using Pascal, Visual Basic or C++ use the AddOverlayObject instead. This method is supported for all .Net languages.
Parameters
[in]TextAny string to be displayed in the status bar as soon as the mouse position is located on the user-defined object.
[in]CanDragDetermines whether the user object can be dragged.
TRUE specifies that the object can be dragged, FALSE otherwise.
[in]XorOnlyDetermines the mode used to draw the graphic.
TRUE means that the overlay drawn is XORed to the image information, FALSE otherwise means that the used mode is CopyPen. During the dragging process the XorOnly mode is always used.
[in]IDUnique ID identifying the object.
[in]PixelListCVB PixelList type listing that has a length of AOONumVertices and contains the positions of vertices. The PixelList needs to have a Dimension of >= 2 having X and Y stored as the first two elements.
Returns
TRUE if was successful, FALSE otherwise.
Related Topics:
UserPaint event

◆ ClientToImage()

boolean ClientToImage ( long  ClientX,
long  ClientY,
long *  ImageX,
long *  ImageY 
)

Converts window coordinates to image coordinates.

Use this function, for example, to transform the position of the mouse position based on window coordinates into one based on image coordinates.

Parameters
[in]ClientXX coordinate based on the window coordinate system.
[in]ClientYY coordinate based on the window coordinate system.
[out]ImageXContains the final (image) x coordinate based on the image coordinate system.
[out]ImageYContains the final (image) y coordinate based on the image coordinate system.
Returns
TRUE if was successful, FALSE otherwise.

◆ CopyImageToClipboard()

boolean CopyImageToClipboard ( )

Copies the active AOI (refer to GetSelectedArea/ SetSelectedArea) from the display object to the Windows clipboard.

The AOI is transformed through the image coordinate system before it is copied.

Attention
This function is different to the CompImageToClipboard mehtod of the cvImage control, becaues the cvImage control does not perform the transformation through the coordinate system.
Returns
TRUE if copying was successful, FALSE otherwise.

◆ GetDisplayZoom()

boolean GetDisplayZoom ( long *  CenterX,
long *  CenterY,
long *  ZoomFactor 
)

Ascertain the current zoom factor and pixel position of the center of the window.

Parameters
[out]CenterXX coordinate of the window which is returned as image pixels.
[out]CenterYY coordinate of the window which is returned as image pixels.
[out]ZoomFactorCurrent zoom factor.
Returns
TRUE if was successful, FALSE otherwise.
Related Topics:
SetDisplayZoom, GetDisplayZoomEx, SetDisplayZoomEx

◆ GetDisplayZoomEx()

boolean GetDisplayZoomEx ( long *  CenterX,
long *  CenterY,
double *  ZoomFactor 
)

Ascertain the current zoom factor and pixel position of the center of the window.

In difference to the GetDisplayZoom method this method takes a double value for the zoom factor.

Parameters
[out]CenterXX coordinate of the window which is returned as image pixels.
[out]CenterYY coordinate of the window which is returned as image pixels.
[out]ZoomFactorCurrent zoom factor.
Returns
TRUE if was successful, FALSE otherwise.
Related Topics:
SetDisplayZoom, GetDisplayZoom, SetDisplayZoomEx, GetPanoramaZoomFactor

◆ GetLabelPosition()

boolean GetLabelPosition ( long  ID,
long *  x,
long *  y 
)

Determines the position of the selected label.

Parameters
[in]IDLabel ID from which the position will be checked.
[out]xContains the final x coordinate of the label.
[out]yContains the final y coordinate of the label.
Returns
TRUE if was successful, FALSE otherwise.

◆ GetOverlayObjectPosition()

boolean GetOverlayObjectPosition ( long  ID,
long  Index,
long *  x,
long *  y 
)

Determines the position of a vertex of the specified overlay object.

Parameters
[in]IDID of the overlay object whose position is to be determined.
[in]IndexIndex of the vertex whose position is to be determined.
[out]xContains the x coordinate of the object.
[out]yContains the y coordinate of the object.
Returns
TRUE if was successful, FALSE otherwise.

◆ GetPanoramaZoomFactor()

double GetPanoramaZoomFactor ( )

Returns the zoom factor used in panorama mode.

The panorama mode defines the minimum display zoom. Its is depending on the size of the display control window and the image size.

Returns
Zoom factor used in panorama mode.
Related Topics:
SetDisplayZoom, GetDisplayZoom, SetDisplayZoomEx, GetDisplayZoomEx

◆ GetSelectedArea()

boolean GetSelectedArea ( double *  x0,
double *  y0,
double *  x1,
double *  y1,
double *  x2,
double *  y2 
)

Determines the three corner points of a marked rectangle or parallelogram in the display object.

If the user did not mark anything the data returned is that of the whole image.

Parameters
[out]x0X coordinate of the point P0.
[out]y0Y coordinate of the point P0.
[out]x1X coordinate of the point P1.
[out]y1Y coordinate of the point P1.
[out]x2X coordinate of the point P2.
[out]y2Y coordinate of the point P2.
Returns
TRUE if was successful, FALSE otherwise.

◆ GetUserObjectPosition()

boolean GetUserObjectPosition ( long  ID,
long  Index,
long *  x,
long *  y 
)

Determines the position of a vertex of the specified user object.

Parameters
[in]IDID of the user-defined object whose position is to be determined.
[in]IndexIndex of the vertex of the user-defined object whose position is to be determined.
[out]xContains the x coordinate of the label.
[out]yContains the y coordinate of the label.
Returns
TRUE if was successful, FALSE otherwise.

◆ HasLabel()

boolean HasLabel ( long  ID)

Checks if a label of a given ID exits.

Parameters
[in]IDLabel ID.
Returns
TRUE if label was found, FALSE otherwise.

◆ HasOverlayObject()

boolean HasOverlayObject ( long  ID)

Checks if a overlay object of a given ID exists.

Parameters
[in]IDOverlay object ID.
Returns
TRUE if overlay object was found, FALSE otherwise.

◆ HasUserObject()

boolean HasUserObject ( long  ID)

Checks if a user object of a given ID exists.

Parameters
[in]IDUser object ID.
Returns
TRUE if user object was found, FALSE otherwise.

◆ HighLightLabel()

boolean HighLightLabel ( long  ID,
boolean  Highlight 
)

Enables or disables the highlighted display of a certain label.

Parameters
[in]IDLabel ID.
[in]HighlightTRUE enables highlighted display. FALSE disables higlighted display.
Returns
TRUE if was successful, FALSE otherwise.

◆ HighLightOverlayObject()

boolean HighLightOverlayObject ( long  ID,
boolean  Highlight 
)

Turns the highlighting of a certain overlay object on or off.

Parameters
[in]IDID of the overlay object.
[in]HighlightTRUE means that highlighting of the overlay object is on, FALSE otherwise.
Returns
TRUE if was successful, FALSE otherwise.

◆ ImageToClient()

boolean ImageToClient ( long  ImageX,
long  ImageY,
long *  ClientX,
long *  ClientY 
)

Converts image coordinates to coordinates based on the display window.

Use this function, for example, to transform an overlay given in image coordinates into window coordinates.

Parameters
[in]ImageXX coordinate based on the image coordinate system.
[in]ImageYY coordinate based on the image coordinate system.
[out]ClientXContains converted (image) x coordinate based on the window coordinate system.
[out]ClientYContains converted (image) y coordinate based on the window coordinate system.
Returns
TRUE if was successful, FALSE otherwise.

◆ IsOverlayObjectAvailable()

boolean IsOverlayObjectAvailable ( BSTR  ObjectName,
long *  ObjectType,
long *  NumVertices,
long *  NumVerticesUsed 
)

Ascertain whether an overlay object is available or not.

If an overlay object is available, information on the object is returned.

Parameters
[in]ObjectNameName of the overlay object.
[out]ObjectTypeType of overlay object.
[out]NumVerticesNumber of the externally visible vertices of the object.
[out]NumVerticesUsedNumber of the internal vertices of the object.
Returns
TRUE if was successful, FALSE otherwise.

◆ Lock()

void Lock ( )

Blocks all other instances of the Display Control in order to synchronize calls to the user interface.

No other instance can access the UI after this function has been called. Calling the Unlock method will restart all other acquisition threads of the Display Control.

Attention
Call this method only if you have multiple image acquisition devices in your system.
Related Topics:
Unlock
Examples:
Visual C++ - VC Multiple Grabber Example

◆ MakeOverlayImage()

boolean MakeOverlayImage ( )

Transforms the active image in the display object inot an overlay-capable image format.

The lowest bit of each image plane is reserved for the overlay and preset by 0. As soon as one overlay bit is set to 1 the overlay becomes visible. The transformed image now has only a 7-bit dynamic in each image plane.

Returns
TRUE if was successful, FALSE otherwise.
Related Topics:
LeftButtonMode

◆ MoveOverlayObject()

boolean MoveOverlayObject ( long  ID,
long  x,
long  y,
boolean  MoveAbsolute 
)

Moves an overlay object to the absolute x,y position or by x,y pixels.

Parameters
[in]IDID of the overlay object.
[in]xMoving to absolute x position or by x pixels. This depends on MoveAbsolute.
[in]yMoving to absolute y position or by y pixels. This depends on MoveAbsolute.
[in]MoveAbsoluteTRUE specifies that all vertices of the overlay object are moved in a way that the first vertex ends up at position x,y. FALSE means that all vertices are moved by x,y pixels.
Returns
TRUE if was successful, FALSE otherwise.

◆ Refresh()

void Refresh ( )

Forces the image to be redrawn.

This method is needed in order to refresh the display in the ImageSnaped event of the image control.

◆ RemoveAllLabels()

boolean RemoveAllLabels ( )

Deletes all labels from the display object.

Returns
TRUE if was successful, FALSE otherwise.

◆ RemoveAllOverlayObjects()

boolean RemoveAllOverlayObjects ( )

Removes all overlay objects from the display object.

Hints:
If you want to speed up removing UserObjects try RemoveAllOverlays or use the manual display Refresh property and set it to TRUE.
Returns
TRUE if was successful, FALSE otherwise.
Examples:
Delphi - Delphi Overlay PlugIn Example
Visual Basic - VB Overlay PlugIn Example
Visual C++ - VC Overlay PlugIn Example

◆ RemoveAllOverlays()

boolean RemoveAllOverlays ( )

Removes all overlays, including labels, overlay Plug-Ins and user-defined objects from the display object.

Returns
TRUE if was successful, FALSE otherwise.

◆ RemoveAllUserObjects()

boolean RemoveAllUserObjects ( )

Deletes all user-defined graphic objects from the display object.

Hints:
If you want to speed up removing UserObjects try RemoveAllOverlays or use the manual display Refresh property and set it to TRUE.
Attention
This function is not supported in Visual Basic.
Returns
TRUE if was successful, FALSE otherwise.
Examples:
Delphi - Delphi Overlay Example
Visual C++ - VC Image Overlay Example

◆ RemoveLabel()

boolean RemoveLabel ( long  ID)

Deletes a selected label from the display object.

Parameters
[in]IDLabel ID.
Returns
TRUE if was successful, FALSE otherwise.

◆ RemoveOverlayObject()

boolean RemoveOverlayObject ( long  ID)

Removes a certain overlay object from the display object.

Parameters
[in]IDID of the overlay object.
Returns
TRUE if was successful, FALSE otherwise.

◆ RemoveUserObject()

boolean RemoveUserObject ( long  ID)

Removes a selected user-defined object from the display object.

Parameters
[in]IDID of the user-defined object.
Returns
TRUE if was successful, FALSE otherwise.

◆ SaveImage()

boolean SaveImage ( BSTR  Filename)

Saves an image to a file using the given file name. This method has the same effect as a change to the Filename property. The CVCError event is triggered if an error occurs.

Attention
Check first the supported image formats.
Parameters
[in]FilenameEntire file name and path (e.g. C:\IMAGE\MYIMAGE.BMP).
Returns
TRUE if saving was successful, FALSE otherwise.

◆ SaveImageByDialog()

boolean SaveImageByDialog ( )

Saves an image to a file using the options of a dialog box.

This method has the same effect as a change to the Filename property. The CVCError event is triggered if an error occurs.

Attention
It is not necessary to explicity enter the file name in this function like in SaveImage. Check first the supported image formats.
Returns
TRUE if saving was successful, FALSE otherwise.

◆ SaveWindowToBitmap()

boolean SaveWindowToBitmap ( __int3264  hWnd,
BSTR  Filename 
)

Saves the contents of a window to a bitmap file.

The method provides the functionality of a simple screen capture utility.
If the user calls this method with a handle to the window of a display control, the function will save the image data as well as all image overlays. The windows client area is saved 'as it is' meaning that the size of the image is the same as the size of the display window and not the size of the image within the display.

Parameters
[in]hWndHandle to the window which client should be saved.
[in]FilenameFilename. Only bitmap files are supported by this function.
Returns
TRUE if was successful, FALSE otherwise.
Examples:
Visual Basic - VB Save Window Example

◆ SetDisplayZoom()

boolean SetDisplayZoom ( long  CenterX,
long  CenterY,
long  ZoomFactor 
)

Sets the zoom factor of the display on screen.

Attention
If the display image shows some kind of distortions please use the 1:1 mode for a correct display.
Parameters
[in]CenterXX coordinate of the window which is specified as image pixels.
[in]CenterYY coordinate of the window which is specified as image pixels.
[in]ZoomFactorRequired zoom factor (values are 0,1,2,4,8,16).
A factor of 0 means that the entire image is shown as big as possible in the window (Panorama View). A factor of 1 means that the image is shown in its original size.
Returns
TRUE if was successful, FALSE otherwise.
VC++ Test Code:
// show zoom factor in the Status line
m_cvDisplay.StatusScale( TRUE);
// show image in original size with zoom factor 1
m_cvDisplay.SetDisplayZoom( m_cvImage.ImageWidth/2, m_cvImage.ImageHeight/2, 1);
Related Topics:
GetDisplayZoom, GetDisplayZoomEx, SetDisplayZoomEx, StatusScale
Examples:
Delphi - Delphi Pseudocolor Example
Visual C++ - VC Image Statistics Example

◆ SetDisplayZoomEx()

boolean SetDisplayZoomEx ( long  CenterX,
long  CenterY,
double  ZoomFactor 
)

Sets the zoom factor of the display on screen.

In difference to the SetDisplayZoom method this method takes a double value for the zoom factor. There is no upper limit for the zoom factor. The lower limit is defined by GetPanoramaZoomFactor which returns the zoom factor that is used as the smallest zoom factor.

Attention
If the display image shows some kind of distortions please use the 1:1 mode for a correct display.
The zoom factor could be displayed via the Status Line Styles of the Display Control.
Parameters
[in]CenterXX coordinate of the window which is specified as image pixels.
[in]CenterYY coordinate of the window which is specified as image pixels.
[in]ZoomFactorRequired zoom factor.
The smallest value is depending on the zoom factor is used in panorama mode. A factor of 1 means that the image is shown in its original size.
Returns
TRUE if was successful, FALSE otherwise.
VC++ Test Code:
// show zoom factor in the Status line
m_cvDisplay.StatusScale( TRUE);
// show image in original size with zoom factor 1
m_cvDisplay.SetDisplayZoomEx( m_cvImage.ImageWidth/2, m_cvImage.ImageHeight/2, 1);
Related Topics:
GetDisplayZoom, GetDisplayZoomEx, SetDisplayZoom, GetPanoramaZoomFactor, StatusScale
Examples:
Delphi - Delphi Pseudocolor Example
Visual C++ - VC Image Statistics Example

◆ SetSelectedArea()

boolean SetSelectedArea ( double  x0,
double  y0,
double  x1,
double  y1,
double  x2,
double  y2 
)

Sets the three corner points of a marked rectangle or parallelogram in the display object.

Parameters
[in]x0X coordinate of the point P0.
[in]y0Y coordinate of the point P0.
[in]x1X coordinate of the point P1.
[in]y1Y coordinate of the point P1.
[in]x2X coordinate of the point P2.
[in]y2Y coordinate of the point P2.
Returns
TRUE if was successful, FALSE otherwise.

◆ SubAreaSelected()

boolean SubAreaSelected ( )

Checks whether an image is selected.

Using this function you can determine, for example, the generation of a rectangle or a parallelogram by means of the mouse.

Returns
TRUE if an image area is selected, FALSE otherwise.

◆ Unlock()

void Unlock ( )

Release the lock on all other instances of the Display Control.

Restart all other acquisition threads of the Display Control which were locked with the Lock.

Attention
Call this method only if you have multiple image acquisition devices in your system.
Related Topics:
Lock
Examples:
Visual C++ - VC Multiple Grabber Example