ImageGrabbedEventArgs Class#
Inheritance Hierarchy#
System.Object
System.EventArgs
Basler.Pylon.ImageGrabbedEventArgs
Syntax#
C#
VB
The ImageGrabbedEventArgs type exposes the following members.
Constructors#
Name | Description | |
---|---|---|
ImageGrabbedEventArgs | Initializes a new instance of the ImageGrabbedEventArgs class. |
Properties#
Name | Description | |
---|---|---|
GrabResult | Retrieves the grab result. | |
IsClone | Indicates if the event arguments have been created by calling Clone(). |
Methods#
Name | Description | |
---|---|---|
Clone | Clones the event arguments including the grab result. | |
DisposeGrabResultIfClone | Disposes the grab result held if the event arguments have been created by calling Clone(). |
Remarks#
Caution |
---|
The grab result will be disposed after the event call. If you want to keep the grab result, clone the event arguments or the grab result. |
C#
private void OnImageGrabbed(Object sender, ImageGrabbedEventArgs e)
{
if (InvokeRequired)
{
// If called from a different thread, we must use the Invoke method to marshal the call to the proper thread.
BeginInvoke(new EventHandler<ImageGrabbedEventArgs>(OnImageGrabbed), sender, e.Clone());
return;
}
try
{
//do something
}
finally
{
e.DisposeGrabResultIfClone();
}
}
ImageGrabbedEventArgs.Clone Method#
Clones the event arguments including the grab result.
Syntax#
C#
VB
Return Value#
Type: ImageGrabbedEventArgs
Returns a copy of the event arguments with a clone of the contained grab result. The cloned grab result must be disposed.
Remarks#
Note |
---|
The grab result or the cloned event must be disposed. |
ImageGrabbedEventArgs.DisposeGrabResultIfClone Method#
Disposes the grab result held if the event arguments have been created by calling Clone().
Syntax#
C#
VB
ImageGrabbedEventArgs Constructor#
Initializes a new instance of the ImageGrabbedEventArgs class.
Syntax#
C#
VB
Parameters#
- grabResult
- Type: Basler.Pylon.IGrabResult
A grab result.
ImageGrabbedEventArgs.GrabResult Property#
Retrieves the grab result.
Syntax#
C#
VB
Property Value#
Type: IGrabResult
Remarks#
Caution |
---|
The grab result is going to be disposed after the event call. Clone the event arguments or the grab result if you want to keep the grab result. |
ImageGrabbedEventArgs.IsClone Property#
Indicates if the event arguments have been created by calling Clone().
Syntax#
C#
VB
Property Value#
Type: Boolean