Skip to main content

MmetDraw

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

Draw specific features or tolerances of a metrology context or of a metrology result.

Syntax

void MmetDraw(
AIL_ID ContextGraId, //in
AIL_ID ContextOrResultMetId, //in
AIL_ID DstImageBufOrListGraId, //out
AIL_INT64 Operation, //in
AIL_INT LabelOrIndex, //in
AIL_INT64 ControlFlag //in
)

Description

This function draws specific features or tolerances of a metrology context or of a metrology result, in the destination image buffer or 2D graphics list.

If you pass a context, MmetDraw can only draw the specified feature/tolerance if the function can internally compute it without the need of a source image. This is possible if the feature/tolerance is ultimately based on constructed edgel features built with external edgels/points (MmetAddFeature with M_EDGEL and M_EXTERNAL_FEATURE) and the external edgels/points have been specified using MmetPut, and/or if it is ultimately based on parametric features. Note that MmetDraw does not modify the context with internally calculated results.

You can draw results and settings, obtained relative to an offset, at the top-left corner of the destination image, using MgraControl with M_DRAW_OFFSET_X and M_DRAW_OFFSET_Y and zoom them using MgraControl withM_DRAW_ZOOM_X and M_DRAW_ZOOM_Y. For more information, see Drawing with an offset and scale.

[Image: MmetDrawZooming.png]

When zooming, MmetDraw will draw into the destination image buffer even if the buffer is not large enough to contain all of the zoomed image. If necessary, the image will be clipped.

If a template reference has been set using MmetControl with M_TEMPLATE_REFERENCE_ID, MmetDraw can draw the results of features and tolerances extracted from that template reference. You will need to inquire M_TEMPLATE_REFERENCE_SIZE_X and M_TEMPLATE_REFERENCE_SIZE_Y to allocate an appropriate destination buffer.

Parameters

ContextGraId (in, AIL_ID)

Specifies the identifier of the 2D graphics context to use when drawing. 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. |

ContextOrResultMetId (in, AIL_ID)

Specifies the metrology result buffer or context from which to extract the features to draw. The metrology result buffer must have been previously allocated using MmetAllocResult. The metrology context must have been previously allocated using MmetAlloc.

DstImageBufOrListGraId (out, AIL_ID)

Specifies the identifier of the destination image buffer or 2D graphics list in which to draw. The buffer can be any valid 1- or 3-band image buffer allocated using MbufAlloc.... The 2D graphics list must be previously allocated using MgraAllocList. By drawing into a display's overlay buffer or associating the 2D graphics list with the display, you can also annotate an image non-destructively.

Operation (in, AIL_INT64)

Specifies the type of drawing operation to perform. This parameter can be set to the following values:

For drawing a context characteristic

ValueDescription
M_DRAW_TEMPLATE_REFERENCEDraws the template reference. The LabelOrIndex parameter must be set to M_GENERAL.

Note: This operation cannot draw in a 2D graphics list. |

For drawing a feature characteristic

ValueDescription
M_DRAW_ACTIVE_EDGELSDraws only the edgels that satisfied all edgel constraints.
M_DRAW_ALL_EDGELSDraws all the edgels that were calculated in the target image. This includes the edgels that were used to measure a feature.
M_DRAW_FEATUREDraws the specified feature(s). In this case, you can also set the LabelOrIndex parameter to M_GLOBAL_FRAME.
M_DRAW_FITTED_EDGELSDraws only the edgels that satisfied all edgel constraints and fit constraints. The fitted edgels are those used by the fit operation to define a feature.
M_DRAW_NOISY_EDGELSDraws the edgels before they were denoised. Edgels are denoised using MmetControl with M_EDGEL_DENOISING_MODE.
M_DRAW_REGIONDraws the feature's search region.

When drawing in a 2D graphics list, this operation cannot draw ring and ring sector regions when M_REGION_ACCURACY_HIGH is set to M_DISABLE and the 2D graphics context's input units is set to world units (MgraControl with M_INPUT_UNITS set to M_WORLD). |

For drawing a tolerance characteristic

ValueDescription
M_DRAW_TOLERANCEDraws the geometric tolerance's icon. To view the icons, see MmetAddTolerance.
M_DRAW_TOLERANCE_AREADraws the area(s) used to define the area-based geometric tolerance. These tolerances are set using MmetAddTolerance with M_AREA_....
M_DRAW_TOLERANCE_AREA_NEGATIVEDraws the negative area(s) used to define the area-based geometric tolerance. Positive and negative areas occur when areas exist on both sides of a curve. The negative areas are those located on the side of the curve where the sum of the areas is the smallest. These tolerances are set using MmetAddTolerance with M_AREA_....

