| Customize Help
| Save Settings

MmeasDraw



Function Map
Synopsis
Draw expected marker characteristics or the characteristics of marker occurrences, or draw calculation results, in the destination image buffer or 2D graphics list.
Syntax
void MmeasDraw(
MIL_ID ContextGraId, //in
MIL_ID MarkerOrResultMeasId, //in
MIL_ID DstImageBufOrListGraId, //in
MIL_INT64 Operation, //in
MIL_INT Index, //in
MIL_INT64 ControlFlag //in
)
Description

This function performs the specified drawing operation on the expected marker characteristics (as set with MmeasSetMarker()) or the actual characteristics of the marker occurrences (as found with MmeasFindMarker()). This function can also perform the specified drawing operation on the result of a measurement calculation between two markers (MmeasCalculate()).

This function can execute multiple drawing operations simultaneously (for example, M_DRAW_SEARCH_REGION + M_DRAW_SEARCH_DIRECTION). MIL performs the drawing operations in the specified destination image buffer or 2D graphics list.

You can draw settings and results, 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() with M_DRAW_ZOOM_X and M_DRAW_ZOOM_Y. For more information, see the Drawing graphics with offset and zoom subsection of the Drawing graphics section of Chapter 24: Generating graphics.

Note that you can draw characteristics specified or returned in world units (MmeasSetMarker() with M_INCLUSION_POINT_INPUT_UNITS, M_MARKER_REFERENCE_INPUT_UNITS, M_POINT_INPUT_UNITS, M_SEARCH_REGION_INPUT_UNITS, and/or M_RESULT_OUTPUT_UNITS set to M_WORLD). However, if you set any of these constants to M_WORLD and you specify to draw expected marker characteristics from a measurement marker, you must pass MmeasDraw() a calibrated target image. Otherwise, the function will generate an error.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
ContextGraId

Specifies the 2D graphics context to use. This parameter must be set to one of the following values:

function map For specifying the 2D graphics context
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies that the default 2D graphics context of the current MIL application is used.

Note that there is a different default 2D graphics context for each thread.

(summarize)
Click to summarize MIL 2D graphics context identifier

Specifies a valid 2D graphics context identifier, which you have allocated using MgraAlloc().

MarkerOrResultMeasId

Specifies the identifier of a measurement marker buffer or the identifier of a measurement result buffer. A measurement marker buffer contains both the expected marker characteristics that you specified with MmeasSetMarker(), and the actual marker characteristics that MIL found in the target image with MmeasFindMarker(). To specify which characteristics to draw (expected or found), use the ControlFlag parameter (M_MARKER or M_RESULT).

If you specify a measurement result buffer, it must contain results from MmeasCalculate().

DstImageBufOrListGraId

Specifies the identifier of the destination image buffer or 2D graphics list in which to draw. The buffer can be any valid MIL 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.

If specifying an image buffer, it must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

Operation

Specifies the type of operation to perform. You can add the possible Operation parameter values in the tables below to draw multiple characteristics at once.

The following operations are available when using a measurement marker buffer (MarkerOrResultMeasId) with either M_MARKER or M_RESULT (ControlFlag), unless otherwise specified.

function map For measurement marker buffers with either M_MARKER or M_RESULT
Click to summarizeValue Description
Click to summarize M_DRAW_INCLUSION_POINT

Draws a cross (+) at the position of the marker's inclusion point. This applies to stripe markers. To specify an inclusion point, use MmeasSetMarker() with M_INCLUSION_POINT. M_DRAW_INCLUSION_POINT is only available with M_MARKER.

(summarize)
Click to summarize M_DRAW_POSITION +

Draws a cross (+) at the position of the marker, for each marker occurrence. This applies to edge, stripe, circle, and point markers. For edge, stripe, and circle markers, the found position is drawn (MmeasFindMarker()); you must specify M_RESULT. For point markers, the defined position is drawn (MmeasSetMarker() with M_POSITION), although you can specify either M_MARKER or M_RESULT.

(summarize)
Click to summarize M_DRAW_SEARCH_DIRECTION

