MIL_ID ContextGraId, | //in |
MIL_ID ContextOrResultBeadId, | //in |
MIL_ID DstImageBufOrListGraId, | //in |
MIL_INT64 DrawOperation, | //in |
MIL_INT64 DrawOption, | //in |
MIL_INT LabelOrIndex, | //in |
MIL_INT Index, | //in |
MIL_INT64 ControlFlag | //in |
This function draws specific features of a selected bead context or bead result, in the specified destination image buffer or 2D graphics list. Drawings are typically performed using either the template's vertices or trained points (when specifying a bead context), or using the trained points' corresponding measured point (when specifying a bead result). Drawing operations for trained points are only available after calling MbeadTrain(), while drawing operations for bead results are only available after calling MbeadVerify().
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() with M_DRAW_ZOOM_X and M_DRAW_ZOOM_Y. For example, you can draw a zoomed section of the bead found in the target image at the top-left corner of the destination image. For more information, see the Drawing graphics with offset and zoom subsection of the Drawing graphics section of Chapter 24: Generating graphics.
All operations are available for drawing in either the specified destination image buffer or 2D graphics list, unless otherwise specified.
Specifies the identifier of the 2D graphics context to use. This parameter must be set to one of the following values:
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description | ||||||||||||||||||||||||||||||||||||||
![]() ![]() |
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)Specifies that the default 2D graphics context of the current MIL application is used. (more details...) |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies a valid 2D graphics context identifier, which you have allocated using MgraAlloc(). |
Specifies the identifier of the bead context or bead result buffer that this function will use to perform the drawing operation. The context or result buffer must have been previously allocated on the system using MbeadAlloc() or MbeadAllocResult(), respectively.
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.
When calling MbeadDraw() with a bead context (and using a calibrated training image) or with a bead result (and using a calibrated target image), the destination drawing buffer need not be calibrated to the same world. MIL draws according to the calibration context associated to either the training or verification image.
Specifies the drawing operation to perform.
To perform drawing operations for a bead context or a bead result, this parameter can be set to one of the following values. These drawing operations are performed according to the points specified with the DrawOption parameter.
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description | ||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Draws the index of the templates containing the points that fulfill the conditions of the DrawOption parameter. For example, if you set the DrawOption parameter to M_TRAINED, the index of all the successfully trained templates will be drawn. (summarize)Draws the index of the templates containing the points that fulfill the conditions of the DrawOption parameter. (more details...) |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Draws the label of the templates containing the points that fulfill the conditions of the DrawOption parameter. For example, if you set the DrawOption parameter to M_FAIL, the label of all the templates with at least one failed point will be drawn. (summarize)Draws the label of the templates containing the points that fulfill the conditions of the DrawOption parameter. (more details...) |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Draws a cross at the position of the point. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Draws the index value of the point. If you specify M_USER, you can only perform this drawing operation for templates with a path that follows a polyline (MbeadControl() with M_TRAINING_PATH), otherwise you will get an error. (summarize)Draws the index value of the point. (more details...) |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Draws the polyline that connects the points. If the template's path follows a circle, MIL draws an actual circle (smooth curve). (summarize)Draws the polyline that connects the points. (more details...) |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Draws the search box of the point. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Draws an H-type line (|-|) indicating the width of the bead at that point. This value is only supported for stripe-beads. (summarize)Draws an H-type line (|-|) indicating the width of the bead at that point. (more details...) |
To draw the training image, this parameter must be set to the following value. To draw the training image, you must set the ContextOrResultBeadId parameter to a bead context, the DstImageBufOrListGraId parameter to a destination image, the DrawOption parameter to M_DEFAULT, the LabelOrIndex parameter to M_GENERAL, and the Index parameter to M_GENERAL.
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description | ||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Draws the training image. To draw the training image, you must have internally saved it with the bead context, by calling MbeadTrain() with M_SAVE_TRAINING_IMAGE. This operation cannot draw in a 2D graphics list. (summarize)Draws the training image. (more details...) |
Specifies the type of points that this function will use to perform the drawing operation. If this information is not required for the specified drawing operation, set this parameter to M_DEFAULT.
When performing a drawing operation for a bead context or bead result, this parameter can be set to the following value.
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description | ||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the default value. For a bead context, the default value is the same as M_TRAINED. For a bead result, the default value is the same as M_ALL. For an M_DRAW_TRAINING_IMAGE operation, the default indicates that this parameter's information is not required. (summarize)Specifies the default value. (more details...) |
When performing a drawing operation for a bead context, this parameter can be set to one of the following values.
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description | ||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that MIL performs the drawing operation using the trained points indicated by both M_TRAINED_FAIL and M_TRAINED_PASS. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that MIL performs the drawing operation using all the trained points that were expected but not found, during the training phase (MbeadTrain()). In this case, the drawing operation uses the expected position of the trained point. (summarize)Specifies that MIL performs the drawing operation using all the trained points that were expected but not found, during the training phase (MbeadTrain()). (more details...) |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that MIL performs the drawing operation using all the trained points that were established (found), during the training phase MbeadTrain(). |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that MIL performs the drawing operation using the vertices of the template. If the template's path follows a polyline (MbeadControl() with M_TRAINING_PATH), M_USER refers to the specified polyline points (MbeadTemplate()). If the template's path follows a circle or segment, M_USER refers to the minimum critical points that MIL internally calculates based on the specified settings of the path. For a path that follows a segment, MIL calculates three critical points, according to the specified start and end of the segment (MbeadControl() with M_TEMPLATE_SEGMENT_...). For a path that follows a circle, MIL calculates five critical points, according to the specified center and radius of the circle (M_TEMPLATE_CIRCLE_...). You cannot specify M_USER for an M_DRAW_WIDTH operation; MIL considers width a trained aspect of the bead (as is the case, for example, when you are using a training image to establish the width). (summarize)Specifies that MIL performs the drawing operation using the vertices of the template. (more details...) |
When performing a drawing operation for a bead result, this parameter can be set to one of the following values.
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description | ||||||||||||||||||||||||||||||||||||||
![]() ![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that the drawing operation will be performed using all measured points that were expected but did not pass verification. In this case, the drawing operation uses the expected position of the measured point. (summarize)Specifies that the drawing operation will be performed using all measured points that were expected but did not pass verification. (more details...) |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that the drawing operation will be performed using all measured points that have failed verification, and whose expected position falls within the maximum gap in the bead, as specified using MbeadControl() with M_GAP_MAX_LENGTH. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that the drawing operation will be performed using all measured points that have failed verification because their intensity is greater than the highest intensity allowed, as specified using: (MbeadControl() with M_INTENSITY_NOMINAL) + (MbeadControl() with M_INTENSITY_DELTA_POS). This value is only supported for stripe-beads. (summarize)Specifies that the drawing operation will be performed using all measured points that have failed verification because their intensity is greater than the highest intensity allowed, as specified using: (MbeadControl() with M_INTENSITY_NOMINAL) + (MbeadControl() with M_INTENSITY_DELTA_POS). (more details...) |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that the drawing operation will be performed using all measured points that have failed verification because their intensity is less than the lowest intensity allowed, as specified using: (MbeadControl() with M_INTENSITY_NOMINAL) - (MbeadControl() with M_INTENSITY_DELTA_NEG). This value is only supported for stripe-beads. (summarize)Specifies that the drawing operation will be performed using all measured points that have failed verification because their intensity is less than the lowest intensity allowed, as specified using: (MbeadControl() with M_INTENSITY_NOMINAL) - (MbeadControl() with M_INTENSITY_DELTA_NEG). (more details...) |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that the drawing operation will be performed using all measured points that have failed verification because they were not found in the target image. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that the drawing operation will be performed using all measured points that have failed verification because their position has surpassed the offset criterion, as specified using MbeadControl() with M_OFFSET_MAX. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that the drawing operation will be performed using all measured points that have failed verification because the width of the measured bead at their position is greater than the maximum width criterion, as specified using: (MbeadControl() with M_TRAINING_WIDTH_NOMINAL) + (MbeadControl() with M_WIDTH_DELTA_POS). This value is only supported for stripe-beads. (summarize)Specifies that the drawing operation will be performed using all measured points that have failed verification because the width of the measured bead at their position is greater than the maximum width criterion, as specified using: (MbeadControl() with M_TRAINING_WIDTH_NOMINAL) + (MbeadControl() with M_WIDTH_DELTA_POS). (more details...) |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that the drawing operation will be performed using all measured points that have failed verification because the width of the measured bead at their position is less than the minimum width criterion, as specified using: (MbeadControl() with M_TRAINING_WIDTH_NOMINAL) - (MbeadControl() with M_WIDTH_DELTA_NEG). This value is only supported for stripe-beads. (summarize)Specifies that the drawing operation will be performed using all measured points that have failed verification because the width of the measured bead at their position is less than the minimum width criterion, as specified using: (MbeadControl() with M_TRAINING_WIDTH_NOMINAL) - (MbeadControl() with M_WIDTH_DELTA_NEG). (more details...) |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that the drawing operation will be performed using all the measured points that have passed verification. |
Specifies the templates (one or all) that this function will use to perform the drawing operation, or specifies that you are performing a general type of drawing operation. The specified template is either in a bead context or result buffer, depending on the ContextOrResultBeadId parameter setting. All LabelOrIndex parameter values can be used for any draw operation, unless otherwise specified.
This parameter can be set to one of the following values:
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description | ||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the index of a template for which to perform the drawing operation. (summarize)Specifies the index of a template for which to perform the drawing operation. (more details...) |
||||||||||||||||||||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
Specifies the index. The index is from 0 (inclusive) to the number of templates minus 1. |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the label of a template, for which to perform the drawing operation. (summarize)Specifies the label of a template, for which to perform the drawing operation. (more details...) |
||||||||||||||||||||||||||||||||||||||
Parameters | |||||||||||||||||||||||||||||||||||||||
Specifies the label. The label must be greater than 0. |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies to perform the drawing operation for all templates. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that you are performing a general type of drawing operation. You can only use M_GENERAL with M_DRAW_TRAINING_IMAGE. (summarize)Specifies that you are performing a general type of drawing operation. (more details...) |
Specifies the set of template points (one or all) for which to perform the drawing operation, or specifies that you are performing a general type of drawing operation. All Index parameter values can be used for any draw operation (except M_DRAW_TRAINING_IMAGE).
This parameter should be set to one of the following values:
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description | ||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies to perform the drawing operation for all points in the specified templates. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that you are performing a general type of drawing operation. In this case, the entire template is either drawn or not, depending on whether it contains one or more points that meet the conditions of the drawing operation. You must specify M_GENERAL when using M_DRAW_TRAINING_IMAGE. (summarize)Specifies that you are performing a general type of drawing operation. (more details...) |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the index of the point in the specified templates for which to perform the drawing operation. The index is from 0 (inclusive) to the total number of points in the template minus 1. To get the number of trained points in the template, use MbeadGetResult() with M_NUMBER. (summarize)Specifies the index of the point in the specified templates for which to perform the drawing operation. (more details...) |
Specifies whether MIL performs drawings with fail-type points differently than drawings with other types of points.
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description | ||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that MIL does not perform drawings with fail-type points differently. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies that MIL performs drawings with fail-type points differently than drawings with other types of points. That is, when possible, drawing operations (M_DRAW_...) with M_..._FAIL or M_FAIL_... points, such as M_TRAINED_FAIL and M_FAIL_NOT_FOUND, will be visually distinguishable from drawing operations with other types of points, such as M_USER, M_TRAINED_PASS, and M_PASS. This can be useful when drawing both fail-type and pass-type points, either by calling MbeadDraw() multiple times, or by performing the drawing operation on all points (M_TRAINED and M_ALL). For example, if you specify M_DRAW_POSITION_INDEX and M_ALL, the index of each trained point is drawn, if its associated measured point has been found (pass); for measured points that were expected but not found (fail), the index of their associated trained point is drawn with a horizontal line above it. You cannot use M_ENHANCED when drawing the training image (M_DRAW_TRAINING_IMAGE). (summarize)Specifies that MIL performs drawings with fail-type points differently than drawings with other types of points. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milbead.lib. |
DLL | Requires mil.dll; milbead.dll. |