MIL_ID ImageBufId, | //in |
MIL_ID FontContextOcrId, | //in |
MIL_INT64 Operation, | //in |
MIL_CONST_TEXT_PTR CharListString | //in |
This function copies a character representation of one, or many, font characters to/from the specified image buffer. This buffer can then be used to initialize, change or obtain a visual representation of the font's characters.
If character representations from the image buffer are being copied to the OCR font context, the OCR font context must be large enough to hold the representations of all the specified characters. You can use MocrInquire() to determine the maximum number of characters that can be stored in the font and the size of each character.
The characters are stored in contiguous cells in the image buffer.
The character representations are read from either a font or an image buffer, assuming that the source image is a grid of character representations matching the specified font size. The character representations are read from left to right, and the characters in CharListString must exist in the font.
If the character representation being added already exists in the font, it will be replaced by the new character representation. If the character representation does not already exist in the font, it is appended to the end of the font. If the maximum string length, as set using MocrAllocFont(), is equal to or greater than the number of characters in the font (use MocrInquire() with M_CHAR_NUMBER_IN_FONT), an error will occur and the copy operation will fail.
Note that it is crucial that the character representation respects the foreground value as set in MocrAllocFont(). If the foreground value of the character representation does not match, the font will be unusable.
Specifies the identifier of the image buffer to/from which characters are copied.
This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.
Specifies the identifier of the OCR font context to/from which the characters are copied.
Specifies the direction of the copy operation. This parameter can be set to one of the following values:
For specifying the direction of the copy
operation
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_COPY_FROM_FONT + |
Copies character(s) from a font context to an image buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_COPY_TO_FONT + |
Copies character(s) from an image buffer to a font context. |
You can add the following value to the above-mentioned values to specify that all font characters are copied.
For the Operations parameter
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_ALL_CHAR |
Copies all font characters to/from the image buffer, stacked from left to right. (more details...) |
You can add the following value to the above-mentioned value to specify that fonts are sorted by their ACII character values.
For M_COPY_FROM_FONT
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_SORT |
Sorts font by its ASCII character values. |
Specifies a string containing the list of characters to be copied.
For specifying the string
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies to ignore this parameter. (more details...) |
||||||||||||||||||||||||||||||||||||||
MIL_TEXT("CharListString") 1 |
Specifies the string containing the list of characters to be copied. (more details...) |
1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().
Header | Include mil.h. |
Library | Use mil.lib; milocr.lib. |
DLL | Requires mil.dll; milocr.dll. |