Filters
Filter values by
Code operation type
  • Code reading operations
  • Code grading operations
  • Code detecting operations
  • Code writing operations
Draw operation type
  • General draw operation
  • Scan line-specific drawing operation
    • Scan lines analyzed during grading
    • Scan lines used for reading
| Customize Help
| Save Settings

McodeDraw



Function Map
Synopsis
Draw specific features of results obtained from an McodeRead(), McodeGrade(), McodeWrite(), or McodeDetect() operation.
Syntax
void McodeDraw(
MIL_ID ContextGraId, //in
MIL_ID ResultCodeId, //in
MIL_ID DstImageBufOrListGraId, //in
MIL_INT64 Operation, //in
MIL_INT ResultIndex, //in
MIL_INT ScanIndex, //in
MIL_INT64 ControlFlag //in
)
Description

This function draws specific features of results, obtained from an McodeRead(), McodeGrade(), McodeWrite(), or McodeDetect() operation, in the specified destination image buffer or 2D graphics list.

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

ResultCodeId

Specifies the identifier of the code read, grade, or detect result buffer from which to extract features to draw. The code result buffer must have been previously allocated on the required system using McodeAllocResult() with M_DEFAULT or M_CODE_DETECT_RESULT.

DstImageBufOrListGraId

Specifies the identifier of the destination image buffer or 2D graphics list in which to draw specific features of results.

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. The image buffer must be an 8-bit, unsigned, 1-band image buffer, allocated using MbufAlloc...().

In general, the destination image buffer should be the same size as the image that you just read. For the M_DRAW_REFLECTANCE_PROFILE and M_DRAW_SCAN_PROFILES drawing operations, determine the required image buffer width using McodeGetResult() with M_SCAN_REFLECTANCE_PROFILE_LENGTH. For best results for a M_DRAW_REFLECTANCE_PROFILE drawing operation, the image buffer must have a height of at least 256.

If you specify a 2D graphics list, the 2D graphics list must have been previously allocated using MgraAllocList().

By drawing into the display's overlay buffer or associating the 2D graphics list with the display, you can also annotate an image non-destructively.

Operation

Specifies the type of drawing operation to perform. Drawing operations can be added together to draw multiple features at a time. For example, to draw both the result occurrence's position and code symbol as it was read using McodeRead(), set the Operation parameter to M_DRAW_POSITION + M_DRAW_CODE.

The following drawing operations are only available after performing an McodeRead() or McodeGrade() operation.

function map For specifying the type of drawing operation after an McodeRead() or McodeGrade() operation
Click to summarizeValue Description
Click to summarize M_DRAW_CODE +

Draws the specified code occurrence as it was read by McodeRead() or McodeGrade().

This drawing operation is not supported for GS1 Databar, MicroPDF417, and composite code types.

(summarize)
Click to summarize M_DRAW_DECODED_SCANS +

Draws the specified decoded scan line(s) that an McodeRead() or McodeGrade() operation used to read the specified code occurrence(s). The scan lines are drawn using their start and end points (McodeGetResult() with M_DECODED_SCANS_START... and M_DECODED_SCANS_END...).

You can specify the scan line for which to draw results using ScanIndex.

This drawing operation is available for linear and composite code types.

For composite code types, only the scan lines in the 1D portion of the code occurrence(s) are drawn.

(summarize)

The following types of drawing operations are only available after performing an McodeRead(), McodeGrade(), McodeWrite() operation.

function map For specifying the type of drawing operation after an McodeRead(), McodeGrade(), McodeWrite() operation
Click to summarizeValue Description
Click to summarize M_DRAW_POSITION +

Draws a cross-like symbol at the mid-point of the code occurrence. Note that for a Data Matrix code occurrence, after an McodeRead() or McodeGrade() operation, the cross symbol is drawn in the middle of the top-left cell. For a composite code occurrence, the cross is drawn at the midpoint of the 1D part of the code. For a Maxicode code occurrence, the cross appears in the center of the bull's eye pattern. Regardless of the code type, the cross is drawn maintaining the angle of the occurrence.

(summarize)

The following types of drawing operations are only available after performing an McodeGrade() operation.

function map For specifying the type of drawing operation after an McodeGrade() operation
Click to summarizeValue Description
Click to summarize M_DRAW_EXTENDED_AREA +

Draws a box around the specified code occurrence, including its extended area, as analyzed by the McodeGrade() operation.

Note that this drawing operation is only available if M_EXTENDED_AREA_REFLECTANCE_CHECK was enabled for the McodeGrade() operation.

To establish the dimensions of occurrence with its extended area, use McodeGetResult() with M_EXTENDED_AREA_TOP... and M_EXTENDED_AREA_BOTTOM....

This drawing operation is available for Aztec, Data Matrix, QR code, and Micro QR code types.

(summarize)
Click to summarize M_DRAW_REFLECTANCE_PROFILE +

Draws the scan reflectance profile of the specified scan line(s) of the code occurrence, as analyzed by the McodeGrade() operation. You can specify the scan line for which to draw results using ScanIndex.

The result is not scaled to the size of the destination image buffer. For best results, the image buffer must have a height of at least 256.

(summarize)
Click to summarize M_DRAW_SCAN_PROFILES +

Draws the specified scan line(s) analyzed in the code occurrence by the McodeGrade() operation. You can specify the scan line for which to draw results using ScanIndex.

The drawn scan line(s) represents only the region(s) from which the results were successfully located.

(summarize)

