Skip to main content

MgraInquire

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

Inquire information about a 2D graphics context.

Syntax

AIL_INT MgraInquire(
AIL_ID ContextGraId, //in
AIL_INT64 InquireType, //in
void * UserVarPtr //out
)

Description

This function inquires information about a specified 2D graphics context. To inquire about a 2D graphics list, use MgraInquireList.

Parameters

ContextGraId (in, AIL_ID)

Specifies the identifier of the 2D graphics context about which to inquire information. This parameter must be set to one of the following values:

For specifying the 2D graphics context

ValueDescription
M_DEFAULTSpecifies that the default 2D graphics context of the current Aurora Imaging Library application is used.

Note: Note that there is a different default 2D graphics context for each thread. | | 2D graphics context identifier | Specifies a valid 2D graphics context identifier, which you have allocated using MgraAlloc. |

InquireType (in, AIL_INT64)

Specifies the 2D graphics context setting to inquire.

UserVarPtr *(out, void)

Specifies the address in which to write the requested information. Since the MgraInquire function also returns the requested information, you can set this parameter to M_NULL.

Parameter Associations

For inquiring about general 2D graphics context settings

To inquire general 2D graphics context settings, the InquireType parameter should be set to one of the following values. Unless otherwise specified, these affect all types of graphics.


M_COLOR

Inquires the foreground color.

ValueDescription
M_RGB888Specifies an RGB value when using the 2D graphics context to draw in an 8-bit, 3-band buffer.
M_COLOR_BLACKSpecifies the color black.
M_COLOR_BLUESpecifies the color blue.
M_COLOR_BRIGHT_GRAYSpecifies the color bright gray.
M_COLOR_CYANSpecifies the color cyan.
M_COLOR_DARK_BLUESpecifies the color dark blue.
M_COLOR_DARK_CYANSpecifies the color dark cyan.
M_COLOR_DARK_GREENSpecifies the color dark green.
M_COLOR_DARK_MAGENTASpecifies the color dark magenta.
M_COLOR_DARK_REDSpecifies the color dark red.
M_COLOR_DARK_YELLOWSpecifies the color dark yellow.
M_COLOR_GRAYSpecifies the color gray.
M_COLOR_GREENSpecifies the color green.
M_COLOR_LIGHT_BLUESpecifies the color light blue.
M_COLOR_LIGHT_GRAYSpecifies the color light gray.
M_COLOR_LIGHT_GREENSpecifies the color light green.
M_COLOR_LIGHT_WHITESpecifies the color light white.
M_COLOR_MAGENTASpecifies the color magenta.
M_COLOR_REDSpecifies the color red.
M_COLOR_WHITESpecifies the color white.
M_COLOR_YELLOWSpecifies the color yellow.
ValueSpecifies a grayscale value.
Byte-encoded RGB valueSpecifies an encoded RGB value. To verify if the value is a byte-encoded RGB value, use theM_IS_RGB888 macro. To retrieve the R, G, and B bands, use the M_RGB888_R, M_RGB888_G, and M_RGB888_B macros.

M_DRAW_DIRECTION

Inquires how to draw (render) an arrow pointing in the direction with which a graphic was defined.

ValueDescription
M_DEFAULT
M_NONE (default)Specifies that no direction is drawn.
M_PRIMARY_DIRECTIONSpecifies to draw an arrow showing the primary direction of the graphic.
M_PRIMARY_DIRECTION + M_SECONDARY_DIRECTIONSpecifies to draw an arrow showing both the primary and secondary direction of the graphic.
M_SECONDARY_DIRECTIONSpecifies to draw an arrow showing the secondary direction of the graphic.

M_DRAW_OFFSET_X

Inquires the offset subtracted from the source X-coordinates.

ValueDescription
M_DEFAULT
Value (default)Specifies the X-coordinate offset to subtract, in pixels.

M_DRAW_OFFSET_Y

Inquires the offset subtracted from the source Y-coordinates.

ValueDescription
M_DEFAULT
Value (default)Specifies the Y-coordinate offset to subtract, in pixels.

M_DRAW_ZOOM_X

Inquires the scale factor in the X-direction.

ValueDescription
M_DEFAULT
Value > 0 (default)Specifies the scale factor in the X-direction.

M_DRAW_ZOOM_Y

Inquires the scale factor in the Y-direction.

ValueDescription
M_DEFAULT
Value > 0 (default)Specifies the scale factor in the Y-direction.

M_FIXTURE