Note that what is considered the positive side changes if M_AREA_BETWEEN_CURVES_ONE_SIDE_ONLY is enabled. In this case, the positive and negative sides are determined by whether the global reference frame's Y-axis initially intersects with either the first or second curve (edgel feature) that is specified with the M_AREA_BETWEEN_CURVES tolerance. | | M_DRAW_TOLERANCE_AREA_POSITIVE | Draws the positive area(s) used to define the area-based geometric tolerance. Positive and negative areas occur when areas exist on both sides of a curve. The positive areas are those located on the side of the curve where the sum of the areas is the largest. These tolerances are set using MmetAddTolerance with M_AREA_....

Note that what is considered the positive side changes if M_AREA_BETWEEN_CURVES_ONE_SIDE_ONLY is enabled. In this case, the positive and negative sides are determined by whether the global reference frame's Y-axis initially intersects with either the first or second curve (edgel feature) that is specified with the M_AREA_BETWEEN_CURVES tolerance. | | M_DRAW_TOLERANCE_FEATURES | Draws the features used to define a tolerance. The LabelOrIndex parameter can be set to M_TOLERANCE_LABEL(), M_TOLERANCE_INDEX(), M_ALL_TOLERANCES, M_ALL_PASS_TOLERANCES, M_ALL_FAIL_TOLERANCES, or M_ALL_WARNING_TOLERANCES. |

For

ValueDescription
M_DRAW_LABELSpecifies that the label will also be drawn.
M_DRAW_NAMESpecifies that the name will also be drawn.

LabelOrIndex (in, AIL_INT)

Specifies the label or index of the result in the metrology result buffer for which to perform the drawing operation, or specifies that you are performing a general drawing operation for the metrology context. Set this parameter to one of the following values:

For specifying the index of the element in the metrology result buffer

ValueDescription
M_DEFAULTSpecifies the default setting.

M_DEFAULT is the same as M_ALL_FEATURES, when setting the Operation parameter to a value in the FeatureOperations table.

M_DEFAULT is the same as M_ALL_TOLERANCES, when setting the Operation parameter to a value in the ToleranceOperations table.

M_DEFAULT is the same as M_GENERAL, when setting the Operation parameter to a value in the ContextOperations table. | | M_FEATURE_INDEX | Specifies the index value of an existing individual feature to draw, in either the metrology context or result buffer, depending on whether you provide a context or result buffer to the ContextOrResultMetId parameter. | | M_FEATURE_LABEL | Specifies the label value of an existing individual feature to draw, in either the metrology context or result buffer, depending on whether you provide a context or result buffer to the ContextOrResultMetId parameter. | | M_TOLERANCE_INDEX | Specifies the index value of an existing individual tolerance to draw, in either the metrology context or result buffer, depending on whether you provide a context or result buffer to the ContextOrResultMetId parameter. | | M_TOLERANCE_LABEL | Specifies the label value of an existing individual tolerance to draw, in either the metrology context or result buffer, depending on whether you provide a context or result buffer to the ContextOrResultMetId parameter. | | M_ALL_FAIL_TOLERANCES | Specifies that the drawing operation will be performed on all tolerance results that have the status M_FAIL. | | M_ALL_FEATURES | Specifies to draw all feature results. | | M_ALL_PASS_FEATURES | Specifies that the drawing operation will be performed on all feature results that have the status M_PASS. | | M_ALL_PASS_TOLERANCES | Specifies that the drawing operation will be performed on all tolerance results that have the status M_PASS. | | M_ALL_TOLERANCES | Specifies to draw all tolerance results. | | M_ALL_WARNING_FEATURES | Specifies that the drawing operation will be performed on all feature results that have the status M_WARNING. | | M_ALL_WARNING_TOLERANCES | Specifies that the drawing operation will be performed on all tolerance results that have the status M_WARNING. | | M_GENERAL | Specifies to draw a setting of the context. | | M_GLOBAL_FRAME | Specifies to draw the global frame of the context. |

ControlFlag (in, AIL_INT64)

Reserved for future expansion and must be set to M_DEFAULT.

Copyright © 2026 Zebra Technologies.