LEADTOOLS Raster Imaging C DLL Help > Function References > L_AnnGetUnit |
#include "l_bitmap.h"
L_LTANN_API L_INT L_AnnGetUnit(hObject, puUnit, pUnitAbbrev, puUnitAbbrevLen, puRulerPrecision)
HANNOBJECT hObject; |
/* handle to the annotation automation object */ |
L_UINT *puUnit; |
/* address of the variable to be updated with the unit of measure */ |
L_TCHAR *pUnitAbbrev; |
/* address of the character string to be updated with the unit abbreviation string */ |
L_SIZE_T *puUnitAbbrevLen; |
/* address of the integer variable to be updated with the unit abbreviation string length */ |
L_UINT *puRulerPrecision; |
/* address of the variable to be updated with the number of digits */ |
Gets the current unit of measurement values set by the L_AnnSetUnit function.
Parameter |
Description |
|
hObject |
Handle to the annotation automation object. |
|
puUnit |
Address of the variable to be updated with the object's unit of measurement. Possible values are: |
|
|
Value |
Meaning |
|
ANNUNIT_INCH |
[0x0000] inches |
|
ANNUNIT_FEET |
[0x0001] feet |
|
ANNUNIT_YARDS |
[0x0002] yards |
|
ANNUNIT_MICROMETERS |
[0x0003] micrometers |
|
ANNUNIT_MILLIMETERS |
[0x0004] millimeters |
|
ANNUNIT_CENTIMETERS |
[0x0005] centimeters |
|
ANNUNIT_METERS |
[0x0006] meters |
|
ANNUNIT_TWIPS |
[0x0007] twips |
|
ANNUNIT_POINTS |
[0x0008] points |
|
ANNUNIT_PIXELS |
[0x0009] pixels |
|
ANNUNIT_DISPLAY |
[0x000C] Display (1/100 inch) |
|
ANNUNIT_DOCUMENT |
[0x000D] Document (1/300 inch) |
pUnitAbbrev |
Address of the character string to be updated with the unit abbreviation string to be displayed after the distance. |
|
puUnitAbbrevLen |
Address of the variable to be updated with the length of the unit abbreviation string. |
|
puRulerPrecision |
Address of the variable to be updated with the number of digits to be displayed after the decimal place. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
The following annotation objects utilize one or more rulers as part of the annotation:
ANNOBJECT_RULER
ANNOBJECT_POLYRULER
ANNOBJECT_PROTRACTOR
ANNOBJECT_CROSSPRODUCT
In addition, the Automation object (ANNOBJECT_AUTOMATION) stores default unit settings along with the other object default settings.
The default unit of measure for ruler, polyruler, and crossproduct objects is smart English. With the smart units, the unit changes with the length. For example, if the length is 11 inches (assuming the default precision of 2 is being used), "11.00 in" displays whereas if the length is 15 inches, "1 ft 3.00 in" displays. Call the L_AnnSetUnit function to set the unit of measurement and its precision for the ruler. The precision indicates how many digits to display to the right of the decimal point in the length. Call the L_AnnGetUnit function to get the unit of measurement and its precision for the ruler. The L_AnnGetDistance2 function gets the length of each ruler that makes up an object, and the total length of all rulers.
To find out the size of the buffer required by pUnitAbbrev, call L_AnnGetUnit and pass NULL for the pUnitAbbrev parameter. The length of the pUnitAbbrev string will be returned in the * puUnitAbbrevLen argument. Allocate a buffer of the appropriate size (*puUnitAbbrevLen + 1). Then call L_AnnGetUnit a second time and pass the address of the buffer for the pUnitAbbrev argument.
Required DLLs and Libraries
For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Win32, x64.
See Also
Example
For an example, refer to L_AnnSetUnit.