Inquires the camera calibration information used when rendering (drawing or displaying) a graphic defined in world units, when both source camera calibration information and destination camera calibration information are available to interpret positioning and dimensioning information. If with respect to that of the source camera calibration information (M_USE_SOURCE_FIRST), positions and dimensions are transformed from this relative coordinate system to the absolute coordinate system; then, since it is assumed that there is only one absolute coordinate system, these positions and dimensions are transformed from the absolute coordinate system to the pixel coordinate system, using the destination camera calibration information.

ValueDescription
M_USE_DESTINATION_FIRST (default)Specifies that the camera calibration information of the destination is used when rendering the graphic.
M_USE_SOURCE_FIRSTSpecifies that the camera calibration information of the graphic, set with M_GRAPHIC_SOURCE_CALIBRATION, is used when rendering the graphic.

M_GRAPHIC_CONVERSION_MODE

Inquires how the shape of a graphic, defined in world units, is converted to pixels (rendered).

ValueDescription
M_PRESERVE_SHAPE_AVERAGESpecifies to render the graphic so that its shape is preserved, even if it means not respecting the camera calibration information exactly.
M_RESHAPE_FOLLOWING_DISTORTIONSpecifies that all points along the contour of the graphic will be converted using the camera calibration information, following any non-linear distortion.
M_RESHAPE_FROM_POINTS (default)Specifies that only a few key points or features will be converted using the camera calibration information; from these converted points, the rest of the graphic will be rendered respecting the shape of the graphic.

M_GRAPHIC_SOURCE_CALIBRATION

Inquires the identifier of the camera calibration information used to interpret positioning and dimensioning information of a graphic defined in world units.

ValueDescription
M_NULL (default)Specifies that no source camera calibration information is available to interpret positioning and dimensioning information of a graphic defined in world units, except when the graphic is drawn using the draw function (M...Draw) of a processing or analysis module; in this case, the camera calibration information of the context or result will be used.
Aurora Imaging Library IdentifierSpecifies the identifier of a camera calibration context, image buffer or processing or analysis module result buffer, whose camera calibration information to use; this object is only associated with the 2D graphics context, not copied.

M_INPUT_UNITS

Inquires the units with which to interpret the graphic's positional and dimensional information.

ValueDescription
M_DISPLAYSpecifies to interpret the values in pixel units that, unlike M_PIXEL, are not altered when the display is panned or zoomed.
M_PIXEL (default)Specifies to interpret the values in pixel units, with respect to the pixel coordinate system.
M_WORLDSpecifies to interpret the values in world units, with respect to the relative coordinate system.

M_LINE_THICKNESS

Inquires the thickness of the lines and diameter of the dots.

ValueDescription
Value >= 1 (default)Specifies the thickness of the lines and diameter of the dots, in pixels.

M_OWNER_SYSTEM

Inquires the Aurora Imaging Library identifier (AIL_ID) of the system on which the 2D graphics context has been allocated.

ValueDescription
M_DEFAULT_HOSTSpecifies the default Host system of the current Aurora Imaging Library application.
System identifierSpecifies a valid system identifier, previously allocated using MsysAlloc.

M_OWNER_SYSTEM_TYPE

Inquires the type of system on which the 2D graphics context was allocated.

ValueDescription
M_SYSTEM_CLARITY_UHD_TYPESpecifies an Aurora Imaging Library Clarity UHD system.
M_SYSTEM_CONCORD_POE_TYPESpecifies an Aurora Imaging Library Concord POE system.
M_SYSTEM_GENTL_TYPESpecifies an Aurora Imaging Library GenTL system.
M_SYSTEM_GEVIQ_TYPESpecifies an Aurora Imaging Library GevIQ system.
M_SYSTEM_GIGE_VISION_TYPESpecifies an Aurora Imaging Library GigE Vision system.
M_SYSTEM_HOST_TYPESpecifies the Host.
M_SYSTEM_INDIO_TYPESpecifies an Aurora Imaging Library Indio system.
M_SYSTEM_IRIS_GTX_TYPESpecifies an Aurora Imaging Library Iris GTX system.
M_SYSTEM_RADIENTEVCL_TYPESpecifies an Aurora Imaging Library Radient eV-CL system.
M_SYSTEM_RAPIXOCL_TYPESpecifies an Aurora Imaging Library Rapixo Pro CL system.
M_SYSTEM_RAPIXOCOF_TYPESpecifies an Aurora Imaging Library Rapixo CoF system.
M_SYSTEM_RAPIXOCXP_TYPESpecifies an Aurora Imaging Library Rapixo CXP system.
M_SYSTEM_USB3_VISION_TYPESpecifies an Aurora Imaging Library USB3 Vision system.
M_SYSTEM_V4L2_TYPESpecifies an Aurora Imaging Library Video4Linux2 system.

