imgSnapArea

NI IMAQ Function

imgSnapArea

Usage

rval imgSnapArea(SESSION_ID sid, void** bufAddr, uInt32 top, uInt32 left, uInt32 height, uInt32 width, uInt32 rowPixels);

Purpose

Acquires a single image. This function operates the same as imgSnap, but is used to acquire only a portion of the image.

Parameters

Name Type Direction
sid SESSION_ID input
bufAddr void** input/output
top uInt32 input
left uInt32 input
height uInt32 input
width uInt32 input
rowPixels uInt32 input
rval Int32 output

Parameter Discussion

sid: valid SESSION_ID.

bufAddr: pointer to a pointer to an area of memory in which to store the image. If the parameter points to a NULL pointer, this call allocates a buffer, acquires an image, and returns the buffer address in the location specified by bufAddr. If the parameter points to a non-NULL pointer, this function acquires into that buffer.

top: top offset of the first pixel to acquire.

left: left offset of the first pixel to acquire.

height: height of the area to acquire.

width: width of the area to acquire.

rowPixels: total number of pixels in each image line. Passing a zero for this parameter causes the function to ignore the parameter and use the IMG_ATTR_ROWPIXELS attribute instead. Use this parameter for byte alignment or if the image buffer contains a border for image processing.

Return Value

This function returns 0 on success. On failure, this function returns an error code. For more information, call imgShowError.