imaqCopyRect

NI Vision for LabWindows/CVI Function

imaqCopyRect

Usage

int imaqCopyRect(Image* dest, const Image* source, Rect rect, Point destLoc);

Purpose

Copies an area of one image into another image. You can copy the source area to a new destination image or to another area in the source image. The source and destination images must be of the same type. If the source area is larger than the destination area, the source area is clipped. The size of the destination image and pixels outside the destination area remain unchanged. To make a duplicate of an image, including border and calibration information, use imaqDuplicate().

Image Types Supported

IMAQ_IMAGE_U8, IMAQ_IMAGE_U16, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL, IMAQ_IMAGE_COMPLEX, IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL, IMAQ_IMAGE_RGB_U64

Parameters

Name

Type

Description

dest Image* The destination image.
source const Image* The source image.
rect Rect The area of the source to copy into the destination. Set this parameter to IMAQ_NO_RECT to copy the whole source image to the destination.
destLoc Point The coordinates of the top-left pixel in the destination image where the function copies the source area. This location can be anywhere on the image or on the border of the image.

Return Value

Type

Description

int On success, this function returns a non-zero value. On failure, this function returns 0. To get extended error information, call imaqGetLastError().