Draws an arrow starting from the middle of the marker's box search region and pointing towards the direction of the edge transition. This applies to edge and stripe markers; in this case, the search direction is based on the marker's orientation (MmeasSetMarker() with M_ORIENTATION).

(summarize)
Click to summarize M_DRAW_SEARCH_REGION

Draws the marker's search region. This applies to edge, stripe, and circle markers.

(summarize)
Click to summarize M_DRAW_SEARCH_REGION_CENTER

Draws the center of the marker's search region. This applies to edge, stripe, and circle markers.

(summarize)

The following operations are available when using a measurement marker buffer (MarkerOrResultMeasId) with M_RESULT (ControlFlag).

function map For measurement marker buffers and M_RESULT
Click to summarizeValue Description
Click to summarize M_DRAW_EDGES

Draws a line along the found edges of the marker. This applies to edge, stripe, and circle markers.

For circle markers, the fitted circle is drawn, along with the found radius and position.

(summarize)
Click to summarize M_DRAW_EDGES_PROFILE +

Draws the first derivative of the intensity profile (edgevalue) from which the marker was established. This applies to edge and stripe markers.

If you are drawing in a 2D graphics list, you must add M_DRAW_IN_BOX to this operation.

(summarize)
Click to summarize M_DRAW_EDGEVALUE_MIN_IN_PROFILE +

Draws the threshold above which a grayscale variation (edgevalue) can be considered an edge. This is a graphical representation of MmeasSetMarker() with M_EDGEVALUE_MIN. This applies to edge and stripe markers.

If you are drawing in a 2D graphics list, you must add M_DRAW_IN_BOX to this operation.

(summarize)
Click to summarize M_DRAW_EDGEVALUE_PEAK_WIDTH_IN_PROFILE +

Draws a horizontal line, beginning and ending with arrows (for example, <--->), to indicate the width of the edge peak of an edge or stripe marker. This is a graphical representation of MmeasGetResult() with M_EDGEVALUE_PEAK_WIDTH. This applies to edge and stripe markers. For stripe markers, the width of both its outermost edges is drawn, unless you specify M_EDGE_FIRST or M_EDGE_SECOND.

If you are drawing in a 2D graphics list, you must add M_DRAW_IN_BOX to this operation.

(summarize)
Click to summarize M_DRAW_POSITION_IN_PROFILE +

Draws a vertical bar at the position of the marker within its profile. This applies to edge and stripe markers.

If you are drawing in a 2D graphics list, you must add M_DRAW_IN_BOX to this operation.

(summarize)
Click to summarize M_DRAW_SPACING

Draws an H-type line (|-|) indicating the found spacing. This applies to multiple-occurrence markers (edge and stripe).

(summarize)
Click to summarize M_DRAW_SUB_POSITIONS +

Draws a cross (+) at the found positions of the subedges. This applies to edge, stripe, and circle markers.

(summarize)
Click to summarize M_DRAW_WIDTH

Draws an H-type line (|-|) to indicate the width of the edge peak of an edge or stripe marker. This is a graphical representation of MmeasGetResult() with M_EDGE_WIDTH. This applies to stripe markers only.

(summarize)

You can add the following value to the above-mentioned values to specify whether to scale down (resize) the drawing to fit within the dimensions of the box search region.

function map For scaling down the specified drawing (edge and stripe markers only)
Click to summarize
Combination value
Description
Click to summarize M_DRAW_IN_BOX

Performs the specified drawing operation (for example, M_DRAW_EDGES_PROFILE), except scaled down (resized) to fit within the dimensions of the box search region. If you do not use this combination value, the same drawing operation is performed (for example, the edge profile is drawn), but sized to fit the dimensions of the destination image buffer.

(summarize)

You can add one or more of the following values to the above-mentioned values to specify whether to perform the drawing operation on the first or second edge of a stripe.

function map For specifying the edge for which to perform the drawing (stripe markers only)
Click to summarize
Combination value
Description
Click to summarize M_EDGE_FIRST

