Skip to main content

MgraGetHookInfo

BoardSupported
Host SystemYes
V4L2Yes
Clarity UHDYes
Concord PoENo
GenTLYes
GevIQYes
GigE VisionYes
IndioNo
Iris GTXYes
Radient eV-CLYes
Rapixo CLYes
Rapixo CoFYes
Rapixo CXPYes
USB3 VisionYes

Get information about a 2D graphics list event.

Syntax

AIL_INT MgraGetHookInfo(
AIL_ID EventId, //in
AIL_INT64 InfoType, //in
void * UserVarPtr //out
)

Description

This function allows you to get information about the event that caused the hook-handler function to be called. MgraGetHookInfo should only be called within the scope of a 2D graphics list hook-handler function (see MgraHookFunction).

Parameters

EventId (in, AIL_ID)

Specifies the 2D graphics list event identifier received by the hook-handler function (see MgraHookFunction). The event will be of the type passed to the HookType parameter of the hook-handler function.

InfoType (in, AIL_INT64)

Specifies the type of information to get.

UserVarPtr *(out, void)

Specifies the address in which to write the requested information.

Parameter Associations

For getting information about a 2D graphics list event


An M_GRAPHIC_LIST_MODIFIED event ID

Specifies that the event that called the hook-handler function was due to the 2D graphics list being modified, either by an Aurora Imaging Library function or by interactive manipulations.

M_GRAPHIC_LIST_ID

Retrieves the Aurora Imaging Library identifier of the 2D graphics list that triggered the event.

ValueDescription
Graphics list identifierRetrieves the Aurora Imaging Library identifier of the 2D graphics list containing the graphic that triggered the event.

An M_GRAPHIC_MODIFIED event ID

Specifies that the event that called the hook-handler function was due to a graphic in the 2D graphics list being modified, either by an Aurora Imaging Library function or by interactive manipulations. If a graphic's selection (MgraControlList with M_GRAPHIC_SELECTED) is changed either programmatically or interactively, this event will not be triggered; the M_GRAPHIC_SELECTION_MODIFIED event will be triggered instead.

M_GRAPHIC_CONTROL_TYPE

Inquires the type of modification made to the graphics in the list that triggered the event.

ValueDescription
(see ControlType)
M_DELETESpecifies that one of the following has been called on the 2D graphics list, resulting in some graphics being removed from the 2D graphics list: MgraControlList with M_DELETE, MgraClear, or when MgraCopy with M_MOVE deletes graphics from a source 2D graphics list.
M_DRAW_DIRECTIONSpecifies that the option of how an arrow, pointing in the direction with which a graphic was defined is rendered (drawn), was modified.
M_EASY_SELECTIONSpecifies that the option of whether Aurora Imaging Library allows the easy selection of graphics on the display was modified.
M_GRAPHIC_CREATESpecifies that a new graphic has been added to the 2D graphics list, either using an Aurora Imaging Library function or through interactive manipulations.
M_GRAPHIC_INTERACTIVESpecifies that interactive manipulations, such as translating, rotating, and resizing, have changed the properties of a graphic in the 2D graphics list.
M_GRAPHIC_SOURCE_CALIBRATIONSpecifies that the identifier of the camera calibration information, used to interpret positioning and dimensioning information of a graphic defined in world units, was modified.
M_MOVESpecifies that a call to MgraCopy, with an in-place move (M_MOVE) operation, changed the order of the graphics inside the 2D graphics list.
M_MULTIPLE_SELECTIONSpecifies that the option of whether to permit interactive multiple selection using the Ctrl key was modified.
M_MULTIPLE_SELECTION_KEYSpecifies that the keyboard key that you can press to select multiple graphics with your mouse on the display was modified.
M_RESIZE_HEIGHTSpecifies that the graphic's height was increased or decreased.
M_RESIZE_WIDTHSpecifies that the graphic's width was increased or decreased.
M_ROTATESpecifies that a rotation operation was performed on the graphic, or one of its sub-elements.

M_GRAPHIC_LABEL_VALUE

Retrieves the label of the modified graphic that triggered the event.

ValueDescription
M_ALLSpecifies that all graphics in the 2D graphics list were modified using MgraClear or MgraControlList with M_ALL.
M_ALL_SELECTEDSpecifies that all selected graphics in the 2D graphics list were modified using MgraControlList with M_ALL_SELECTED.
M_LISTSpecifies that a 2D graphics list's setting was modified using MgraControlList with M_LIST.
M_MULTIPLE_LABELSSpecifies that more than one graphic was modified. This can happen when calling MgraCopy and with interactive manipulations (for example, translating many graphics).
ValueSpecifies the label of the graphic.

M_GRAPHIC_LIST_ID

Retrieves the Aurora Imaging Library identifier of the 2D graphics list containing the graphic that triggered the event.

ValueDescription
Graphics list identifierRetrieves the Aurora Imaging Library identifier of the 2D graphics list containing the graphic that triggered the event.

M_GRAPHIC_SUB_INDEX

Retrieves the index of the sub-element of the graphic that triggered the event.

ValueDescription
M_DEFAULTSpecifies that the event affected the whole graphic.
ValueSpecifies the index of the sub-element of the graphic that triggered the event.

