| MIL 10 Reference
| Customize Help
| Save Settings

MmeasDraw



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Synopsis
Draw expected marker characteristics or the characteristics of marker occurrences, or draw calculation results, in the destination image buffer or 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 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 22: 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 if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
ContextGraId

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

function map For specifying the graphics context
CollapseValue Description
Collapse M_DEFAULT

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

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

(summarize)
Collapse MIL graphics context identifier

Specifies a valid 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 graphics list in which to draw. The buffer can be any valid MIL image buffer allocated using MbufAlloc...(). The graphics list must be previously allocated using MgraAllocList(). By drawing into a display's overlay buffer or associating the 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
CollapseValue Description
Collapse 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)
Collapse 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)
Collapse 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)
Collapse M_DRAW_SEARCH_REGION

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

(summarize)
Collapse 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
CollapseValue Description
Collapse 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)
Collapse 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 graphics list, you must add M_DRAW_IN_BOX to this operation.

(summarize)
Collapse 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 graphics list, you must add M_DRAW_IN_BOX to this operation.

(summarize)
Collapse 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 graphics list, you must add M_DRAW_IN_BOX to this operation.

(summarize)
Collapse 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 graphics list, you must add M_DRAW_IN_BOX to this operation.

(summarize)
Collapse M_DRAW_SPACING

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

(summarize)
Collapse M_DRAW_SUB_POSITIONS +

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

(summarize)
Collapse 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)
CollapseCombination value Description
Collapse 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)
CollapseCombination value Description
Collapse 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)
Collapse 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
CollapseValue Description
Collapse 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
CollapseValue Description
Collapse 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 marker, only the first instance of the marker is drawn.

(summarize)
Collapse

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.

Collapse M_RESULT_ALL_OCCURRENCES

Specifies that the operation will be performed for all results.

Collapse 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
CollapseValue Description
Collapse M_DEFAULT

Same as M_RESULT.

Collapse 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)
Collapse 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