# $ K Wang Image Annotation Tool Button Control
Properties   Methods    Events
The Wang Image Annotation Tool Button control adds image annotation functions to applications that support 32-bit OLE controls.  It enables end users to add text and graphical annotations to displayed image files.
Linking the Annotation Tool Button Control With the Image Edit Control
The Image Edit control is the main Imaging control.  The Image Annotation Tool Button control links to Image Edit control to permit the annotation of displayed images.  The Image Annotation Tool Button control sends messages to the Image Edit control that set annotation attributes, thereby changing all of the Image Edit annotation attributes to the values set within the Image Annotation Tool Button control.  When the Draw method is invoked, the Image Edit control draws the annotation.
Establishing the Link
To link the Image Annotation Tool Button control to the Image Edit control:
 1.	Set the DestImageControl property of the Image Annotation Tool Button control to the name of the desired Image Edit control.
 2.	Set the ImageControl property of the Image Edit control to the same Image Edit control name.
Annotation Types
The Image Annotation Tool Button Control supports the annotation types described in the following list:
Annotation Type	Description	
Attach-a-Note	Enters text into a background rectangle on an image	
Filled Rectangle	Covers a portion of an image	
Freehand Line	Draws a freehand line on a section of text or a portion of an image for emphasis	
Hollow Rectangle	Places a border around areas of an image for emphasis	
Image Embedded	Embeds an actual copy of another image in an image file	
Image Reference	Includes another image in an image file by reference (that is, it links to an external file that contains the image)	
Select Annotations	Selects annotation marks for deleting, modifying, moving, or resizing	
Straight Line	Underlines text, demarcates a section of a page, or draws callout lines
Highlights text when drawn using the transparent line style	
Text	Enters text directly on an image	
Text From File	Enters text from a file on an image	
Text Stamp	Places a text stamp directly on an image	
See Also
Image Edit control
Imaging Concepts

# $ K Properties (Image Annotation Tool Button control)
AnnotationBackColor	AnnotationTextFile	
AnnotationFillColor	AnnotationType	
AnnotationFillStyle	DestImageControl	
AnnotationFont	Enabled	
AnnotationFontColor	hWnd	
AnnotationImage	PictureDisabled	
AnnotationLineColor	PictureDown	
AnnotationLineStyle	PictureUp	
AnnotationLineWidth	StatusCode	
AnnotationStampText	Value	

# $ K AnnotationBackColor Property
Returns or sets the background color of an Attach-a-Note annotation object.
Applies To
Image Annotation Tool Button control, Image Edit control
Syntax
object.AnnotationBackColor[=color]
Data Type
Color
Remarks
Use the RGB format.  The default color is yellow (255, 255, 0).
To ensure that the text in an Attach-a-Note annotation object will be visible against the background, specify a background color that is significantly different from the font color set using the AnnotationFontColor property.
See Also
AnnotationFontColor property
Annotations
AnnotationType property
GetSelectedAnnotationBackColor method
SetSelectedAnnotationBackColor method

# $ K AnnotationFillColor Property
Returns or sets the color used to fill a Filled Rectangle annotation object.
Applies To
Image Annotation Tool Button control, Image Edit control
Syntax
object.AnnotationFillColor[=color]
Data Type
Color 
Remarks
Use the RGB format.  The default color is red (255, 0, 0).
See Also
AnnotationFontColor property
Annotations
AnnotationType property
GetSelectedAnnotationFillColor method
SetSelectedAnnotationFillColor method

# $ K AnnotationFillStyle Property
Returns or sets the pattern used to fill image and Filled Rectangle annotation objects.
Applies To
Image Annotation Tool Button control, Image Edit control
Syntax
object.AnnotationFillStyle[=value]
Data Type
Integer (enumerated)
Setting	Description	
0 (default)	Transparent -- The underlying image data is visible	
1	Opaque -- The underlying image data is obscured	
Remarks
The AnnotationFillStyle property is used with the following annotation types:
Filled Rectangle	
Image Embedded	
Image Reference	
See Also
Annotations
AnnotationType property
GetSelectedAnnotationFillStyle method
SetSelectedAnnotationFillStyle method

