| Customize Help
| Save Settings

MocrDraw



Function Map
Synopsis
Draw specific features of OCR fonts or OCR result occurrences in an image buffer or 2D graphics list.
Syntax
void MocrDraw(
MIL_ID ContextGraId, //in
MIL_ID FontContextOrResultOcrId, //in
MIL_ID DstImageBufOrListGraId, //in
MIL_INT64 Operation, //in
MIL_INT Index, //in
MIL_CONST_TEXT_PTR CharList, //in
MIL_INT64 ControlFlag //in
)
Description

This function draws specific features of the OCR fonts or OCR results in the 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().

FontContextOrResultOcrId

Specifies the OCR Font context or result buffer from which to extract the features to draw. The OCR Font context or result buffer must have been previously allocated using MocrAllocFont() or MocrAllocResult().

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.

The possible Operation parameter values for a OCR Font context are:

function map For specifying the type of operation to perform
Click to summarizeValue Description
Click to summarize M_DRAW_CHAR

Draws a character representation of the font in the destination image buffer. Characters are drawn from left to right, and top to bottom. On each line, as many characters as possible will be drawn where the size of each character is the Cell size X. For more information see MocrInquire() with M_CHAR_CELL_SIZE_X. The buffer height must be at least the character Cell size Y multiplied by the number of lines necessary to hold all the characters. For more details see MocrInquire() with M_CHAR_CELL_SIZE_Y.

This operation cannot draw in a 2D graphics list.

(summarize)

The possible Operation parameter values for an OCR result buffer are as follows. These values can be added together to draw multiple features at once.

function map For an OCR Font context
Click to summarizeValue Description
Click to summarize M_DRAW_STRING_BOX

Draws a box around the string that is read in the target. Note that the bounding box of the string is the bounding box of all the string's characters bounding box, including the draw margin.

(summarize)
Click to summarize M_DRAW_STRING_CHAR_BOX

Draws all the character boxes of the result(s) of the string(s) read. The character boxes of the strings are drawn at the location read in the target with the correct angle, scale and aspect ratio. The character box drawn is the bounding box of the character plus the draw margin.

(summarize)
Click to summarize M_DRAW_STRING_CHAR_POSITION

Draws a cross at the center of the bounding box of each string's character. Note that the angle, scale, and aspect ratio of the character are taken into account.

(summarize)
Index

Reserved for future expansion and must be set to M_DEFAULT.

CharList

Specifies a string containing a list of valid characters to draw when drawing an OCR font. To draw all the characters in the font or to draw results, this parameter should be set to M_NULL.

function map For specifying the string
Click to summarizeValue Description
Click to summarize MIL_TEXT("CharList") 1

Specifies that, when drawing an OCR font, this parameter can be a null-terminated string specifying a list of valid characters to draw. Characters will be drawn in the specified order. This string must be null-terminated.

(summarize)

1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().

ControlFlag

Reserved for future expansion and must be set to M_DEFAULT.

Compilation information
Header Include mil.h.
Library Use mil.lib; milocr.lib.
DLL Requires mil.dll; milocr.dll.
DEFAULT PROC NONE DRAW CHAR DRAW STRING BOX DRAW STRING CHAR BOX DRAW STRING CHAR POSITION