You can use one or more of the following values in combination with each other or with the above-mentioned values, to specify a drawing operation that is available after an McodeRead(), McodeGrade(), McodeWrite(), or McodeDetect() operation.

Refer to individual values for usage details after specific code operations.

function map For specifying a drawing operation that is available after either an McodeRead(), McodeGrade(), McodeWrite(), or McodeDetect() operation
Click to summarize
Value
Description
Click to summarize M_DRAW_BOX +

Draws a box around the code occurrence. This box is drawn according to the corner coordinates of the code occurrence. You can retrieve these coordinates using McodeGetResult() with M_BOTTOM... and M_TOP.... The box only contains the part of the code occurrence that was processed; for occurrences of 1D code types from an McodeRead() operation performed in low accuracy (McodeControl() with M_POSITION_ACCURACY set to M_LOW), this means that the box might not encompass the entire code occurrence.

The box is drawn maintaining the angle and scale of the occurrence.

When dealing with composite code occurrences (only supported by McodeRead(), McodeGrade(), and McodeWrite() operations), the box is drawn around the 1D component of the code occurrence. To draw the box around the 2D component of a code occurrence, combine M_DRAW_BOX with M_2D_COMPONENT.

Note that after an McodeDetect() operation, you must use this value alone; it cannot be used in combination with any other value.

(summarize)
Click to summarize M_DRAW_QUIET_ZONE +

Draws a box around the specified code occurrence, including its quiet zone, as analyzed by the McodeRead(), McodeGrade(), or McodeWrite() operation.

The box is drawn maintaining the angle and scale of the occurrence.

To establish the dimensions of occurrence with its quiet zone, use McodeGetResult() with M_QUIET_ZONE_TOP... and M_QUIET_ZONE_BOTTOM.... The box only contains the part of the code occurrence that was processed; for occurrences of 1D code types from an McodeRead() operation performed in low accuracy (McodeControl() with M_POSITION_ACCURACY set to M_LOW), this means that the box might not encompass the entire code occurrence or might include white space.

Note that this drawing operation is not available after an McodeDetect() operation.

(summarize)

You can add one of the following values to the above-mentioned values to specify the component of a composite code occurrence for which to draw results.

These values are only available to draw results from an McodeGrade() operation.

function map For specifying the component of a composite code occurrence from an McodeGrade() operation
Click to summarize
Combination value
Description
Click to summarize M_LINEAR_COMPONENT

Draws the grading result for the 1D component (linear component) of a composite code occurrence.

Click to summarize M_2D_COMPONENT

Draws the grading result for the 2D component of a composite code occurrence.

ResultIndex

Specifies the code occurrence for which to draw results.

This parameter should be set to one of the following values:

function map For specifying the occurrence index of the code result
Click to summarizeValue Description
Click to summarize M_DEFAULT

Same as M_ALL.

Click to summarize M_ALL

Performs the specified operation for all code occurrences in the code result buffer.

Click to summarize 0 <= OccurrenceIndex < M_NUMBER

Specifies the index of the code occurrence in the code result buffer.

See the Retrieving results section of Chapter 15: Codes for more information on code occurrence indices.

(summarize)
ScanIndex

Specifies the scan line(s) for which to draw results.

Note that specifying a scan line is only applicable to drawing operations that draw results for specified scan lines (for example, M_DRAW_REFLECTANCE_PROFILE or M_DRAW_SCAN_PROFILES). For all other drawing operations, set this parameter to M_GENERAL. If specifying both a scan line-specific drawing operation and a general drawing operation (for example, M_DRAW_REFLECTANCE_PROFILE + M_DRAW_CODE), set this parameter to the scan line(s) for which to draw results instead of passing M_GENERAL.

This parameter should be set to one of the following values:

function map For specifying the scan line
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies the default value.

For a scan line-specific drawing operation, this value is the same as M_ALL. For a general drawing operation, this value is the same as M_GENERAL.

(summarize)
Click to summarize M_ALL

Specifies to perform the scan line-specific drawing operation for all scan lines of the specified code occurrence(s).

Click to summarize M_GENERAL

Specifies to perform the drawing operation without specifying a scan line.

Note that this value is not supported for the M_DRAW_REFLECTANCE_PROFILE and M_DRAW_SCAN_PROFILES drawing operations.

(summarize)
Click to summarize 0 <= Value < M_NUMBER_OF_DECODED_SCANS

Specifies the index of the decoded scan line for which to perform the drawing operation, for the specified code occurrence.

Note that this value cannot be used if ResultIndex is set to M_ALL or M_DEFAULT.

(summarize)
Click to summarize 0 <= Value < M_NUMBER_OF_SCANS

Specifies the index of the scan line for which to perform the drawing operation, for the specified code occurrence.

Note that this value cannot be used if ResultIndex is set to M_ALL or M_DEFAULT.

(summarize)
ControlFlag

Specifies the function's control flag. Reserved for future expansion. This parameter must be set to M_DEFAULT.

Compilation information
Header Include mil.h.
Library Use mil.lib; milcode.lib.
DLL Requires mil.dll; milcode.dll.
DEFAULT UNSIGNED PROC NONE DRAW CODE DRAW DECODED SCANS DRAW POSITION DRAW EXTENDED AREA DRAW REFLECTANCE PROFILE DRAW SCAN PROFILES DRAW BOX DRAW QUIET ZONE LINEAR COMPONENT 2D COMPONENT DEFAULT ALL NUMBER DEFAULT ALL GENERAL NUMBER OF DECODED SCANS NUMBER OF SCANS GENERAL ALL NUMBER OF SCANS ALL NUMBER OF SCANS ALL