# $ K AnnotationFont Property
Returns or sets a font object’s properties.  Applies to all text annotation types. 
Applies To
Image Annotation Tool Button control, Image Edit control
Syntax
object.AnnotationFont
Data Type
Font object
Remarks
Use the AnnotationFont property of an object to identify the specific font object whose properties you want to use or set.  The following list shows the properties you can use or set, along with their data types, descriptions, and defaults:
Property	Data Type	Description	Default	
Bold	Boolean	True -- Selects bold attribute
False -- Deselects bold attribute	False	
Italic	Boolean	True -- Selects italic attribute
False -- Deselects italic attribute	False	
Name	String	The desired font name	MS San Serif	
Size	Single	The desired font size in points (0 to 2048)	12	
Underline	Boolean	True -- Selects underline attribute
False -- Deselects underline attribute	False	
StrikeThrough	Boolean	True -- Selects strikethrough attribute
False -- Deselects strikethrough attribute	False	
For example, the following code sets the properties of the font object identified by the AnnotationFont property of an Image Edit object:
Dim x As Font
Set x = Imgedit1.AnnotationFont
x.Bold = True
x.Italic = True
x.Name = "Arial"
x.SIZE = 16
x.Underline = True
x.StrikeThrough = True
The AnnotationFont property is used with the following annotation types: 
Text	
Attach-a-Note	
Text From File	
Text Stamp	
See Also
Annotations
AnnotationType property
GetSelectedAnnotationFont method
SetSelectedAnnotationFont method

# $ K AnnotationFontColor Property
Returns or sets the font color of text annotation objects.
Applies To
Image Annotation Tool Button control, Image Edit control
Syntax
object.AnnotationFontColor[=color]
Data Type
Color 
Remarks
Use the RGB format.  The default color is black (0, 0, 0).
The AnnotationFontColor property is used with the following annotation types:
Text	
Attach-a-Note	
Text From File	
Text Stamp	
See Also
AnnotationBackColor property
AnnotationFillColor property 
Annotations
AnnotationType property
GetSelectedAnnotationFontColor method
SetSelectedAnnotationFontColor method

# $ K AnnotationImage Property
Returns or sets the fully-qualified filename of an image file.
Applies To
Image Annotation Tool Button control, Image Edit control
Syntax
object.AnnotationImage[=name]
Data Type
String
Remarks
The name must be a fully-qualified filename.  DOS and Windows filenames are permissible.  File extensions are required as part of the filename.
The image file specified will be combined with the image currently displayed by the Image Edit control when the annotation is applied.
The AnnotationImage property is used with the following annotation types:
Image Embedded	
Image Reference	
See Also
Annotations
AnnotationType property
Display method
GetSelectedAnnotationImage method
Images

# $ K AnnotationLineColor Property
Returns or sets the line color for line and Hollow Rectangle annotation objects.
Applies To
Image Annotation Tool Button control, Image Edit control
Syntax
object.AnnotationLineColor[=color]
Data Type
Color 
Remarks
Use the RGB format.  The default color is red (255, 0, 0).
The AnnotationLineColor property is used with the following annotation types:
Freehand Line	
Hollow Rectangle	
Straight Line	
See Also
Annotations
AnnotationType property
GetSelectedAnnotationLineColor method
SetSelectedAnnotationLineColor method

# $ K AnnotationLineStyle Property
Returns or sets the line style for line and Hollow Rectangle annotation objects.
Applies To
Image Annotation Tool Button control, Image Edit control
Syntax
object.AnnotationLineStyle[=value]
Data Type
Integer (enumerated)
Setting	Description	
0 (default)	Transparent -- The underlying image data is visible	
1	Opaque -- The underlying image data is obscured	
Remarks
The AnnotationLineStyle property is used with the following annotation types:
Freehand Line	
Hollow Rectangle	
Straight Line	
See Also
AnnotationLineWidth property
Annotations
AnnotationType property
GetSelectedAnnotationLineStyle method
SetSelectedAnnotationLineStyle method

# $ K AnnotationLineWidth Property
Returns or sets the line width for line and Hollow Rectangle annotation objects.
Applies To
Image Annotation Tool Button control, Image Edit control
Syntax
object.AnnotationLineWidth[=value]
Data Type
Integer
Remarks
The integer value specifies the line width in pixels.  The valid range is from 1 to 999 pixels; the default value is 2 pixels.
The AnnotationLineWidth property is used with the following annotation types:
Freehand Line	
Hollow Rectangle	
Straight Line	
See Also
AnnotationLineStyle property
Annotations
AnnotationType property
GetSelectedAnnotationLineWidth method
SetSelectedAnnotationLineWidth method

