Implementing Annotations

Note:

This topic is for Document/Medical only.

Annotations are based on vectored drawing functions and are associated with bitmaps as an overlay of the displayed image. LEADTOOLS supports a number of annotation types, including lines, rectangles, audio clips, hotspots, redact objects, polygons, and containers. A container is a specialized annotation object that lets you position and group other annotation objects, including other container objects. For a full list of available annotation types, refer to Types of Annotations.

LEADTOOLS maintains annotations separately from bitmaps. Your application code is responsible for maintaining the relationships between images and annotations. For example, the annotation example that ships with LEADTOOLS, creates an annotation file that has the same name as its associated image file, but with a different extension. When the image file is loaded, the program looks for an associated annotation file and loads it as well.

The functions supported by LEADTOOLS let you create automated annotations or non-automated annotations, depending on your application’s requirements.

Automated Annotations

Automated annotations require an automation object to be associated with the top-level container, also known as the root container. This automation object lets you maintain default properties for all objects in the root container. For example, you can use it to set the default font and the default line width. Keep in mind, however, that scaling factors affect the appearance of these default measurements. The values are set based on the scaling factors that are in effect at the time you create the object. Features associated with automated annotations are:

image\sqrblit.gif Automated annotation menus appear when you right click in design mode. These menus may or may not include the hyperlink menu item.

image\sqrblit.gif Automated drawing lets you use the left mouse button to draw annotations in design mode.

image\sqrblit.gif The annotation toolbar lets you select the annotation tool to draw.

image\sqrblit.gif LEADTOOLS handles the activation of audio annotations and hyperlinks.

image\sqrblit.gif You can undo a number of user actions, executed using the automated annotations functions.

 

You can implement the automation using only a few supporting functions.

First, use the following function to create the root container:

L_AnnCreateContainer

Then, use the following functions to create and maintain an automation object:

L_AnnCreate

L_AnnCreateItem

L_AnnGetAutoBackColor

L_AnnGetAutoContainer

L_AnnGetDpiX

L_AnnGetDpiY

L_AnnGetFillMode

L_AnnGetFillModeExt

L_AnnGetTextFixedSize

L_AnnGetLineFixedWidth

L_AnnGetOptions

L_AnnGetRect

L_AnnGetShowFlags

L_AnnGetTextOptions

L_AnnGetTool

L_AnnInsert

L_AnnSetAutoBackColor

L_AnnSetAutoContainer

L_AnnSetAutoDefaults

L_AnnSetDpiX

L_AnnSetDpiY

L_AnnSetTextFixedSize

L_AnnSetLineFixedWidth

L_AnnSetFillMode

L_AnnSetFillModeExt

L_AnnSetOptions

L_AnnSetRect

L_AnnSetShowFlags

L_AnnSetTextOptions

L_AnnSetTool

The following functions provide selection capabilities:

L_AnnGetSelected

L_AnnRemove

L_AnnSelectPoint

L_AnnSelectRect

L_AnnGetSelectRect

L_AnnGetContainer

L_AnnGetTopContainer

L_AnnCutToClipboard

L_AnnHitTestExt

L_AnnGetType

L_AnnShowLockedIcon

L_AnnGetSelectCount

L_AnnSetSelected

L_AnnInsert

You can modify and enhance the automated features using other annotation functions and the WM_LTANNEVENT message.

Note:

In automation mode, the undo feature can cause the values of object handles to change. Therefore, if your application needs to identify the object that is activated or deactivated, you should use the tag property. The L_AnnSetTag function sets the tag, and L_AnnGetTag gets the current value.

Note:

The annotation example program that ships with LEADTOOLS is implemented using high-level automated features. For more information about the annotation demo, and to see an example of the automated user interface, refer to Automated User Interface for Annotations.

For information on creating an automated annotation program, refer to Implementing an Automated Annotation Program and Using Automated Annotations in Run Mode.

Non-automated Annotations

Non-automated annotations allow you to customize the creation of and interaction with annotations to suit your own needs. Any LEADTOOLS annotation function, except those requiring an automation object, can be used when working with non-automated annotations. When programming non-automated annotations, it is important to remember:

image\sqrblit.gif You must provide any menus or dialogs you wish to use for entering annotation data.

image\sqrblit.gif You must also provide your own means of drawing and interacting with the annotations.

image\sqrblit.gif No hyperlink activation is provided for non-automated annotations. In addition to providing the code for entering hyperlink type and associated parameters, you must also provide the code for accessing the default web browser and calling any programs to be run through a hyperlink.

For information on creating a non-automated annotation program, refer to Implementing a Non-automated Annotation Program and Using Non-automated Annotations in Run Mode.

 

For a list of functions pertaining to various aspects of implementing annotations, refer to:

image\sqrblit.gif Annotation Functions: Implementing Automation.

image\sqrblit.gif Annotation Functions: Working with the Toolbar.

image\sqrblit.gif Annotation Functions: Input and Output

image\sqrblit.gif Annotation Functions: Creation, Deletion and Copying

image\sqrblit.gif Annotation Functions: Global Properties

image\sqrblit.gif Annotation Functions: Size, Position and Shape

image\sqrblit.gif Annotation Functions: Object Properties

image\sqrblit.gif Annotation Functions: Display and Printing

image\sqrblit.gif Annotation Functions: Realizing to a Bitmap

 

For more information on annotations, refer to:

image\sqrblit.gif Automated User Interface for Annotations.

image\sqrblit.gif Types of Annotations.

image\sqrblit.gif Low-Level Coordinate System for Annotations.

image\sqrblit.gif Implementing Annotation Security

image\sqrblit.gif Implementing Annotation Hyperlinks

image\sqrblit.gif Annotation Objects - Default Values

image\sqrblit.gif Annotation Objects - Automated Features

image\sqrblit.gif Grouping and Ungrouping Annotation Objects

image\sqrblit.gif Displaying and Manipulating Annotation Objects

image\sqrblit.gif Creating, Deleting, and Copying Annotation Objects

image\sqrblit.gif Encryption and Decrytion Annotation Objects

image\sqrblit.gif Obtaining Annotation Object Information

image\sqrblit.gif Altering Annotation Object Settings