Draws the specified characteristic for the first outermost edge of a stripe. The first edge of a stripe is the edge closest to the search region's origin.

(summarize)
Click to summarize M_EDGE_SECOND

Draws the specified characteristic for the second outermost edge of a stripe.

The following operation is available when using a measurement result buffer (MarkerOrResultMeasId).

function map For measurement result buffers and M_RESULT
Click to summarizeValue Description
Click to summarize M_DRAW_LINE

Draws the line that joins the two markers specified with MmeasCalculate().

Index

Specifies the index of the result to draw from a measurement marker buffer or from a measurement result buffer. When drawing the expected characteristics of a marker (M_MARKER), MIL does not need any index information and you must set this parameter to M_DEFAULT.

This parameter must be set to one of the values below.

function map For specifying the index
Click to summarizeValue Description
Click to summarize M_DEFAULT

Same as M_RESULT_ALL_OCCURRENCES, when drawing the results of a measurement marker buffer or a measurement result buffer.

When drawing the expected characteristics of a marker, this parameter must be set to M_DEFAULT, which specifies that the index information is not needed. Note that when drawing the expected characteristics of a marker that is actually a multiple-occurrence marker, only the first instance of the marker is drawn.

(summarize)
Click to summarize

Specifies that the operation will be performed for a measurement result buffer, according to the specified subregions (one or all) of the specified occurrences (one or all).

You can only use M_RESULT_PER_SUBREGION() with edge and stripe markers for the following operations: M_DRAW_SEARCH_DIRECTION, M_DRAW_SEARCH_REGION, M_DRAW_SEARCH_REGION_CENTER, M_DRAW_EDGES_PROFILE, and M_DRAW_EDGEVALUE_MIN_IN_PROFILE.

(summarize)
Parameters

Specifies the subregion.

M_ALL_SUBREGIONS

Specifies that the operation will be performed for all of the subregion results.

Value

Specifies the index of the subregion result for which to perform the operation.

Specifies the occurrence.

M_ALL_OCCURRENCES

Specifies that the operation will be performed for all of the result occurrences.

Value

Specifies the index of the result occurrence for which to perform the operation.

Click to summarize M_RESULT_ALL_OCCURRENCES

Specifies that the operation will be performed for all results.

Click to summarize Value

Specifies the index of the result to draw.

ControlFlag

Specifies whether to perform the drawing operation on the expected marker characteristics, the actual marker characteristics found in the target image, or the results of the measurement calculation. This parameter must be set to one of the values below.

function map For specifying whether to use the expected characteristics, the found characteristics, or the calculation results
Click to summarizeValue Description
Click to summarize M_DEFAULT

Same as M_RESULT.

Click to summarize M_MARKER

Specifies to use the expected characteristics of a marker (as set with MmeasSetMarker()). In this case, the MarkerOrResultMeasId parameter must be set to the identifier of a measurement marker buffer and the Index parameter must be set to M_DEFAULT.

(summarize)
Click to summarize M_RESULT

Specifies to use the actual marker characteristics located in the target image (MmeasFindMarker()), or the result of the measurement calculation (MmeasCalculate()). In this case, the MarkerOrResultMeasId parameter must be set to the identifier of either a measurement marker buffer or a measurement result buffer.

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib; milmeas.lib.
DLL Requires mil.dll; milmeas.dll.
DEFAULT PROC NONE DRAW INCLUSION POINT DRAW POSITION DRAW SEARCH DIRECTION DRAW SEARCH REGION DRAW SEARCH REGION CENTER DRAW EDGES DRAW EDGES PROFILE DRAW EDGEVALUE MIN IN PROFILE DRAW EDGEVALUE PEAK WIDTH IN PROFILE DRAW POSITION IN PROFILE DRAW SPACING DRAW SUB POSITIONS DRAW WIDTH DRAW IN BOX EDGE FIRST EDGE SECOND DRAW LINE DEFAULT ALL SUBREGIONS ALL OCCURRENCES RESULT ALL OCCURRENCES DEFAULT MARKER RESULT STRIPE EDGE CIRCLE MARKER MARKER