# $ K AnnotationStampText Property
Returns or sets the format of the stamp text to be placed on an image by a Text Stamp annotation.  The stamp text can consist of text, text macro(s), or a combination of both.
Applies To
Image Annotation Tool Button control, Image Edit control
Syntax
object.AnnotationStampText[=stamp]
Data Type
String
Remarks
Text is placed on the image when one of the following events occurs:
{bmc bullet.bmp}	The end user releases the left mouse button on a displayed image
{bmc bullet.bmp}	The Draw method is invoked
The stamp text can include the following text macros:
Macro	Description	
%b	Alphabetic abbreviation of the month; for example, Jan	
%B	Alphabetic full name of the month; for example, January	
%d	ASCII numeric day of the month, ranging from 1 to 31	
%H	ASCII time in a 24-hour, hh:mm format;
where:
hh = hour
mm = minute	
%I	ASCII time in a 12-hour, hh:mm Xm format;
where:
hh = hour
mm = minute
Xm = AM or PM	
%m	ASCII numeric designation of the month, ranging from 1 to 12 for January through December respectively	
%x	Default Windows date format	
%X	Default Windows time format	
%y	ASCII numeric last two digits of the year; for example, 95 for 1995	
%Y	ASCII numeric full year; for example, 1995	
Examples
{bmc bullet.bmp}	To create an annotation text stamp that displays the current time and date in a 12-hour format, enter:
		Time: %I Date: %d-%B-%y
	The resulting annotation text stamp is:
		Time: 10:38 pm Date: 07-November-95
{bmc bullet.bmp}	To create an annotation text stamp that displays the current time and date in a 24-hour format, enter:
		Time: %H Date: %d-%B-%y
	The resulting annotation text stamp is:
		Time: 22:38 Date: 07-November-95
See Also
Annotations
AnnotationType property
Draw method

# $ K AnnotationTextFile Property
Returns or sets the fully-qualified filename of a text file to embed into an image.
Applies To
Image Annotation Tool Button control, Image Edit control
Syntax
object.AnnotationTextFile[=filename]
Data Type
String
Remarks
The name must be a fully-qualified filename.  DOS and Windows filenames are permissible.  A file extension is required for all files.
The AnnotationTextFile property is used with the Text From File annotation type.
See Also
Annotations
AnnotationType property

# $ K AnnotationType Property
Returns or sets the type of annotation to be drawn.
Applies To
Image Annotation Tool Button control, Image Edit control
Syntax
object.AnnotationType[=value]
Data Type
Integer (enumerated)
Setting	Description	
0 (default)	None	
1	Straight Line	
2	Freehand Line	
3	Hollow Rectangle	
4	Filled Rectangle	
5	Image Embedded	
6	Image Reference	
7	Text	
8	Text Stamp	
9	Text From File	
10	Attach-a-Note	
11	Select Annotations	
Prerequisite Properties
Some annotation types require that other properties be set to valid values before they can be used in an annotation.  The following list shows the properties that must be set before the corresponding annotation type can be drawn:
Prerequisite Property	Annotation Type	
AnnotationImage	Image Embedded	
AnnotationImage	Image Reference	
AnnotationStampText	Text Stamp	
AnnotationTextFile	Text From File	
The Draw method generates an error if it is invoked without the required property being set.
If the end user attempts to draw an annotation using the Image Annotation Tool Button control without the required property being set, an error event is sent to the target Image Edit control window.  It is up to you to decide whether to present this error to the end user in your application.
When using the standard Annotation Tool Palette, a Select File dialog box appears at run-time to allow the end user to select the desired file.
Do not attempt to change the AnnotationType property when the standard Annotation Tool Palette is displayed.  Use the SelectTool method instead.
Remarks
The Image Embedded annotation type (setting 5) stores a copy of the actual image data.  The Image Reference annotation type (setting 6) stores the image data by reference (filename only).
See Also
AnnotationImage property
Annotations
AnnotationStampText property
AnnotationTextFile property
Draw method
SelectTool method (Image Edit control)
ShowAnnotationToolPalette method (Image Edit control)

# $ K DestImageControl Property
Returns or sets the link to the Image Edit control.
Applies To
Image Annotation Tool Button control
Syntax
object.DestImageControl[=controlname]
Data Type
String
Remarks
Set the DestImageControl property to the name of the desired Image Edit control.  The ImageControl property of the Image Edit control must also be set to the same name.
The Image Annotation Tool Button control links to Image Edit control to permit the annotation of displayed images.  The Image Annotation Tool Button control sends messages to the Image Edit control that set annotation attributes, thereby changing all of the Image Edit annotation attributes to the values set within the Image Annotation Tool Button control.  When the Draw method is invoked, the Image Edit control draws the annotation.
See Also
Draw method
ImageControl property

# $ K Enabled Property
Enables or disables the control.
Applies To
Image Annotation Tool Button control, Image Edit control, Image Thumbnail control
Syntax
object.Enabled[={True|False}]
Data Type
Boolean
Setting	Description	
True (default)	Control is enabled (can respond to events)	
False	Control is disabled (cannot respond to events)	

