The grab result passed can be evaluated here. It will be disposed when the call returns. If you want to keep the grab result, you must save it using the Clone() method. For more information, see IGrabResult.
Thread Safety: This event handler is synchronized with the camera.
Error Safety: Exceptions from this call will propagate through. The notification of event handlers stops when an exception is triggered.
Type: System.Int32 The timeout period in milliseconds for waiting for a grab result. Alternatively, the Infinite value can be set.
timeoutHandling
Type: Basler.Pylon.TimeoutHandling The action to perform when the functions exits with a timeout. If set to ThrowException, a timeout exception is thrown on timeout.
The following code shows a simplified version of what is done (happy path scenario):
//grab one image
camera.StreamGrabber.Start(1, GrabStrategy.OneByOne, GrabLoop.ProvidedByUser);
//grab is stopped automatically due to maxImages = 1
return camera.StreamGrabber.RetrieveResult( timeoutMs, timeoutHandling);
Type: System.Int32 The timeout period in milliseconds for waiting for a grab result. Alternatively, the Infinite value can be set.
timeoutHandling
Type: Basler.Pylon.TimeoutHandling The action to perform when the functions exits with a timeout. If set to ThrowException, a timeout exception is thrown on timeout.
Waits for a grab result if it is not yet available. Camera events are handled.
One grab result is retrieved per call (OneByOne grab strategy is applied).
If chunk mode is used, chunk data parsing is performed. The grab result data is updated using chunk data.
If a grab result becomes available, the image event ImageGrabbed is fired. The notification of event handlers stops when an event call triggers an exception.
If the maximum number of images has been grabbed, the grabbing is stopped by calling Stop().
You must check whether the grab represented by the grab result has been successful. For more information, see GrabSucceeded.
Preconditions:
There is no other thread waiting for a result.
Postconditions:
If no grab result has been retrieved, an empty grab result is returned in the grabResult parameter.
If the maximum number of images has been grabbed, grabbing is stopped.
If camera event handling is enabled and camera events were received, at least one or more camera event messages have been processed.
Thread Safety: This method is synchronized with the camera.
Error Safety: The camera object is still valid after an error. The grabbing is stopped if an exception is thrown.
The configuration event GrabStarting is fired. The notification of event handlers stops when an event call triggers an exception.
Grab-specific parameters of the camera object are locked, e.g. MaxNumBuffer.
If the camera device parameter ChunkModeActive is enabled, the chunk parsing support is initialized.
If the parameter GrabCameraEvents is enabled, the event grabbing support is initialized.
The AcquisitionStart command of the camera device is executed.
If the grabbing has been started successfully, the configuration event GrabStarted is fired. The notification of event handlers stops when an event call triggers an exception.
Preconditions:
The grabbing is stopped.
Postconditions:
The grabbing is started.
Grab-specific parameters of the camera object are locked, e.g. MaxNumBuffer.
Thread Safety: This method is synchronized with the camera.
Error Safety: The StreamGrabber is still valid after an error. Configuration event calls may throw exceptions. The grab implementation may throw exceptions. If the GrabStarted event call triggers an exception, the grabbing is stopped with Stop().
If a grab loop thread has been used in the last grab session, the grab loop thread context is joined with the context of the caller.
The configuration event GrabStarting is fired. The notification of event handlers stops when an event call triggers an exception.
Grab-specific parameters of the camera object are locked, e.g. MaxNumBuffer.
If the camera device parameter ChunkModeActive is enabled, the chunk parsing support is initialized.
If the parameter GrabCameraEvents is enabled, the event grabbing support is initialized.
The AcquisitionStart command of the camera device is executed.
If the grabbing has been started successfully, the configuration event GrabStarted is fired. The notification of event handlers stops when an event call triggers an exception.
If grabLoopType is set to ProvidedByStreamGrabber, an additional grab loop thread is started that calls RetrieveResult(Int32, TimeoutHandling) in a loop.
Preconditions:
The grabbing is stopped.
Postconditions:
The grabbing is started.
Grab-specific parameters of the camera object are locked, e.g. MaxNumBuffer.
If grabLoopType is set to ProvidedByStreamGrabber, an additional grab loop thread is running that calls RetrieveResult(Int32, TimeoutHandling) in a loop. Images are processed by registered image event handlers.
Thread Safety:This method is synchronized with the camera.
Error Safety: The StreamGrabber is still valid after an error. Configuration event calls may throw exceptions. The grab implementation may throw exceptions. If the GrabStarted event call triggers an exception, the grabbing is stopped with Stop().
Grabbing is started using the OneByOne grab strategy and the ProvidedByUser grab loop method. For each grabbed image, RetrieveResult(Int32, TimeoutHandling) must be called.
The configuration event GrabStarting is fired. The notification of event handlers stops when an event call triggers an exception.
Grab-specific parameters of the camera object are locked, e.g. MaxNumBuffer.
If the camera device parameter ChunkModeActive is enabled, the chunk parsing support is initialized.
If the parameter GrabCameraEvents is enabled, the event grabbing support is initialized.
The AcquisitionStart command of the camera device is executed.
If the grabbing has been started successfully, the configuration event GrabStarted is fired. The notification of event handlers stops when an event call triggers an exception.
Preconditions:
The grabbing is stopped.
Postconditions:
The grabbing is started.
Grab-specific parameters of the camera object are locked, e.g. MaxNumBuffer.
Thread Safety: This method is synchronized with the camera.
Error Safety: The StreamGrabber is still valid after an error. Configuration event calls may throw exceptions. The grab implementation may throw exceptions. If the GrabStarted event call triggers an exception, the grabbing is stopped with Stop().
Extends the Start(GrabStrategy, GrabLoop) method call by a number of images to grab. If the given number of images has been reached, StopGrabbing is called automatically. The images are counted according to the grab strategy. Skipped images are not taken into account.
If a grab loop thread has been used in the last grab session, the grab loop thread context is joined with the context of the caller.
The configuration event GrabStarting is fired. The notification of event handlers stops when an event call triggers an exception.
Grab-specific parameters of the camera object are locked, e.g. MaxNumBuffer.
If the camera device parameter ChunkModeActive is enabled, the chunk parsing support is initialized.
If the parameter GrabCameraEvents is enabled, the event grabbing support is initialized.
The AcquisitionStart command of the camera device is executed.
If the grabbing has been started successfully, the configuration event GrabStarted is fired. The notification of event handlers stops when an event call triggers an exception.
If grabLoopType is set to ProvidedByStreamGrabber, an additional grab loop thread is started that calls RetrieveResult(Int32, TimeoutHandling) in a loop.
Preconditions:
The grabbing is stopped.
Postconditions:
The grabbing is started.
Grab-specific parameters of the camera object are locked, e.g. MaxNumBuffer.
If grabLoopType is set to ProvidedByStreamGrabber, an additional grab loop thread is started that calls RetrieveResult(Int32, TimeoutHandling) in a loop. Images are processed by registered image event handlers.
Thread Safety:This method is synchronized with the camera.
Error Safety: The StreamGrabber is still valid after an error. Configuration event calls may throw exceptions. The grab implementation may throw exceptions. If the GrabStarted event call triggers an exception, the grabbing is stopped with Stop().
If the camera object not currently grabbing, nothing is done.
The configuration event GrabStopping is fired. Possible exceptions from event calls are caught and ignored. All event handlers are notified.
The AcquisitionStop command of the camera device is executed.
The grabbing is stopped.
All buffer queues are cleared.
If the grabbing has been stopped successfully, the GrabStopped configuration event is fired. Possible exceptions from event calls are caught and ignored. All event handlers are notified.
Postconditions:
The grabbing is stopped.
Grab specific parameters of the camera object are unlocked, e.g. MaxNumBuffer.
Thread Safety: This method is synchronized with the camera.
The use of this property is optional and intended for advanced use cases only. If nullptr is passed as buffer factory then the default buffer factory is used. Buffers are allocated when Start(GrabStrategy, GrabLoop) is called. A buffer factory must not be disposed while it is attached to the stream grabber object and it must not be disposed until the last buffer is freed. To free all buffers the grab needs to be stopped and all grab results must be released or destroyed.
Thread Safety: This property is synchronized with the camera.