MIL_ID ContextGraId, | //in |
MIL_ID MarkerOrResultMeasId, | //in |
MIL_ID DstImageBufOrListGraId, | //in |
MIL_INT64 Operation, | //in |
MIL_INT Index, | //in |
MIL_INT64 ControlFlag | //in |
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.
Specifies the graphics context to use. This parameter must be set to one of the following values:
For specifying the graphics
context
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies that the default graphics context of the current MIL application is used. (more details...) |
||||||||||||||||||||||||||||||||||||||
MIL graphics context identifier |
Specifies a valid graphics context identifier, which you have allocated using MgraAlloc(). |
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().
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.
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.
For measurement marker buffers with
either M_MARKER or M_RESULT
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DRAW_INCLUSION_POINT |
Draws a cross (+) at the position of the marker's inclusion point. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_POSITION + |
Draws a cross (+) at the position of the marker, for each marker occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
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. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_SEARCH_REGION |
Draws the marker's search region. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_SEARCH_REGION_CENTER |
Draws the center of the marker's search region. (more details...) |
The following operations are available when using a measurement marker buffer (MarkerOrResultMeasId) with M_RESULT (ControlFlag).
For measurement marker buffers and
M_RESULT
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DRAW_EDGES |
Draws a line along the found edges of the marker. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_EDGES_PROFILE + |
Draws the first derivative of the intensity profile (edgevalue) from which the marker was established. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_EDGEVALUE_MIN_IN_PROFILE + |
Draws the threshold above which a grayscale variation (edgevalue) can be considered an edge. (more details...) |
||||||||||||||||||||||||||||||||||||||
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. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_POSITION_IN_PROFILE + |
Draws a vertical bar at the position of the marker within its profile. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_SPACING |
Draws an H-type line (|-|) indicating the found spacing. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_SUB_POSITIONS + |
Draws a cross (+) at the found positions of the subedges. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DRAW_WIDTH |
Draws an H-type line (|-|) to indicate the width of the edge peak of an edge or stripe marker. (more details...) |
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.
For scaling down the specified drawing
(edge and stripe markers only)
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
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. (more details...) |
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.
For specifying the edge for which to
perform the drawing (stripe markers only)
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_EDGE_FIRST |
Draws the specified characteristic for the first outermost edge of a stripe. (more details...) |
||||||||||||||||||||||||||||||||||||||
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).
For measurement result buffers and
M_RESULT
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DRAW_LINE |
Draws the line that joins the two markers specified with MmeasCalculate(). |
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.
For specifying the index
|
|||||||||||||||||||||||||||||||||||||||
Value |
Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_RESULT_ALL_OCCURRENCES, when drawing the results of a measurement marker buffer or a measurement result buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
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). (more details...) |
|||||||||||||||||||||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
Specifies the subregion. |
|||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||
Specifies the occurrence. |
|||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||
M_RESULT_ALL_OCCURRENCES |
Specifies that the operation will be performed for all results. |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the index of the result to draw. |
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.
For specifying whether to use the
expected characteristics, the found characteristics, or the
calculation results
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_RESULT. |
||||||||||||||||||||||||||||||||||||||
M_MARKER |
Specifies to use the expected characteristics of a marker (as set with MmeasSetMarker()). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_RESULT |
Specifies to use the actual marker characteristics located in the target image (MmeasFindMarker()), or the result of the measurement calculation (MmeasCalculate()). (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milmeas.lib. |
DLL | Requires mil.dll; milmeas.dll. |