Image Control Reference 15.0
Events

Functions

void CVCError (ErrorCode ErrorCode, BSTR ErrorString, boolean *Continue)
 This event is fired if an error occurs in the Image Control. More...
 
void EndOfLine (long LinesToDo, boolean *Cancel)
 This event is triggered when ScanImage or ScanPlane is called at the end of every scanned line. More...
 
void ImageSnaped ()
 This event is only triggered if the image object is an image acquisition device and if the Grab property is set to TRUE. More...
 
void ImageUpdated ()
 This event is only triggered when the image object has changed. This is the case when a new image has been loaded from the hard disk or an image acquisition device driver.
 
void NextPixel (long Plane, long x, long y, long *Value, boolean *Cancel)
 This event is triggered for all scanned pixels. More...
 
void StartOfLine (long LinesToDo, boolean *Cancel)
 This event is triggered when ScanImage or ScanPlane is called at the beginning of every scanned line. More...
 

Detailed Description

Function Documentation

◆ CVCError()

void CVCError ( ErrorCode  ErrorCode,
BSTR  ErrorString,
boolean *  Continue 
)

This event is fired if an error occurs in the Image Control.

Attention
Please include the appropriate header file for your compiler (cvcerror.*).
Parameters
[in]ErrorCodeA unique number describing the error. The following error codes have been defined:
1CVC_E_ERROR
 This error cannot be described more precisely.
2CVC_E_PARAMETER
 Incorrect parameter in a function call.
3CVC_E_FILEIO
 File I/O error, for example while saving or loading an image.
4CVC_E_TIMEOUT
 Timeout during acquisition of an image in ping-pong mode if, for example, there is no trigger although the image acquisition device is waiting for such a signal.
5CVC_E_MEMORY
 Memory could not be allocated.
6CVC_E_INVALIDPLANE
 An invalid image plane has been specified.
7CVC_E_UNSUPPORTEDDATATYPE
 Data type that is not supported.
16CVC_E_NOIMAGE
 No image at all.
17CVC_E_NOINTERFACE
 No interface available.
[in]ErrorStringSpecifies the error text of the output.
[in]ContinueThis specifies whether execution should continue despite the error. The user can overwrite the value in order to change the default action. The default value depends on the function that caused the error.
TRUE specifies that a messate box will appear to inform the user of the error. FALSE means that it is possible to perform custom error handling, e.g. use a self-defined message-box.
Visual Basic Test Code:
This example shows the trapping of a timeout during image acquisition.
Private Sub cvImg_CVCError(Index As Integer, ByVal ErrorCode As CVIMAGELib.ErrorCode, ByVal ErrorString As String, Continue As Boolean)
Dim res As Integer
' ACQ timeout ? this is only available if pingpong is active
If ErrorCode = CVC_E_TIMEOUT Then
res = MsgBox(ErrorString & " Do you want to continue?", vbYesNo + vbSystemModal)
If res = vbYes Then
' continue acq and display automatically Image control error msg
Continue = True
Else
' cancel acq
Continue = False
End If
Else
MsgBox ErrorString
End If
End Sub
__int3264 Image
Determines the image object that is assigned to the Common Vision Image Control.
Definition: CVimage.odl:99
Examples:
Visual Basic - VB Fileformats Example

◆ EndOfLine()

void EndOfLine ( long  LinesToDo,
boolean *  Cancel 
)

This event is triggered when ScanImage or ScanPlane is called at the end of every scanned line.

Parameters
[in]LinesToDoNumber of lines still to come.
[in]CancelTRUE specifies that the scanning is terminated, otherwise FALSE.

◆ ImageSnaped()

void ImageSnaped ( )

This event is only triggered if the image object is an image acquisition device and if the Grab property is set to TRUE.

Related Topics:
Grab
Examples:
Delphi - nearly every Delphi example
Visual Basic - Basic nearly every VB example
Visual C++ - nearly every VC example, VC Sizeable Display

◆ NextPixel()

void NextPixel ( long  Plane,
long  x,
long  y,
long *  Value,
boolean *  Cancel 
)

This event is triggered for all scanned pixels.

Scanning is started by ScanImage or ScanPlane and can be terminated by setting Cancel to TRUE. The gray scale value of the pixel is passed by way of reference so that the pixel can be overwritten.

Parameters
[in]PlaneIndex of the current plane.
[in]xX position of the pixel.
[in]yY position of the pixel.
[in,out]ValueGray scale value of the pixel on position x and y.
[in]CancelTRUE specifies that the scanning is terminated, otherwise FALSE.

◆ StartOfLine()

void StartOfLine ( long  LinesToDo,
boolean *  Cancel 
)

This event is triggered when ScanImage or ScanPlane is called at the beginning of every scanned line.

Parameters
[in]LinesToDoNumber of lines still to come.
[in]CancelTRUE specifies that the scanning is terminated, otherwise FALSE.