| MIL 10 Reference
| Customize Help
| Save Settings

MocrDraw



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 specific features of OCR fonts or OCR result occurrences in an image buffer or 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 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 if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
ContextGraId

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

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 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.

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

function map For specifying the type of operation to perform
CollapseValue Description
Collapse 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 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
CollapseValue Description
Collapse 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)
Collapse 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)
Collapse 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 ration 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
CollapseValue Description
Collapse 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