imaqSelectLine

NI Vision for LabWindows/CVI Function

imaqSelectLine

Usage

int imaqSelectLine(const Image* image, Point* start, Point* end, const ConstructROIOptions* options, int* okay);

Purpose

Displays the image in a modal window and allows the user to draw a line on it. After the user draws the line, the function hides the window.

Image Types Supported

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

Parameters

Name

Type

Description

image const Image* The image from which the user selects a line.
start Point* On return, this parameter specifies the coordinates of the start of the line chosen by the user. If the user does not select a line, the function sets all of the elements of start to –1. This parameter is required and cannot be NULL.
end Point* On return, this parameter specifies the coordinates of the end of the line chosen by the user. If the user does not select a line, the function sets all of the elements of end to –1. This parameter is required and cannot be NULL.
options const ConstructROIOptions* Describes how a function presents the line constructor window.
okay int* On return, this parameter is TRUE if the user pressed the OK button to end the selection of a line. Otherwise, this parameter is FALSE. Set this parameter to NULL if you do not need this information.

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().

Parameter Discussion

options—Set options to NULL to use the default options, as follows:

windowNumber IMAQ_MODAL_DIALOG
windowTitle "Select a Line"
type IMAQ_PALETTE_GRAY
palette NULL
numColors 0