typedef struct tagANNNAMEOPTIONS
} ANNNAMEOPTIONS, *pANNNAMEOPTIONS;
|bShowName||Flag that indicates whether to show or hide the annotation object name. Possible values are:|
|TRUE||Show the annotation object name|
|FALSE||Hide the annotation object name|
|pszName||Null terminated character string containing the name|
|uNameLen||Length of string, including the NULL terminator|
|ptNameOffset||Offset of name. The name offset is the x and y offset (in pixels viewed at 100%) relative to the upper left corner of the bounding box of the annotation object.|
|bNameRestrict||Flag that indicates whether the annotation object name is restricted to appear fully within the bitmap. Possible values are:|
|TRUE||Restrict the annotation name to within the bitmap. (Annotation container).|
|FALSE||Allow the annotation name to be moved outside the container.|
|crNameFore||Foreground color of the name text|
|crNameBack||Background color of the name text|
|NameFont||Font used to display the name text. For more information, refer to the documentation for ANNFONT.|
|bNameBackTransparent||Flag that indicates whether the background text color is transparent. Possible values are:|
|TRUE||Background text color is transparent.|
|FALSE||Use crNameBack for the background color of the text.|
|nReserved||Reserved for future use. Use zero.|
When calling L_AnnGetNameOptions, the uFlags field identifies which fields to retrieve. When calling L_AnnSetNameOptions, the uFlags field identifies which fields to set.
When you create an object in the automation mode, the values for bShowName, ptNameOffset, and bNameRestrict are taken from the automation object. The name of the object is also taken from the automation object, specifically from the ANNAUTOTEXT_ITEM_DEFAULTNAME item. This is just like the annotation text, which is by default "AaBbYyZz" and is taken from ANNAUTOTEXT_ITEM_DEFAULTTEXT item.
The default name is ", which means that the objects will not show a name when you create them. To set a default name, call L_AnnSetAutoText with uItem set to ANNAUTOTEXT_ITEM_DEFAULTNAME, and pText set to your desired default string. For example:
L_AnnSetAutoText(hAutomation, ANNAUTOTEXT_ITEM_DEFAULTNAME, TEXT("Default_name"));
The name offset of an annotation object (value pointed to by pNameOffset) is an offset that is relative to the upper left corner of the bounding box of the annotation. The name offset values (pNameOffset.x, pNameOffset.y) are in pixels, where the image is viewed at 100%. The name offset can be changed in any of the following ways:
Programmatically using L_AnnSetNameOptions.
Right-clicking the object in design-mode, selecting Name Properties, setting the NameOffset using the text box, and clicking Apply.
Clicking on the object name in design-mode and dragging it to a new location.
The name of an annotation object may be restricted so that it fully appears on the bitmap. For example, if the variable pointed to by pbNameRestrict is TRUE for an object, the name offset cannot be set so that the object name is outside the bitmap (annotation container). Suppose you have a 200x200 bitmap with a 100x100 button in the lower right corner. The name of the button is "BUTTON". Attempting to set the name offset to anything larger than (43,100) by any of the above methods will result in the name offset being set to (43,100). Also, dragging the annotation object itself in such a way that would cause the object name to be moved outside the bitmap will cause the name offset to change.
When retrieving the name text, you must first call L_AnnGetNameOptions to determine the length of the character string. Then, you must allocate a character string of this length, and call L_AnnGetNameOptions again.
The sample illustrates this.
For an example, refer to L_AnnSetNameOptions.
Medical Web Viewer .NET