To inquire 2D graphics context settings that affect the interactivity of a graphic, drawn in a 2D graphics list associated with a display when interactive mode is enabled (MdispControl with M_GRAPHIC_LIST_INTERACTIVE set to M_ENABLE), the InquireType parameter should be set to one of the following values.


M_EDITABLE

Inquires whether a graphic can be edited via user interaction in an interactive display. If a graphic is not visible or if it is not selectable, it is not editable and this setting is ignored.

ValueDescription
M_DISABLESpecifies that the graphic cannot be edited via user interaction.
M_ENABLE (default)Specifies that the graphic can be edited via user interaction.

M_RESIZABLE

Inquires whether a graphic can be resized via user interaction in an interactive display. If a graphic is not visible, not selectable, or not editable, it is not resizable and this setting is ignored.

ValueDescription
M_DISABLESpecifies that the graphic cannot be resized via user interaction and the resize handles will not be displayed if a graphic is selected.
M_ENABLE (default)Specifies that the graphic can be resized via user interaction by clicking and dragging one of the resize handles.

M_ROTATABLE

Inquires whether a graphic can be rotated via user interaction in an interactive display. If a graphic is not visible, not selectable, or not editable, it is not rotatable and this setting is ignored.

ValueDescription
M_DISABLESpecifies that the graphic cannot be rotated via user interaction and the rotate handle will not be displayed if a graphic is selected.
M_ENABLE (default)Specifies that the graphic can be rotated via user interaction by clicking and dragging the rotation handle.

M_SELECTABLE

Inquires whether a graphic in a 2D graphics list can be selected via user interaction in an interactive display. If a graphic is not visible, it is not selectable and this setting is ignored.

ValueDescription
M_DISABLESpecifies that the graphic cannot be selected via user interaction.
M_ENABLE (default)Specifies that the graphic can be selected by clicking on it.

M_SPECIFIC_FEATURES_EDITABLE

Inquires whether a graphic can be modified via user interaction in an interactive display using handles that are specific to its graphic type. If a graphic is not visible, not selectable, or not editable, it cannot be modified using its type-specific handles and this setting is ignored.

ValueDescription
M_DISABLESpecifies that the graphic cannot be modified via user interaction and its specific feature handles will not be displayed if a graphic is selected.
M_ENABLE (default)Specifies that the graphic can be modified via user interaction by clicking and dragging one of the specific feature handles.

M_TRANSLATABLE

Inquires whether a graphic can be moved (translated) via user interaction in an interactive display. If a graphic is not visible, not selectable, or not editable, it is not movable and this setting is ignored.

ValueDescription
M_DISABLESpecifies that the graphic cannot be moved via user interaction.
M_ENABLE (default)Specifies that the graphic can be moved via user interaction by clicking and dragging the graphic, its selection box, or its center handle.

M_VISIBLE

Inquires whether a graphic is rendered on the display.

ValueDescription
M_FALSESpecifies that the graphic is not rendered.
M_TRUE (default)Specifies that the graphic is rendered.

For inquiring about a setting specific to text

To inquire 2D graphics context settings that apply only to text (MgraText), the InquireType parameter should be set to one of the following values.


M_BACKCOLOR

Inquires the background color.

ValueDescription
M_RGB888Specifies an RGB value when using the 2D graphics context to draw in an 8-bit, 3-band buffer.
M_COLOR_BLACKSpecifies the color black.
M_COLOR_BLUESpecifies the color blue.
M_COLOR_BRIGHT_GRAYSpecifies the color bright gray.
M_COLOR_CYANSpecifies the color cyan.
M_COLOR_DARK_BLUESpecifies the color dark blue.
M_COLOR_DARK_CYANSpecifies the color dark cyan.
M_COLOR_DARK_GREENSpecifies the color dark green.
M_COLOR_DARK_MAGENTASpecifies the color dark magenta.
M_COLOR_DARK_REDSpecifies the color dark red.
M_COLOR_DARK_YELLOWSpecifies the color dark yellow.
M_COLOR_GRAYSpecifies the color gray.
M_COLOR_GREENSpecifies the color green.
M_COLOR_LIGHT_BLUESpecifies the color light blue.
M_COLOR_LIGHT_GRAYSpecifies the color light gray.
M_COLOR_LIGHT_GREENSpecifies the color light green.
M_COLOR_LIGHT_WHITESpecifies the color light white.
M_COLOR_MAGENTASpecifies the color magenta.
M_COLOR_REDSpecifies the color red.
M_COLOR_WHITESpecifies the color white.
M_COLOR_YELLOWSpecifies the color yellow.
ValueSpecifies a grayscale value.
Byte-encoded RGB valueSpecifies an encoded RGB value. To verify if the value is a byte-encoded RGB value, use theM_IS_RGB888 macro. To retrieve the R, G, and B bands, use the M_RGB888_R, M_RGB888_G, and M_RGB888_B macros.

