Using Rulers in Annotation Objects

Note:

This topic is for Document/Medical only.

The following annotation objects use 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 ruler settings along with the other object default settings

To determine the unit of measure for each ruler, check the AnnRulerUnit property and the AnnSmartUnit property. 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. Use the AnnSetUnit method 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. Use the AnnGetUnit method to get the unit of measurement and its precision for the ruler.

Use the AnnDistance property to get an array of values that represents the length of each ruler contained in the annotation object specified in the AnnGetDistance2 method.

Use the AnnTotalDistance property to obtain the total length of the ruler(s). To determine the unit of measure for the ruler, check the AnnTotalRulerUnit property and the AnnTotalSmartUnit property. To get information on individual rulers in an annotation object, check the following properties:

AnnDistance property

AnnDistanceCount property

AnnRulerUnit property

AnnSmartUnit property

The AnnTotalDistance property and the properties listed above are updated by the AnnGetDistance2 method.

There are two methods that can be used to get the length of the ruler: the AnnGetDistance method and the AnnGetDistance2 method. The AnnGetDistance method can be used with up to 2 rulers, whereas the AnnGetDistance2 method can be used on any of the ruler objects. Use the AnnGetDistance2 method to get the length of all the rulers in a Polyruler object. If the annotation object is type ANNOBJECT_CROSSPRODUCT, ANNOBJECT_PROTRACTOR or ANNOBJECT_POLYRULER, the AnnGetDistance2 method provides more information on the length of each ruler, the number of rulers, the unit of measure of each ruler and the total length of all rulers. The AnnGetDistance2 method is meant to replace the AnnGetDistance method, which is being phased out. The AnnGetDistance2 method updates the following properties with information about the ruler(s) contained in the specified object:

AnnTotalDistance

AnnTotalRulerUnit

AnnTotalSmartUnit

AnnDistance

AnnRulerUnit

AnnSmartUnit

AnnDistanceCount

At each end of the ruler is a perpendicular line called a gauge. Use the AnnSetGaugeLength method to set the length of the gauge. The length is expressed in pixels, not in points. The length extends from one end point of the gauge, through the end point of the ruler, to the other end point of the gauge. Use the AnnGetGaugeLength method to get the length of the gauge.

Along the length of the ruler are tic marks. The tic marks are the perpendicular lines that measure the units. The length of these tick marks can be set using the AnnTicMarkLength property. The length of the tic mark is expressed in pixels, not in points. Use the AnnGetShowFlags method to determine how the rulers are being displayed. Use the AnnSetShowFlags method to set whether ruler length, gauge and tic marks will be displayed.

Please note that when loading objects or pasting them from the clipboard to containers other than the Main Control's container object (accessed through the AnnContainer property), call the AnnSetBitmapDpiY method and set the vertical Bitmap DPI value to the bitmap's Y resolution, found in the BitmapYRes property. Likewise, call the AnnSetBitmapDpiX meethod and set the horizontal Bitmap DPI value to the bitmap's X resolution, found in the BitmapXRes property. Doing so will ensure that the distances shown by the ruler objects will be accurate.