# $ K hWnd Property
Indicates the window handle to the control. 
Applies To
Image Annotation Tool Button control, Image Edit control, Image Thumbnail control
Syntax
[object.]hWnd
Data Type
Long
Remarks
Available at run-time as read-only. 

# $ K PictureDisabled Property
Returns or sets the bitmap image that appears on the control when its Enabled property is set to False (disabled).
Applies To
Image Annotation Tool Button control
Syntax
object.PictureDisabled[=picture]
Data Type
Picture
Remarks
The bitmap is scaled to fit the size of the control.  If no bitmap is specified, the default bitmap is used.
See Also
Enabled property
PictureDown property
PictureUp property

# $ K PictureDown Property
Returns or sets the bitmap image that appears on the control when it is selected.  A control is selected when an end user clicks on it, or when its Value property is set to True within a program.
Applies To
Image Annotation Tool Button control
Syntax
object.PictureDown[=picture]
Data Type
Picture
Remarks
The bitmap is scaled to fit the size of the control.  If no bitmap is specified, the default bitmap is used.
See Also
PictureDisabled property
PictureUp property
Value property

# $ K PictureUp Property
Returns or sets the bitmap image that appears on the control when it is enabled but not selected.  A control is enabled when its Enabled property is set to True.  A control is not selected (deselected) when the end user has not clicked on it, or when its Value property is set to False within a program.
Applies To
Image Annotation Tool Button control
Syntax
object.PictureUp[=picture]
Data Type
Picture
Remarks
The bitmap is scaled to fit the size of the control.  If no bitmap is specified, the default bitmap is used.
See Also
Enabled property
PictureDown property
PictureDisabled property
Value property

# $ K Value Property
Selects or deselects the control at run-time.  Setting this property to True selects the control, which is the same as an end user clicking on it.  Setting this property to False deselects the control.
When a control is selected, the following events occur:
{bmc bullet.bmp}	The bitmap specified in the PictureDown property is drawn on the control
{bmc bullet.bmp}	Other controls on the form with the same DestImageControl property value have their Value property set to False automatically
{bmc bullet.bmp}	The AnnotationType property in the Image Edit control is changed to the value of the AnnotationType property in the Image Annotation Tool Button control.
When a control is deselected, the bitmap specified in the PictureUp property is drawn on the control.
Applies To
Image Annotation Tool Button control
Syntax
object.Value[={True|False}]
Data Type
Boolean
Setting	Description	
True	Control is selected	
False (default)	Control is deselected	
Remarks
This property is available only at run-time.
See Also
AnnotationType property
DestImageControl property
PictureDown property
PictureUp property

# $ K Methods (Image Annotation Tool Button control)
AboutBox	
Draw	

# $ K Draw Method
Draws the annotation.
Applies To
Image Annotation Tool Button control, Image Edit control
Syntax
object.Draw Left,Top[,Width,Height]
Arguments
Parameter	Data Type	Setting	
Left	Long	The starting horizontal coordinate of the annotation in image pixels	
Top	Long	The starting vertical coordinate of the annotation in image pixels	
Width	Long	The width of the annotation in image pixels	
Height	Long	The height of the annotation in image pixels	
Return Value
None
Remarks
The Draw method draws the annotation specified by the AnnotationType property, standard Annotation Tool Palette, or SelectTool method on the displayed image.  The method draws the annotation in accordance with the coordinates specified in the left, top, width, and height parameters.
The width and height parameters must be specified when using the following annotation types:
Select Annotations (optional; see the following Note)	
Freehand Line	
Filled Rectangle	
Hollow Rectangle	
Straight Line	
Attach-a-Note	
Note
Width and height parameter entry is optional when using the Select Annotations annotation type.  If only the left and top parameters are specified, selection can be made by point.  If all of the parameters are specified, selection can be made using the Select Annotations rectangle.
See Also
Annotations
AnnotationType property
Images
MarkEnd event
SelectTool method (Image Edit control)

# $ K Events (Image Annotation Tool Button control)
The following Events, used by the Image Annotation Tool Button control, are all standard:
Click	KeyUp	
DblClick	MouseDown	
Error	MouseMove	
KeyDown	MouseUp	
KeyPress		
Visual Basic adds the DragDrop, DragOver, GotFocus, and LostFocus events.

# $ RGB Format
RGB (Red Green Blue) values range from 0 to 16,777,215 (&HFFFFFF).  The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively.  The red, green, and blue components are each represented by a number between 0 and 255 (&HFF).