M_BACKGROUND_MODE

Inquires whether the text's background is filled.

ValueDescription
M_OPAQUE (default)Specifies that the background will be filled with the current background color before drawing text.
M_TRANSPARENTSpecifies not to change the background before drawing text.

M_FONT

Inquires the character font.

ValueDescription
M_FONT_DEFAULTSame as M_FONT_DEFAULT_SMALL.
M_FONT_DEFAULT_LARGESpecifies a large bitmap font, where each character is drawn in a 16x32 pixel area.
M_FONT_DEFAULT_MEDIUMSpecifies a medium bitmap font, where each character is drawn in a 12x24 pixel area.
M_FONT_DEFAULT_SMALLSpecifies a small bitmap font, where each character is drawn in a 8x16 pixel area.
M_FONT_DEFAULT_TTFSpecifies the default TrueType font of your operating system.
M_FONT_TTFSpecifies a TrueType font. This value is returned when you have specified a TrueType font using MgraFont.

M_FONT_AUTO_SELECT

Inquires whether Aurora Imaging Library will search for a suitable font to draw text if the currently selected font is a TrueType font that does not support the character code.

ValueDescription
M_DISABLESpecifies that Aurora Imaging Library will not search for a suitable font.
M_ENABLE (default)Specifies that Aurora Imaging Library will search for a suitable font.

M_FONT_SIZE

Inquires the size text is drawn when using a TrueType font.

ValueDescription
Value >= 1 (default)Specifies the text's font size, in points.

M_FONT_X_SCALE

Inquires the font's horizontal scaling factor.

ValueDescription
Value > 0 (default)Specifies the factor by which to multiply the width of the font's characters.

M_FONT_Y_SCALE

Inquires the font's vertical scaling factor.

ValueDescription
Value > 0 (default)Specifies the factor by which to multiply the height of the font's characters.

M_TEXT_ALIGN_HORIZONTAL

Inquires the horizontal alignment of text.

ValueDescription
M_CENTERSpecifies that text is horizontally centered.
M_LEFT (default)Specifies that text is left-aligned.
M_RIGHTSpecifies that text is right-aligned.

M_TEXT_ALIGN_VERTICAL

Inquires the vertical alignment of text.

ValueDescription
M_BOTTOMSpecifies that text is bottom-aligned.
M_CENTERSpecifies that text is vertically centered.
M_TOP (default)Specifies that text is top-aligned.

M_TEXT_BORDER

Inquires how borders are drawn around the text. Note that a combination of the values below can be returned. Bitwise operators must be used to verify the presence of a specific border.

ValueDescription
M_BOTTOMSpecifies that a line is drawn underneath the text.
M_LEFTSpecifies that a line is drawn to the left of the text.
M_NONE (default)Specifies that no border is drawn around the text.
M_RIGHTSpecifies that a line is drawn to the right of the text.
M_TOPSpecifies that a line is drawn above the text.

M_TEXT_DIRECTION

Inquires the direction text is drawn when using a TrueType font.

ValueDescription
M_LEFT_TO_RIGHT (default)Specifies that text will be drawn from left to right.
M_RIGHT_TO_LEFTSpecifies that text will be drawn from right to left.

Combination Constants — For inquiring the color value used (for 16- or 32-bit color buffers)

Optional.

Usage: You can add one of the following values to the above-mentioned values to get the color used in the 2D graphics context for a 16-bit or 32-bit color buffer.

You must inquire each color band (R,G, and B) separately.

ValueDescription
M_BLUEInquires the blue color band.
M_GREENInquires the green color band.
M_REDInquires the red color band.

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_OWNER_SYSTEM and M_GRAPHIC_SOURCE_CALIBRATION.

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 the requested information, cast to an AIL_INT. If the requested information does not fit into an AIL_INT, this function will return M_NULLor truncate the information.

Copyright © 2026 Zebra Technologies.