AnnAutoHilightPen property (Annotation Control)

C++ Builder example

Delphi example

 

Builder Syntax

unsigned AnnAutoHilightPen

Delphi Syntax

AnnAutoHilightPen: COLORREF

Overview

Refer to Implementing Annotations.

Remarks

(Document/Medical only) Gets or sets the color of the pen that is used for highlighting.

Use this function to change the color of the pen that is used for highlighting and selecting. More specifically, this pen is used in the following situations:

image\sqrblit.gif In automated annotation design mode, after selecting ANY tool and clicking and dragging the mouse to draw an outline. The outline is displayed using the highlight pen.

image\sqrblit.gif In automated annotation design mode, after choosing the Select tool and clicking on an existing annotation object. When the mouse is down, the selected object is displayed using the highlight pen.

The highlighting is implemented by taking the "exclusive-or" (XOR) of the highlight pen color and the underlying image.

The default highlight pen has an RGB or TColor value of 0xFFFFFF (white). This color works well for most images. However, images that have many mid-range gray colors will not effectively show a highlight. To understand why this is so, consider an image that contains only the color gray 0x808080. The highlight color will be determined by

 Highlight Color  = (0xFFFFFF) XOR (0x808080)

   = 0x7F7F7F

The highlight color (0x7F7F7F) (gray) and the underlying image color (0x808080) (gray) are almost the same color, and indistinguishable to the naked eye. In cases like this, the highlight will not be visible.

To avoid this, choose a different highlight pen color so that the XOR with the underlying color will give a result that is visibly different from the underlying color. A good choice is 0xC0C0C0 (silver). The XOR of 0xC0C0C0 (silver) with the (0x808080) (gray) is 0x404040 (another gray, but more visible).

To change the highlight color back to the default color after changing the highlight color, use the AnnAutoHilitePen property to change the color back to the TColor value of 0xFFFFFF.

Note that several of the automated mode annotation cursors are displayed using an XOR operation. These cursors will not be visible if an image has many mid-range values. To avoid this, define new cursors and use the AnnAutoCursor property.

To convert from a TColor value to a COLORREF value, call the ColorToRGB method. To convert from a COLORREF value to a TColor value, cast the COLORREF value to a TColor type.

See Also

Elements

AnnGetVisible method, AnnInsert method, AnnSetAutoDefaults method, AnnSetSelected method, AnnSetVisible method

Topics

Annotations (Document/Medical only): Automation

 

Annotations (Document/Medical): Object Manipulation