Click or drag to resize
Accord.NET (logo)

XimeaCameraGetImage Method (Int32, Boolean)

Get image from the opened XIMEA camera.

Namespace:  Accord.Video.Ximea
Assembly:  Accord.Video.Ximea (in Accord.Video.Ximea.dll) Version: 3.8.0
Syntax
public Bitmap GetImage(
	int timeout,
	bool makeCopy
)
Request Example View Source

Parameters

timeout
Type: SystemInt32
Maximum time to wait in milliseconds till image becomes available.
makeCopy
Type: SystemBoolean
Make a copy of the camera's image or not.

Return Value

Type: Bitmap
Returns image retrieved from the camera.
Exceptions
ExceptionCondition
VideoExceptionAn error occurred while communicating with a camera. See error message for additional information.
NotConnectedExceptionNo camera was opened, so can not access its methods.
TimeoutExceptionTime out value reached - no image is available within specified time value.
Remarks

If the makeCopy is set to , then the method creates a managed copy of the camera's image, so the managed image stays valid even when the camera is closed. However, setting this parameter to creates a managed image which is just a wrapper around camera's unmanaged image. So if camera is closed and its resources are freed, the managed image becomes no longer valid and accessing it will generate an exception.

See Also