An M_GRAPHIC_SELECTION_MODIFIED event ID

Specifies that the event that called the hook-handler function was due to a graphic being selected or deselected.

M_GRAPHIC_LABEL_VALUE

Retrieves the label of the graphic that triggered the event.

ValueDescription
M_MULTIPLE_LABELSSpecifies that more than one graphic was selected. This can happen when calling MgraControlList with M_GRAPHIC_SELECTED and with interactive manipulations (for example, Ctrl-clicking many graphics).
M_NO_LABELSpecifies a deselection triggered the event and no graphic was selected.
ValueSpecifies the label of the graphic that was selected.

M_GRAPHIC_LABEL_VALUE_DESELECTED

Retrieves the label of the graphic that was deselected when the event was triggered.

ValueDescription
M_MULTIPLE_LABELSSpecifies that more than one graphic was deselected.
M_NO_LABELSpecifies that no graphic was deselected.
ValueSpecifies the label of the graphic that was deselected.

M_GRAPHIC_LIST_ID

Retrieves the Aurora Imaging Library identifier of the 2D graphics list containing the graphic that triggered the event.

ValueDescription
Graphics list identifierRetrieves the Aurora Imaging Library identifier of the 2D graphics list containing the graphic that triggered the event.

An M_INTERACTIVE_GRAPHIC_STATE_MODIFIED event ID

Specifies that the event that called the hook-handler function was due to the 2D graphics list's interactive state being modified, either by an Aurora Imaging Library function or by interactive manipulations.

M_GRAPHIC_LABEL_VALUE

Retrieves the label of the graphic that triggered the event. For example, it can return the label of the graphic being dragged when the state of interactivity (M_INTERACTIVE_GRAPHIC_STATE) is M_STATE_GRAPHIC_DRAGGED.

ValueDescription
M_NO_LABELSpecifies that an Aurora Imaging Library function triggered the event.
ValueSpecifies the label of the graphic that triggered the event.

M_GRAPHIC_LIST_ID

Retrieves the Aurora Imaging Library identifier of the 2D graphics list that triggered the event.

ValueDescription
Graphics list identifierRetrieves the Aurora Imaging Library identifier of the 2D graphics list containing the graphic that triggered the event.

M_INTERACTIVE_GRAPHIC_PREVIOUS_STATE

Inquires the state of interactivity of the 2D graphics list before the event occurred. This always returns a different value than M_INTERACTIVE_GRAPHIC_STATE.

ValueDescription
M_STATE_BEING_CREATEDSpecifies that a new graphic was being created.
M_STATE_GRAPHIC_DRAGGEDSpecifies that a graphic was being dragged using the mouse.
M_STATE_GRAPHIC_HOVEREDSpecifies that the cursor was hovering over a graphic.
M_STATE_HANDLE_DRAGGEDSpecifies that a graphic's handle was being dragged using the mouse.
M_STATE_HANDLE_HOVEREDSpecifies that the cursor was hovering over a graphic's handle.
M_STATE_IDLESpecifies that the cursor was not hovering over anything and that no graphic was queued for creation.
M_STATE_WAITING_FOR_CREATIONSpecifies that a graphic was queued for creation.

M_INTERACTIVE_GRAPHIC_STATE

Inquires the current state of interactivity of the 2D graphics list.

ValueDescription
M_STATE_BEING_CREATEDSpecifies that a new graphic is being created.
M_STATE_GRAPHIC_DRAGGEDSpecifies that a graphic is being dragged using the mouse.
M_STATE_GRAPHIC_HOVEREDSpecifies that the cursor is currently hovering over a graphic.
M_STATE_HANDLE_DRAGGEDSpecifies that a graphic's handle is being dragged using the mouse.
M_STATE_HANDLE_HOVEREDSpecifies that the cursor is currently hovering over a graphic's handle.
M_STATE_IDLESpecifies that the cursor is not hovering over anything and that no graphic is queued for creation.
M_STATE_WAITING_FOR_CREATIONSpecifies that a graphic is queued for creation.

Combination Constants — Returns whether a rectangle's location in the image will not change

Optional.

Usage: You can add one of the following values to the above-mentioned values to specify that a rectangle's location in the image will not change, regardless of how Aurora Imaging Library interprets its reference position.

ValueDescription
M_SAME_LOCATIONSpecifies that, when you set M_POSITION_TYPE, Aurora Imaging Library also adjusts the rectangle's actual position in the image so it remains at the same location.

Combination Constants — For specifying the data type

Optional.

Usage: You can add one of the following values to the above-mentioned values to cast the requested information to a required data type.

M_TYPE_AIL_DOUBLE

Casts the requested information to an AIL_DOUBLE.

M_TYPE_AIL_ID

Casts the requested information to an AIL_ID. Note that M_TYPE_AIL_ID should only be used with M_GRAPHIC_LIST_ID.

M_TYPE_AIL_INT

Casts the requested information to an AIL_INT.

M_TYPE_AIL_INT32

Casts the requested information to an AIL_INT32.

M_TYPE_AIL_INT64

Casts the requested information to an AIL_INT64.

Return Value

Type: AIL_INT

The returned value is M_NULL if successful. If the operation fails, a non-null (!M_NULL) value is returned.

Copyright © 2026 Zebra Technologies.