imaqGetLastEvent
Usage
int imaqGetLastEvent(WindowEventType* type, int* windowNumber, Tool* tool, Rect* rect);
Purpose
Returns the last event that the user performed on an image window.
Note Do not use this function if you have registered an event callback with imaqSetEventCallback(). |
Parameters
Name
|
Type
|
Description
|
---|---|---|
type | WindowEventType* | On return, the last event that occurred, such as IMAQ_DOUBLE_CLICK_EVENT - The user has double clicked in a window. Set this parameter to NULL if you do not need this information. |
windowNumber | int* | On return, the window number of the window in which the last event occurred. Set this parameter to NULL if you do not need this information. |
tool | Tool* | If the event was IMAQ_DRAW_EVENT, tool is the ROI tool that the user drew with. Tool information is also returned for the IMAQ_CLICK_EVENT and IMAQ_DOUBLE_CLICK_EVENT. If the event was not IMAQ_DRAW_EVENT, IMAQ_CLICK_EVENT, or IMAQ_DOUBLE_CLICK_EVENT, the function ignores this parameter. Set this parameter to NULL if you do not need this information. |
rect | Rect* | A rectangle describing the location of the event. 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
rect—For rect, the contents of the rectangle depend on the type, as follows:
- IMAQ_CLICK_EVENT—The top left corner of the rectangle is the location of the click. The width and height of the rectangle are 0.
- IMAQ_SCROLL_EVENT—The top left of the rectangle is the center of the displayed image. The width and height of the rectangle are 0.
- IMAQ_DRAW_EVENT—The rectangle is the bounding rectangle of the drawn shape.
- IMAQ_MOVE_EVENT or IMAQ_SIZE_EVENT—The rectangle is the new location of the window on the screen.
For all other events, the function ignores the rectangle.