Overview

The Getting Started application demonstrates how to use the Wang Imaging OLE controls to add image and image annotation functions to a Visual Basic application. Once compiled, it enables users to display, annotate, and manipulate image files. The application uses the following Imaging controls:

· Image Admin

· Image Edit

· Image Thumbnail

Wang Laboratories, Inc., assumes that you are familiar with Visual Basic, Version 4.0. If necessary, refer to your Visual Basic documentation for assistance.

Disclaimer: Wang provides this sample application "as is," to be used as a learning tool, and accepts no liability for its use. It is not intended to be used in whole, or as part of, any application you create to use or sell.


Building the Application

Perform the following steps to build the Getting Started application.


Start Visual Basic and Add the Imaging Controls

  1. Create a new Project.
  2. Add the Imaging controls to the project by choosing Custom Controls from the Tools menu. Within the Available Controls list box, select the check box next to each of the following items:
    • Wang Image Admin Control
    • Wang Image Edit Control
    • Wang Image Scan Control
    • Wang Image Thumbnail Control
  3. Choose OK to update your Toolbox.


Set Properties for Form1

  1. Set the following properties for Form1:
    • Caption to Getting Started
    • Height to 5545
    • Width to 7850
  2. Set the other properties to suit your requirements, or accept the default values.


Draw the Controls and Set Their Properties

Image Admin Control

  1. Click on the ImgAdmin tool, and then draw the control anywhere on Form1.
  2. Set its properties to suit your requirements, or accept the default values.

Image Edit Control

  1. Click on the ImgEdit tool, and then draw the control on Form1. Draw the control so that it takes up approximately 80 percent of the form. Reserve the remaining space for the Image Thumbnail control.
  2. Set the following properties for the Image Edit control:
    • Height to 4455
    • Width to 6135
  3. Set the other properties to suit your requirements, or accept the default values.

Image Thumbnail Control

  1. Click on the ImgThumbnail tool, and then draw the control on Form1. Draw the control so that its width fills the remaining space on the form, and its height is the same as that of the Image Edit control.
  2. Set the following properties for the Image Thumbnail control:
    • Height to 4455
    • Width to 1335
    • ThumbHeight to 100
    • ThumbWidth to 55
  3. Set the other properties to suit your requirements, or accept the default values.


Create the Menu Structure

Use the Menu Editor to create the following menu structure on Form1:

Menu Level | Caption: Name: | File mnuFile | Edit mnuEdit | Scale mnuScale | Annotation mnuAnnotation
Submenu Levels | Caption: Name: | Open mnuOpen | Rotate Right mnuRotateRight | Zoom Up mnuZoomUp | Show Palette mnuShowPalette
 | Caption: Name: | Exit mnuExit | Rotate Left mnuRotateLeft | Zoom Down mnuZoomDown |
 | Caption: Name: |  | Flip mnuFlip | Zoom 100% mnuZoom100 |


Write the Code

Thumbnail Control

Enter the following code to display the page number of the file in the Image Thumbnail control and the image in the Image Edit control when the Click event occurs:

Private Sub ImgThumbnail1_Click(ByVal ThumbNumber As Long)

ImgEdit1.Page = ThumbNumber

ImgEdit1.Display

End Sub

Open Command

Enter the following code to

· Filter the file types for the Open dialog box,

· Invoke the Open dialog box, and

· Display the selected image in the Image Edit and Image Thumbnail controls

when the Click event occurs:

Private Sub mnuOpen_Click()

ImgAdmin1.Filter = "All Image Files(*.tif, *.bmp, *.awd, *.jpg) |

*.tif; *.bmp; *.awd; *.jpg |All files (*.*)|*.*|"

ImgAdmin1.ShowFileDialog OpenDlg

ImgEdit1.Image = ImgAdmin1.Image

ImgEdit1.Display

ImgThumbnail1.Image = ImgEdit1.Image

ImgThumbnail1.GenerateThumb 0

End Sub

Exit Command

Enter the following code to exit the Getting Started application when the Click event occurs:

Private Sub mnuExit_Click()

End

End Sub

Rotate Right Command

Enter the following code to rotate the image 90 degrees to the right when the Click event occurs:

Private Sub mnuRotateRight_Click()

ImgEdit1.RotateRight

End Sub

Rotate Left Command

Enter the following code to rotate the image 90 degrees to the left when the Click event occurs:

Private Sub mnuRotateLeft_Click()

ImgEdit1.RotateLeft

End Sub

Flip Command

Enter the following code to flip the image 180 degrees when the Click event occurs:

Private Sub mnuFlip_Click()

ImgEdit1.Flip

End Sub

Zoom Up Command

Enter the following code to scale the image to 150 percent when the Click event occurs:

Private Sub mnuZoomUp_Click()

ImgEdit1.Zoom = 150

ImgEdit1.Refresh

End Sub

Zoom Down Command

Enter the following code to scale the image to 50 percent when the Click event occurs:

Private Sub mnuZoomDown_Click()

ImgEdit1.Zoom = 50

ImgEdit1.Refresh

End Sub

Zoom to 100% Command

Enter the following code to scale the image to 100 percent when the Click event occurs:

Private Sub mnuZoom100_Click()

ImgEdit1.Zoom = 100

ImgEdit1.Refresh

End Sub

Show Palette Command

Enter the following code to invoke the standard Annotation Tool Palette when the Click event occurs:

Private Sub mnuShowPalette_Click()

ImgEdit1.ShowAnnotationToolPalette

End Sub


Imaging Concepts

This document describes the imaging concepts that are associated with Imaging OLE controls.


Annotations

The following terms describe the annotation concepts that are associated with Imaging OLE controls.


What Are Annotations?

Annotations are digitized versions of the marks commonly used on documents in a paper-based environment; for example, highlight, rubber stamps, and text notes. Like their paper-based counterparts, digitized annotation marks are typically used to prepare documents for subsequent handling in a business process. However, digitized annotations provide additional benefits that paper-based tools do not:

· Digitized annotations can be added, moved, and deleted at will.

· The attributes of digitized annotations (such as color, size, text, and visibility) can be readily modified.

· Groups of digitized annotations can be named. The named groups can then be selectively acted upon.

Annotation marks can be saved within the image file as annotation data that is kept separate from the image data, or the marks can be merged with the image data in a process known as burning-in. To save annotations to any file type other than TIFF, the annotations must be burned-in.

Burning-in converts the annotation marks into image pixels and merges them with the underlying image pixels in the process. Once annotations are burned-in, they become part of the base image and can no longer be manipulated by the annotation functions.


Annotation Functions

Annotation functions provide tools for drawing and manipulating annotation marks. Depending on how you implement them in your application, the end user can:

· Create, move, resize, edit, and delete annotation marks.

· Modify annotation attributes (such as color, size, text, and visibility).

· Group annotation marks and control their visibility.

· Save annotation marks as part of the image or separately.


Annotation Groups

Annotation groups make it possible to organize and manage annotations, giving the end user the capability to:

· Logically organize annotations into functional groups; for example, Accounts Payable Group, Accounts Receivable Group, Purchasing Group, Receiving Group, and so on.

· Toggle the visibility of the groups; for example, to Turn On Accounts Payable Comments, Turn On All Comments, and so on.

A group can contain one or more annotation marks and multiple groups can be associated with a single image.


Annotation Types

Imaging OLE controls support the following annotation types:

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
Highlighter | Draws a transparent, filled rectangle for highlighting emphasis (available as a discreet annotation type on the Annotation Tool Palette)
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)
Image Stamp | Places an image stamp directly on an image
Rubber Stamp | Places an image or text stamp directly on an image (available as a discreet annotation type on the Annotation Tool Palette)
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
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


Compression

The following terms describe the compression concepts that are associated with Imaging OLE controls.


What Is Compression?

Compression is the process by which image data is reduced to require less storage space. Employing compression is particularly important when saving gray-scale or color images because of their large size.


Compressed Image

A Compressed image is an image that is stored with compression, which is a technique that reduces the file space requirements of the image.


Compression Options

Compression options are bitwise values that dictate how image data is compressed. A relationship exists between compression options and compression types, where certain compression options apply only to specific compression types.

Whenever a compression option and a compression type are specified as arguments to an Imaging OLE method, the software checks the relationship for validity.

Imaging OLE controls support the following compression options:

Compressed LTR -- Compressed bit order, Left-To-Right. The compressed data codes begin at the most significant bit of each byte and are ordered from the most significant bit to the least significant bit. The Compressed LTR compression option applies to all compression types that support black-and-white images, except the PackBits compression type.

EOL -- End Of Line. Each line of data is terminated with a standard end-of-line bit. The EOL compression option applies to the Group3(1D) and Group3(2D) compression types.

Expand LTR -- Expanded bit order, Left-To-Right. The expanded data codes begin at the most significant bit of each byte and are ordered from the most significant bit to the least significant bit. The Expand LTR compression option applies only to image data that is being read; it is therefore meaningless when writing or converting images. The Expand LTR compression option applies to all compression types except JPEG.

Negate -- A high-level request to invert black-and-white data. The Negate compression option applies to all compression types that support black-and-white images.

Packed Lines -- The compressed data is packed into bytes with no padding at the end of each line (the data is not byte-aligned). The Packed Lines compression option applies to the Group3(1D), Group3(2D), and Group4(2D) compression types.

Prefixed EOL -- Each strip of data is prefixed by a standard end-of-line bit sequence. The Prefixed EOL compression option requires that the EOL compression option be set as well. It applies to the Group3(1D) and Group3(2D) compression types.

JPEG Options -- Joint Photographics Experts Group compression options. JPEG compression options comprise all combinations of high, medium, or low compression and high, medium, or low quality (resolution).

The higher the compression, the lower the disk space requirement; the higher the resolution, the greater the image quality. An image compressed with the Low Compression/High Quality option has the highest disk space requirement and the highest image quality. Conversely, an image compressed with the High Compression/Low Quality option has the lowest disk space requirement and the lowest image quality.

The JPEG compression options apply to the JPEG compression type, which can be used with JPG and TIFF file types.


Compression Type Support

For each file and image type, the Imaging OLE controls support the following compression types:

File Type

Image Type

Compression Type Supported

AWD | Black-and-White | RBA (Microsoft-proprietary)
BMP | Black-and-White Palettized4 Palettized8 BGR24 | None
DCX/PCX | Black-and-White Palettized4 Palettized8 RGB24 | PCX proprietary
JPG | Gray8 RGB24 | JPEG
TIFF | Black-and-White Gray4 Gray8 Palettized4 Palettized8 RGB24 | None, Group3(1D), Group3(2D), Group3(MH), Group4(2D), LZW, PackBits None, LZW None, JPEG, LZW None, LZW None, LZW None, JPEG, LZW
XIF | Black-and-White | None, Xerox-proprietary

Notes: The DCX/PCX, JPG, and XIF file types are read-only. For TIFF file types, the Palettized4 image type is read-only. The Group3(2D) and LZW compression types are read-only.


Compression Types

Imaging OLE controls support the following compression types:

RBA -- The RBA compression type is used to compress black-and-white AWD (At Work Document) images. RBA is a Microsoft-proprietary compression type.

Group3(1D) -- A compression type based on the CCITT Group3 fax standard, Group3(1D) is used to compress black-and-white TIFF image files. Group3(1D) encodings are designed to provide reliable delivery of image data over inherently unreliable data links. It is commonly used to compress images for fax transmission.

Group3(2D) – Similar to the Group3(1D) compression type, Group3(2D) is used to compress black-and-white TIFF image files for fax transmission exclusively. Group 3(2D) encodings provide a high degree of error recovery during fax transmission. Read-only.

Group3(Modified Huffman [MH]) – Also similar to the Group3(1D) compression type, except Group3(MH) provides no end-of-line characters. It is used to compress black-and-white TIFF image files.

Group4(2D) -- Based on the CCITT Group4 fax standard, Group4(2D) is used to compress black-and-white TIFF image files. Group 4(2D) encodings are designed to provide delivery of image data over reliable data links, such as ISDN or X.25. It provides superior compression for non-dithered images when compared to the Group3(1D) compression type.

JPEG -- The Joint Photographics Experts Group compression type is used to compress 24-bit color (RGB24) and 8-bit gray-scale (Gray8) image files. JPEG produces a high compression ratio, but some image data is actually lost during compression.

LZW (Lempel-Ziv-Welch) -- A lossless compression type (that is, no data is lost during compression). It is used with black-and-white; BGR24, RGB24, Palettized4, and Palettized8 color images; as well as Gray4 and Gray8 gray-scale images. Read-only.

PackBits -- A simple, byte-oriented, run-length compression type, PackBits is used to compress black-and-white TIFF image files.

PCX -- A ZSoft-proprietary compression type, PCX is used to compress multipage DCX and single-page PCX black-and-while and color images.

Xerox-proprietary -- The Xerox-proprietary compression type is used to compress XIF images.


Uncompressed Image

An Uncompressed image is an image that is stored as is, without compression of any kind.


Display

The following terms describe the display concepts that are associated with Imaging OLE controls.


What Are Display Functions?

Display functions provide the ability to display and manipulate images within an image window. Typical display functions include:

· Copying, cutting, and pasting to the Clipboard

· Flipping

· Rotating

· Scrolling

· Zooming

These display functions manipulate the image data in the display memory of the PC. The image file data is not modified unless the image is saved.


Display Types

The display type pertains to the way in which data is presented to the monitor. It does not alter the original image in any way. Imaging OLE controls support the following display types:

Black-and-White (Bi-Level) -- Displays an image as black and white. The Black-and-White display type is typically used for applications that manage black-and-white documents exclusively, or with configurations that have monochrome monitors.

Common -- Displays an image using the common palette. The Common display type permits the display of multiple images simultaneously while maintaining reasonable image quality. A monitor and controller capable of displaying 256 colors are recommended.

Custom -- Displays an image using the best palette possible. The palette used depends on the type of image being displayed, as described in the following list:

Image

Palette Used

Black-and-White | Binary
4-Bit Gray-Scale | Common
8-Bit Gray-Scale | Gray8
24-Bit Color Images | Common

Because the palette used is designed specifically for the type of image being displayed, the custom display type is best suited to application programs that display one image at a time. A monitor and controller capable of displaying 256 colors are recommended.

Gray8 -- Displays an image using a linear-scale palette of up to 128 shades of gray.

RGB24 -- Displays an image by letting Windows map the image directly to the monitor. With suitable hardware, the RGB24 display type produces the best color at the optimum speed. Further, it allows multiple images to be displayed with no loss in background image quality. A monitor and controller capable of displaying 32,000 colors are recommended.


Images

The following terms describe the image concepts that are associated with Imaging OLE controls.


What Is an Image?

An image is a photograph, line drawing, or text document that has been converted to digitized form, usually by a scanning device. A scanned image is saved in a particular image file format.

Typically, an image is displayed in a window that can be sized or moved. Images can also be annotated, e-mailed, faxed, or printed.


Bitmap Image

A Bitmap image is a representation of a graphic image, displayed by setting individual pixels to white, black, or a color. This type of image is typically used by the Windows Paintbrush applet and has a filename extension of .BMP.


Black-and-White Image

A Black-and-White image is a type of image where each pixel is either on (black) or off (white). This type of image is typically used in fax transmissions.


Color Image

A Color image is a type of image that contains various colors. Imaging OLE controls support 4- and 8-bit palettized images, as well as 24-bit color images.


Dots Per Inch

Dots Per Inch (dpi) indicates the number of dots (or pixels) per inch in an image. The more dots per inch in an image, the higher its density and quality.


File Types

Imaging OLE controls support the following file types:

AWD -- The file format for Microsoft AWD (At Work Document) images. AWD supports black-and-white images only. AWD files are compressed using RBA compression.

BMP -- The file format used by the Windows Paintbrush applet. BMP (bitmap) supports single-page color images. Compression of BMP files is not supported.

DCX (read-only) -- The file format for multipage ZSoft PaintBrush images. DCX supports both black-and-white and color images. DCX files are compressed using PCX compression.

JPG (read-only) -- The file format for Joint Photographics Experts Group (JPEG) images. JPG supports single-page 8-bit gray-scale and RGB24 color images. JPG files are compressed using JPEG compression.

PCX (read-only) -- The file format for single-page ZSoft PaintBrush images. PCX supports both black-and-white and color images. PCX files are compressed using PCX compression.

TIFF -- The file format for Tag Image File Format (TIFF) images. TIFF supports multipage black-and-white, gray-scale, and color images; several compression types; and a variety of options. TIFF is compatible with all image densities.

XIF (read-only) -- The file format for Xerox images. XIF supports multipage black-and-white images only. XIF files can be uncompressed, or compressed using Xerox-proprietary compression.


Gray-Scale Image

A Gray-Scale image is a type of image that contains various shades of gray. Imaging OLE controls support 4- and 8-bit gray-scale images.


Image Files

Images are stored in image files, which are standard Windows files. Image files can be organized in folders, copied, renamed, deleted, and so on, using standard Windows commands.

Depending on the file format, image files can contain one or more images. In multipage image files, each image is stored in a single image page. Image files can be stored on the hard drive of a local PC, or on redirected network drives. Applications can access any available image file by specifying its proper path (drive, folder, and filename).


Image Page

Image pages provide a way to organize multiple images in an image file. Each page contains or stores one image. The following file types support multiple pages:

· AWD

· DCX

· TIFF

· XIF


Image Types

Imaging OLE controls support the following image types:

BGR24 -- This type of image uses 24 bits of data per pixel (eight bits-per-pixel for each of the three primary colors -- Blue, Green, and Red). This translates to 256 shades of each primary color to provide up to 16 million colors for each image. To display BGR24 images, the monitor and controller must be capable of displaying at least 32,000 colors. The BGR24 image type is typically encountered in BMP files.

Black-and-White (Bi-Level) -- The Black-and-White image type displays one bit of data per pixel on the screen as either black or white.

Gray Scale -- There are two types of gray-scale images: Gray4 and Gray8.

Gray4 -- A Gray4 image uses 4 bits of data per pixel. Every pixel on the screen can be displayed in 16 shades of gray, giving the image much better clarity than black-and-white images.

Gray8 -- A Gray8 image uses 8 bits of data per pixel. Every pixel can be displayed with 256 shades of gray, producing better image clarity than Gray4. Gray8 images are particularly effective for storing pictures and photographs.

Palettized -- There are two types of palettized images: Palettized4 and Palettized8.

Palettized4 -- A Palettized4 image uses 4 bits of data per pixel to reference a palette of 16 RGB (Red, Green, Blue) colors. These images can use a custom palette only.

Palettized8 -- A Palettized8 image uses 8 bits of data per pixel to reference a palette of 256 RGB colors. These images can use either a custom or common palette.

RGB24 -- Also known as true color, an RGB24 image is the same as a BGR24 image, but with the colors (Red, Green, and Blue) in a different order.


Pixel

The pixel is the smallest graphic unit on a screen or image. It is equal to one screen dot or picture element.


Resolution

Resolution is the overall measurement of image quality. It is expressed as the number of dots- or pixels-per-inch. It is possible for an image to have different horizontal and vertical resolutions. For example, images received from fax transmissions typically have resolutions of 200 by 100 pixels-per-inch. The more pixels-per-inch, the higher the resolution. Image quality increases in proportion with the resolution value. Therefore, the higher the resolution, the greater the image quality.


True Color Image

A True Color image is a type of image that mixes shades of red, green, and blue to provide over 16 million colors. These color images are also known as BGR24 or RGB24 images.


Palettes

The following terms describe the palette concepts that are associated with Imaging OLE controls.


What Is a Palette?

A palette is a look-up table that is used to translate an index value into a color value (known as an RGB value, for Red, Green, Blue). There are two types: Common and Custom.

Color images are often stored using a palette so that they take up less space. Such an image is said to be palettized. A complex image that has been palettized is often of lower quality than the original image. This is due to the fact that the eye can distinguish many more colors than are usually available in the palette.

Windows reserves 20 palette entries to use for window backgrounds, borders, and so on.


Common Palette

A common palette is shared by all images being displayed. It is a special, 8-bit palette that has a variety of colors, chosen because they give generally good results for both color and gray-scale images. While the resulting image display is not as good as a custom palette rendition of the image, the common palette has the advantage of permitting any number of images to be displayed simultaneously with good overall quality.


Custom Palette

A custom palette is optimized for the display of a particular image. An image displayed using a custom palette results in an image that is most like its original.

Using the custom palette has one disadvantage, which is only noticeable when displaying multiple images using a monitor and controller that display 256 or fewer colors. The disadvantage is that background images can appear in lower quality than their originals. This occurs because Windows shares the active palette of the foreground window, which may not be suitable for displaying background images.


Scanning

The following terms describe the scanning concepts that are associated with Imaging OLE controls.


What Is Scanning?

Scanning is the procedure for capturing data as images in electronic form.

An image acquisition device (typically a scanner) is connected to the PC and controlled by an application program. The application program communicates with the scanner through an interface called the scanner data source (driver), which is usually supplied by the manufacturer of the scanner. Imaging OLE controls support TWAIN, the industry-standard specification for image capture.


TWAIN Specification

TWAIN is an industry-standard, open specification that defines the way in which an image acquisition device (typically a scanner) communicates with an application program. With TWAIN, an application program can acquire images through any device that complies with its specification.

For your scanner, or other image acquisition device, to function properly, you need the TWAIN data source from its manufacturer as well as the latest 32-bit TWAIN DLLs. You can obtain the latest 32-bit TWAIN DLLs from the following sources:

World Wide Web -- At http://www.twain.org

FTP -- At ftp.twain.org


Wang Image Admin Control

Wang's Image Admin control provides a method to administer image files that reside locally, or on a local area network (LAN). File and Print common dialog boxes support specific image file options as well as general directory and file functions.

General functions you can perform include creating, deleting, renaming, and moving directories and files, retrieving image file attributes, and setting image file attribute defaults.

Image-specific functions include inserting, appending, and replacing pages in a multi-page image file.


Properties

The Image Admin control uses the following Properties:

CancelError | HelpContextId | PageNumber
CompressionInfo | HelpFile | PageType
CompressionType | HelpKey | PrintAnnotations
DefaultExt | Image | PrintEndPage
DialogTitle | ImageHeight | PrintNumCopies
FileType | ImageResolutionX | PrintOutputFormat
Filter | ImageResolutionY | PrintRangeOption
FilterIndex | ImageWidth | PrintStartPage
Flags | InitDir | PrintToFile
HelpCommand | PageCount | StatusCode


CancelError Property

Indicates or sets if an error will be returned when a user chooses Cancel from either the File or Print dialog boxes.

Applies To

Image Admin control

Syntax

object.CancelError[= {True|False}]

Data Type

Boolean

Setting

Description

True (default) | Causes an error to be returned when the user chooses Cancel from either the File or Print dialog boxes.
False | No error is returned when the user chooses Cancel.

Remarks

When a user chooses Cancel from the File or Print dialog boxes, and this property is set to True, an error is returned by the ShowFileDialog or ShowPrintDialog methods, respectively.

See Also

ShowFileDialog method

ShowPrintDialog method


CompressionInfo Property

Returns the bitwise compression options set for the current image.

Applies To

Image Admin control

Syntax

object.CompressionInfo[=value]

Data Type

Long

Setting

Description

Note: Values 1 to 32 are not used with JPEG compression.

1 | EOL -- include or expect standard end of line bit sequences
2 | Packed lines -- data is not byte aligned
4 | Prefixed EOLs -- include or expect prefixed end of line bit sequences
8 | Compressed bit order, left to right
16 | Expanded bit order, left to right
32 | Negate -- indicates data is stored with black bits equal to 0 (zero)

Note: Values 64 to 16384 pertain only to JPEG compression.

64 | High compression, high quality
128 | High compression, medium quality
256 | High compression, low quality
512 | Medium compression, high quality
1024 | Medium compression, medium quality
2048 | Medium compression, low quality
4096 | Low compression, high quality
8192 | Low compression, medium quality
16384 | Low compression, low quality

Remarks

The value returned by this property is for the image page specified by the PageNumber property. If no image is specified by PageNumber, the value returned is 0 (zero).

This property is read-only.

See Also

Compression topics in Imaging Concepts

CompressionType property

Image property

PageNumber property


CompressionType Property

Returns the compression type of the current image.

Applies To

Image Admin control

Syntax

object.CompressionType[=value]

Data Type

Integer (enumerated)

Setting

Description

0 | Unknown
1 | No compression
2 | Group 3 1D FAX
3 | Group 3 Modified Huffman
4 | Packed Bits
5 | Group 4 2D FAX
6 | JPEG
7 | RBA
8 | Group 3 2D FAX
9 | LZW

Remarks

The value returned by this property is for the image page specified by the PageNumber property. If the Image property is empty, the value returned is 0 (zero).

This property is read-only.

See Also

Compression topics in Imaging Concepts

CompressionInfo property

Image property

PageNumber property


DefaultExt Property

Returns or sets the default file extension in the ShowFileDialog dialog box.

Applies To

Image Admin control

Syntax

object.DefaultExt[=extension]

Data Type

String

Remarks

The extension of the currently selected filter overrides the default extension.

The default extension is used only when there is no extension associated with the filter (for example, 'All files *.*').

The first three characters of the string you specify are used as the file extension when the user does not specify a file extension.

See Also

ShowFileDialog method


DialogTitle Property

Returns or sets the title used in the common dialog boxes.

Applies To

Image Admin control

Syntax

object.DialogTitle[=title]

Data Type

String

Remarks

This property is used in conjunction with the ShowFileDialog method.

If a string is not specified, the default is used -- either Open or Save As.

See Also

ShowFileDialog method


FileType Property

Returns the file format of the image file.

Applies To

Image Admin control

Syntax

object.FileType[=value]

Data Type

Integer (enumerated)

Property settings are expressed using the following values:

Setting

Description

0 | Unknown
1 | TIFF
2 | AWD
3 | Bitmap (BMP)
4 | PCX
5 | DCX
6 | JPEG
7 | XIF

Remarks

The file format is determined by the Image property.

This property is read-only.

See Also

File types in Imaging Concepts

Image property


Filter Property

Returns or sets the list of file filters displayed.

Applies To

Image Admin control

Syntax

object.Filter[=filter]

Data Type

String

Remarks

Filters are displayed in the common dialog box created by the ShowFileDialog method.

Each filter type consists of two strings separated by, and ending with, a pipe symbol ( | ). The first string contains a description of the filter, such as 'Tiff files'. The second string contains the file extension, such as '*.tif'. Be sure not to include spaces immediately before and after the pipe symbol, or they become part of the string. For example:

All image files|*.tif;*.bmp|TIFF files|*.tif| BMP files|*.bmp|

If no filter type is provided, the system supplies a default filter.

See Also

ShowFileDialog method


FilterIndex Property

Specifies which of the file filters is highlighted in the file common dialog box when the dialog box first opens.

Applies To

Image Admin control

Syntax

object.FilterIndex[=index]

Data Type

Long

Remarks

If no filters are specified by the Filter property and the FilterIndex property is set to 0 (zero), then a default filter will be highlighted. If a different filter is selected, the index still remains set to 0.

If a value was set for the Filter property, and a different filter is selected, the index will be updated to reflect the selected filter.

The default value is 0 (zero).

See Also

Filter property

ShowFileDialog method


Flags Property

Sets initialization flags for dialog boxes created by the ShowFileDialog and ShowPrintDialog methods.

Applies To

Image Admin control

Syntax

object.Flags[=value]

Data Type

Long

Values for ShowFileDialog

Value

Description

&H400& | Indicates that the extension of the returned filename is different from the extension specified by the DefaultExt property. This flag is not set if the DefaultExt property is empty, if the extensions match, or if the file has no extension. This flag value can be checked upon returning from the dialog box.
&H4& | Hides the Read-Only check box.
&H8& | Forces the dialog box to set the current directory to what it was when the dialog box was invoked.
&H8000& | Specifies that the returned file will not have the Read-Only attribute set and will not be in a write-protected directory.
&H100& | Specifies that the common dialog box allows invalid characters in the returned filename.
&H1& | Causes the Read Only check box to be initially checked when the dialog box is created. This flag also indicates the state of the Read Only check box when the dialog box is closed.
&H10& | Causes the dialog box to display the Help button. If this option is specified, the parameter hParentWnd in the ShowFileDialog method must be set to null.

Values for ShowPrintDialog

Value

Description

&H10& | Sets or returns the state of the Collate check box.
&H80000& | Disables the Print to File check box.
&H100000& | The Print to File check box is not displayed.
&H80& | Prevents a warning message from being displayed when there is no default printer.
&H400& | Causes the ShowPrintDialog method to return the system default printer. The ShowPrintDialog method does this without displaying the dialog box.
&H40000& | If a printer driver does not support multiple copies, setting this flag disables the copies' edit control. If a driver does support multiple copies, setting this flag indicates that the dialog box should store the requested number of copies in the Copies property.

Remarks

The flags are bitwise and can be OR'd together.

These flags are defined in the Visual Basic CONSTANT.TXT file.

The Help button in the dialog box is not shown unless a Help file is specified by the HelpFile property.

See Also

HelpFile property

ShowFileDialog method


HelpCommand Property

Returns or sets the type of Help requested.

Applies To

Image Admin control

Syntax

object.HelpCommand[=value]

Data Type

Integer

Setting

Description

&H1& | Displays Help for a particular context. When using this setting, you must also specify a context using the HelpContext property.
&H3& | Displays the index of the specified Help file. An application should use this value only for a Help file with a single index.
&H4& | Displays Help for using the Help application itself.
&H5& | Sets the context specified by the HelpContext property as the current index for the Help file specified by the HelpFile property. This index remains current until the user accesses a different Help file. Use this value only for Help files with more than one index.
&H101& | Displays Help for a particular keyword. When using this setting, you must also specify a keyword using the HelpKey property.
&H105& | Brings up a search box in Help, with the key specified by the HelpKey property.

Remarks

Values for the HelpCommand property constants are defined in the VisualBasic CONSTANT.TXT file.

See Also

HelpContextId property

HelpKey property

HelpFile property

ShowFileDialog method


HelpContextId Property

Returns or sets a Help context Id.

Applies To

Image Admin control

Syntax

object.HelpContextId[=Value]

Data Type

Integer

Remarks

Context Ids are assigned to objects to provide context-sensitive Help to your application.

See Also

HelpCommand property

HelpKey property

HelpFile property

ShowFileDialog method


HelpKey Property

Returns or sets the keyword that identifies the requested Help topic.

Applies To

Image Admin control

Syntax

object.HelpKey[=keyword]

Data Type

String

Remarks

Use this property with the HelpCommand property to specify a Help topic to be displayed.

See Also

HelpContextId property

HelpCommand property

HelpFile property

ShowFileDialog method


HelpFile Property

Returns or sets the name of a Help file to be used with the application.

Applies To

Image Admin control

Syntax

object.HelpFile[=filename]

Data Type

String

See Also

HelpContextId property

HelpCommand property

HelpKey property

ShowFileDialog method


Image Property

Returns or sets the filename of the current image.

Applies To

Image Admin control

Syntax

object.Image[=filename]

Data Type

String

Remarks

When a new image is specified, the PageNumber property is set to 1.

This property is used by the following Image Admin control methods:

Append | DeletePages | Insert | VerifyImage
Replace | ShowFileDialog | ShowPrintDialog |

When the Image property changes, the following Admin control properties are updated:

CompressionInfo | ImageResolutionX | PageNumber
CompressionType | ImageResolutionY | PageType
FileType | ImageWidth |
ImageHeight | PageCount |

See Also

Image topics in Imaging Concepts


ImageHeight Property

Returns the height of the current page.

Applies To

Image Admin control

Syntax

object.ImageHeight[=value]

Data Type

Long

Remarks

The page is part of the current image file, as specified by the Image property.

Height is indicated in pixels.

This property is read-only.

See Also

PageNumber property

ImageWidth property

Image property


ImageResolutionX Property

Returns the horizontal resolution of the current page.

Applies To

Image Admin control

Syntax

object.ImageResolutionX[=value]

Data Type

Long

Remarks

The page is part of the current image file, as specified by the Image property.

Resolution is in dots-per-inch (dpi).

This property is read-only.

See Also

ImageResolutionY property

Image property

PageNumber property


ImageResolutionY Property

Returns the vertical resolution of the current page.

Applies To

Image Admin control

Syntax

object.ImageResolutionY[=value]

Data Type

Long

Remarks

The page is part of the current image file, as specified by the Image property.

Resolution is in dots-per-inch (dpi).

This property is read-only.

See Also

ImageResolutionX property

Image property

PageNumber property


ImageWidth Property

Returns the width of the current page.

Applies To

Image Admin control

Syntax

object.ImageWidth[=value]

Data Type

Long

Remarks

The page is part of the current image file, as specified by the Image property.

Width is indicated in pixels.

This property is read-only.

See Also

ImageHeight property

Image property

PageNumber property


InitDir Property

Returns or sets the initial directory displayed in the ShowFileDialog dialog box.

Applies To

Image Admin control

Syntax

object.InitDir[=directoryname]

Data Type

String

Remarks

If the specified directory is invalid, the current directory appears on the dialog box.

See Also

ShowFileDialog method


PageCount Property

Returns the number of pages in the image file.

Applies To

Image Admin control

Syntax

object.PageCount[=value]

Data Type

Long

Remarks

The image file is specified by the Image property.

The value is 0 (zero) if the image specified does not exist.

This property is read-only.

See Also

Image page in Imaging Concepts

Image property


PageNumber Property

Returns or sets a page number in the current image file.

Applies To

Image Admin control

Syntax

object.PageNumber

Data Type

Long

Remarks

This property is available only at run-time (read and write).

The image file is specified by the Image property.

If the image file is not multi-page, this value must be 1.

See Also

Image page in Imaging Concepts

Image property


PageType Property

Returns the image type of the specified page.

Applies To

Image Admin control

Syntax

object.PageType[=value]

Data Type

Integer (enumerated)

Setting

Description

0 | Unknown
1 | Black and white
2 | 4-bit gray scale
3 | 8-bit gray scale
4 | 4-bit palettized
5 | 8-bit palettized
6 | 24-bit RGB
7 | 24-bit BGR

Remarks

The Image file is specified by the Image property; the page is specified by the PageNumber property.

If the Image property is empty, the value is 0 (zero).

This property is read-only.

See Also

Image property

Image types in Imaging Concepts

PageNumber property


PrintAnnotations Property

Indicates if the Print Annotations check box in the Print dialog box is checked.

Applies To

Image Admin control

Syntax

object.PrintAnnotations[={True|False}]

Data Type

Boolean

Setting

Description

True (default) | The check box is checked, and annotations are to be printed.
False | The check box is not checked and annotations are not to be printed.

Remarks

This property sets the state of the check box that is displayed when the dialog box is first opened. The user can accept or change this setting.

The Print dialog box is created by the ShowPrintDialog method.

See Also

Annotation topics in Imaging Concepts

ShowPrintDialog method


PrintEndPage Property

Returns or sets the number of the last page to be printed.

Applies To

Image Admin control

Syntax

object.PrintEndPage

Data Type

Long

Remarks

The value set by this property is displayed when the Print dialog box is first opened. The user can then accept or change that value.

The default value is the value specified in the PageCount property.

The Print dialog box is created by the ShowPrintDialog method.

This property is available only at run-time (read and write).

See Also

Image page in Imaging Concepts

PrintStartPage property

ShowPrintDialog method


PrintNumCopies Property

Returns or sets the default number of copies for the Print Dialog box.

Applies To

Image Admin control

Syntax

object.PrintNumCopies[=value]

Data Type

Long

Remarks

The Print dialog box is created by the ShowPrintDialog method.

The value set by this property is displayed when the Print dialog box is first opened. The user can then accept or change that value.

The value entered by the user is returned by the ShowPrintDialog method.

See Also

ShowPrintDialog method


PrintOutputFormat Property

Returns or sets the format of the printer output.

Applies To

Image Admin control

Syntax

object.PrintOutputFormat[=value]

Data Type

Integer (enumerated)

Setting

Description

0 | Pixel-to-pixel
1 | Actual size
2 (default) | Fit to page

Remarks

The Print dialog box is created by the ShowPrintDialog method.

The value set by this property is displayed when the Print dialog box is first opened. The user can then accept or change that value.

See Also

ShowPrintDialog method


PrintRangeOption Property

Returns or sets the print range option for the Print dialog box.

Applies To

Image Admin control

Syntax

object.PrintRangeOption[=value]

Data Type

Integer (enumerated)

Setting

Description

0 (default) | All pages
1 | Range of pages
2 | Current page

Remarks

The value set by this property is displayed when the Print dialog box is first opened. The user can then accept or change that value.

If a value of 1 is set, the start and end pages are provided by the PrintStartPage and PrintEndPage properties.

The Print dialog box is created by the ShowPrintDialog method.

See Also

Image page in Imaging Concepts

PrintStartPage property

PrintEndPage property


PrintStartPage Property

Returns or sets the number of the first page to be printed for the Print dialog box.

Applies To

Image Admin control

Syntax

object.PrintStartPage

Data Type

Long

Remarks

The value set by this property is displayed when the Print dialog box is first opened. The user can then accept or change that value.

The Print dialog box is created by the ShowPrintDialog method.

The default value is 1.

This property is available only at run-time (read and write).

See Also

Image page in Imaging Concepts

PrintEndPage property

ShowPrintDialog method


PrintToFile Property

Indicates or sets if the Print to File check box in the Print dialog box is checked.

Applies To

Image Admin control

Syntax

object.PrintToFile[={True|False}]

Data Type

Boolean

Setting

Description

True | The check box is checked, and data is to be printed to a file.
False (default) | The check box is not checked, and data is not to be sent to a file.

Remarks

The Print dialog box is created by the ShowPrintDialog method.

This property sets the state of the check box that is displayed when the dialog box is first opened. The user can accept or change this setting.

The state of the check box is returned by the ShowPrintDialog method.


StatusCode Property

Returns a status code, which identifies the error that occurred when the last property was set or read, or the last method was invoked. A status code of 0 indicates that no error has occurred.

Applies To

Image Admin control, Image Annotation Tool Button control, Image Edit control, Image Scan control, Image Thumbnail control

Syntax

object.StatusCode

Data Type

Long

Remarks

The default value for this property is 0.

Available at run-time as read-only.


Methods

The Image Admin control uses the following Methods:

AboutBox | GetSysFileType
Append | GetUniqueName
CreateDirectory | Replace
Delete | SetSystemFileAttributes
DeletePages | ShowFileDialog
Insert | ShowPrintDialog
GetSysCompressionInfo | VerifyImage
GetSysCompressionType |


AboutBox Method

Displays an About dialog box that contains the version number of the control.

Applies To

Image Admin control, Image Annotation Tool Button control, Image Edit control, Image Scan control, Image Thumbnail control

Syntax

object.AboutBox

Arguments

None

Return Value

None


Append Method

Appends one or more pages to the current image.

Applies To

Image Admin control

Syntax

object.Append Source, SourcePage, NumPages [,CompressionType, CompressionInfo]

Arguments

Parameter

Data Type

Description

Source | String | Specifies the image file that contains the page(s) to be appended.
SourcePage | Long | Specifies the first page in the source image file to be appended.
NumPages | Long | Specifies the number of pages from the source image file to append to the current image file.
CompressionType | Integer | (Optional) Specifies the compression type to apply to the appended pages. If a type is not specified, the compression type of the source page(s) is used.
CompressionInfo | Long | (Optional) Specifies which compression options to apply to the appended pages. If options are not specified, the compression options of the source page(s) are used.

Remarks

The current image file is specified by the Image property.

The current image, if one exists, must be in either AWD or TIFF format, as these formats support multiple pages. If the image pages added are of another type, they will be converted to the file type format used by the current image.

You can append a single BMP file to a new file. If you do, the only compression type allowed is None, with no options.

If the CompressionType and CompressionInfo values specified are not compatible with a source page's page type (color), the source file's compression type and compression information are used in place of those arguments.

If JPEG compression type is specified, and the compression argument is 0 (zero), a default JPEG value is used. The default value is 4096 (low compression, high quality).

If the destination file is in AWD format, only black and white files without annotations may be appended.

The only allowable compression type for AWD is None, with no options.

See Also

Compression topics in Imaging Concepts

CompressionInfo property

CompressionType property


CreateDirectory Method

Creates a user-defined directory.

Applies To

Image Admin control

Syntax

object.CreateDirectory Path

Arguments

Parameter

Data Type

Description

Path

String

Specifies the path to be created.

Remarks

If the Path contains more than one subdirectory that does not exist, an error is returned.


Delete Method

Deletes a user-specified object.

Applies To

Image Admin control

Syntax

object.Delete Object

Arguments

Parameter

Data Type

Description

Object

String

Specifies the object to be deleted.

Remarks

The Object specified can be a filename or a path.

A file cannot be deleted if it is being used by any Wang Image application or OCX control.


DeletePages Method

Deletes a user-specified range of pages from the image file.

Applies To

Image Admin control

Syntax

object.DeletePages StartPage, NumPages

Arguments

Parameter

Data Type

Description

StartPage | Long | First page to be deleted.
NumPages | Long | Number of pages to be deleted, including StartPage.

Remarks

The image file is specified by the Image property.

Pages cannot be deleted if they are being used by any Wang Image application or OCX control.

If StartPage is within the image, and NumPages is greater than the number of pages in the image, all the pages after StartPage are deleted.

See Also

Image page in Imaging Concepts


Insert Method

Inserts one or more user-specified pages into the current image file.

Applies To

Image Admin control

Syntax

object.Insert Source, SourcePage, DestinationPage, NumPages [,CompressionType, CompressionInfo]

Arguments

Parameter

Data Type

Description

Source | String | Specifies the image file that contains the page(s) to be inserted.
SourcePage | Long | Specifies which page in the source image file will be inserted.
DestinationPage | Long | Specifies the page in the current image file the selected pages will be inserted before.
NumPages | Long | Specifies the number of pages from the source image file to insert into the current image file.
CompressionType | Integer | (Optional) Specifies the compression type to apply to the inserted pages. If a type is not specified, the compression type of the source image is used.
CompressionInfo | Long | (Optional) Specifies which compression options to apply to the inserted pages. If options are not specified, the compression options of the source image are used.

Remarks

The current image is specified by the Image property.

The current image must be in either AWD or TIFF format, because these formats support multiple pages. If the image pages added are of another type, they will be converted to the file type used by the current image.

You can insert a single BMP page into a new image.

If the CompressionType and CompressionInfo values specified are not compatible with a source page's page type, the source file's compression type and compression information is used in place of the arguments.

If JPEG compression is specified, and the compression argument is 0 (zero), a default JPEG value is used. The default value is 4096 (low compression, high quality).

If the destination file is in AWD format, only black and white files without annotations may be appended.

The only allowable compression type for AWD is None, with no options.

See Also

Compression topics in Imaging Concepts

CompressionInfo property

CompressionType property


GetSysCompressionInfo Method

Retrieves the system default compression information for a given page type.

Applies To

Image Admin control

Syntax

object.GetSysCompressionInfo(PageType)

Arguments

Parameter

Data Type

Description

PageType

Integer

Specifies a page type.

Setting | Description
0 | Unknown
1 | Black and white
2 | 4-bit gray scale
3 | 8-bit gray scale
4 | 4-bit palettized
5 | 8-bit palettized
6 | 24-bit RGB
7 | 24-bit BGR

Return Value

Long

Returns the following bitwise compression information:

Setting

Description

1 | EOL -- include or expect standard end of line bit sequences
2 | Packed lines -- data is not byte aligned
4 | Prefixed EOLs -- include or expect prefixed end of line bit sequences
8 | Compressed bit order, left to right
16 | Expanded bit order, left to right
32 | Negate -- reverses black and white on expansion
64 | High compression, high quality
128 | High compression, medium quality
256 | High compression, low quality
512 | Medium compression, high quality
1024 | Medium compression, medium quality
2048 | Medium compression, low quality
4096 | Low compression, high quality
8192 | Low compression, medium quality
16384 | Low compression, low quality

See Also

Compression topics in Imaging Concepts

Image types in Imaging Concepts

SetSystemFileAttributes method


GetSysCompressionType Method

Retrieves the system default compression type for a given page type.

Applies To

Image Admin control

Syntax

object.GetSystemCompressionType(PageType)

Arguments

Parameter

Data Type

Description

PageType

Integer

Specifies a page type.

Setting | Description
0 | Unknown
1 | Black and white
2 | 4-bit gray scale
3 | 8-bit gray scale
4 | 4-bit palettized
5 | 8-bit palettized
6 | 24-bit RGB
7 | 24-bit BGR

Return Value

Integer (enumerated)

Returns one of the following compression types:

Setting

Description

0 | Unknown
1 | No compression
2 | Group 3 1D FAX
3 | Group 3 Modified Huffman
4 | Packed Bits
5 | Group 4 2D FAX
6 | JPEG
7 | RBA
8 | Group 3 2D FAX
9 | LZW

See Also

Compression types in Imaging Concepts

SetSystemFileAttributes method

Image types in Imaging Concepts


GetSysFileType Method

Retrieves the system default file type for a given page type.

Applies To

Image Admin control

Syntax

object.GetSysFileType(PageType)

Arguments

Parameter

Data Type

Description

PageType

Integer

Specifies a page type.

Setting | Description
0 | Unknown
1 | Black and white
2 | 4-bit gray scale
3 | 8-bit gray scale
4 | 4-bit palettized
5 | 8-bit palettized
6 | 24-bit RGB
7 | 24-bit BGR

Return Value

Integer (enumerated)

One of the following file types is returned:

Setting

Description

0 | Unknown
1 | TIFF
2 | AWD
3 | Bitmap (BMP)

See Also

File types in Imaging Concepts

Image types in Imaging Concepts

SetSystemFileAttributes method


GetUniqueName Method

Generates a unique filename.

Applies To

Image Admin control

Syntax

object.GetUniqueName(Path, Template, Extension)

Arguments

Parameter

Data Type

Description

Path | String | The name of the existing path where the filename will be generated.
Template | String | The initial characters of the filename. Up to 4 characters can be used.
Extension | String | The extension to be used with the generated filename. Up to 3 characters can be used.

Return Value

A string that contains a fully-qualified filename.

Remarks

The filename is based on user-supplied path, template, and file extension information.


Replace Method

Replaces one or more user-specified pages into the current image file.

Applies To

Image Admin control

Syntax

object.Replace Source, SourcePage, DestinationPage, NumPages [,CompressionType, CompressionInfo]

Arguments

Parameter

Data Type

Description

Source | String | Specifies the image file that contains the page(s) to be inserted.
SourcePage | Long | Specifies the first page in the source image file that will be inserted.
DestinationPage | Long | Specifies the first page in the current image file that will be replaced.
NumPages | Long | Specifies the number of pages in the current image file to replace with pages from the source image file.
CompressionType | Integer | (Optional) Specifies the compression type to apply to the replaced pages. If a type is not specified, the compression type of the source image is used.
CompressionInfo | Long | (Optional) Specifies which compression options to apply to the replaced pages. If options are not specified, the compression options of the source page are used.

Remarks

The current image is specified by the Image property.

The replaced pages are converted to the file type of the current image (TIFF, AWD, or BMP).

If you are replacing the single page in a BMP file, the only compression type allowed is None, with no options.

If the CompressionType and CompressionInfo values specified are not compatible with a source page's page type, the source file's compression type and compression information is used in place of the arguments.

If JPEG compression is specified, and the compression argument is 0 (zero), a default JPEG value is used. The default value is 4096 (low compression, high quality).

If the destination file is in AWD format, only black and white files without annotations may be appended.

The only allowable compression type for AWD is None, with no options.

See Also

Compression topics in Imaging Concepts

CompressionInfo property

CompressionType property


SetSystemFileAttributes Method

Allows the user to set how image files will be saved for a given type.

Applies To

Image Admin control

Syntax

object.SetSystemFileAttributes PageType, FileType, CompressionType, CompressionInfo

Arguments

Parameter

Data Type

Description

PageType | Integer | Specifies a page type value.
FileType | Integer | Specifies a file type value.
CompressionType | Integer | Specifies compression information.
CompressionInfo | Long | Specifies compression information.

PageType argument

Setting

Description

0 | Unknown
1 | Black and white
2 | 4-bit gray scale
3 | 8-bit gray scale
4 | 4-bit palettized
5 | 8-bit palettized
6 | 24-bit RGB
7 | 24-bit BGR

FileType argument

Setting

Description

0 | Unknown
1 | TIFF
2 | AWD
3 | Bitmap (BMP)
4 | PCX
5 | DCX
6 | JPEG

CompressionType argument

Setting

Description

0 | Unknown
1 | No compression
2 | Group 3 1D FAX
3 | Group 3 Modified Huffman
4 | Packed Bits
5 | Group 4 2D FAX
6 | JPEG
7 | RBA
8 | Group 3 2D FAX
9 | LZW

CompressionInfo argument

Setting

Description

1 | EOL -- include or expect standard end of line bit sequences
2 | Packed lines -- data is not byte aligned
4 | Prefixed EOLs -- include or expect prefixed end of line bit sequences
8 | Compressed bit order, left to right
16 | Expanded bit order, left to right
32 | Negate -- reverses black and white on expansion
64 | High compression, high quality
128 | High compression, medium quality
256 | High compression, low quality
512 | Medium compression, high quality
1024 | Medium compression, medium quality
2048 | Medium compression, low quality
4096 | Low compression, high quality
8192 | Low compression, medium quality
16384 | Low compression, low quality

Remarks

These settings will be used when scanning files with the Image Scan control.

Defaults are set for a classification of the page type into one of three categories:

  • Black and White
  • Gray scale
  • Color

If a compression option of 0 (zero) is specified for a JPEG compression type, then a default value will be used (4096 -- low compression, high quality).

See Also

Compression topics in Imaging Concepts

File types in Imaging Concepts

Image types in Imaging Concepts

GetSysCompressionType method

GetSysFileType method

GetSysCompressionInfo method


ShowFileDialog Method

Allows a user to select a file specification from the file system displayed in an Open or Save As dialog box.

Applies To

Image Admin control

Syntax

object.ShowFileDialog DialogOption[,hParentWnd]

Arguments

Parameter

Data Type

Description

DialogOption | Integer | Indicates what type of file dialog box will be displayed: 0= Open or Select 1= Save As
hParentWnd | hWnd | (Optional) Assigns a parent window handle to the displayed dialog box.

Remarks

The file specification selected by the user from the dialog box is set in the Image property when the method returns the value.

If a help file is not specified in the HelpFile property, a Help button will not be shown. This is true even if the show help flag is set in the Flags property.

Dialog boxes are modal.

See Also

Flags property

HelpFile property

HelpContextId property

HelpCommand property

HelpKey property

Image property


ShowPrintDialog Method

Presents a printer dialog box from which the user sets various print options.

Applies To

Image Admin control

Syntax

object.ShowPrintDialog [hParentWnd]

Arguments

Parameter

Data Type

Description

hParentWnd

hWnd

(Optional) Assigns a parent window handle to the displayed dialog box.

Remarks

The image property must be set to an existing image or an error is returned.

This function returns any parameters set by the user to the application via the corresponding properties.

Dialog boxes are modal.

See Also

Flags property

PrintAnnotations property

PrintEndPage property

PrintNumCopies property

PrintOutputFormat property

PrintRangeOption property

PrintStartPage property

PrintToFile property

Image property


Wang Image Edit Control

The Wang Image Edit control adds imaging and image annotation functions to applications that support 32-bit OLE controls. It enables end users to display, annotate, manipulate, and manage image files.


Image Display

The Image Edit control allows end users to display image files of various types. Specifically, the control supports the following file types:

· AWD

· BMP

· DCX

· JPG

· PCX

· TIFF

· XIF


Image Annotation

The control includes several properties, methods, and events that enable programmers to add annotation functions to application programs. The annotation functions permit end users to annotate displayed images. The control also includes an Annotation Tool Palette that can be optionally invoked to provide end users with a complete set of annotation tools.

The 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
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


Image Manipulation

The Image Edit control has properties, methods, and events that enable programmers to add image manipulation functions to application programs. These functions permit end users to perform the following tasks on displayed images:

· Copy, cut, and paste to the Clipboard

· Flip

· Rotate

· Scale

· Scroll

· Zoom


File Management

The control also includes methods that enable programmers to add image and annotation file management functions to application programs. These functions permit end users to retrieve, save, print, and delete image and annotation data.


Linking With the Image Edit Control

The Image Edit control is the main Imaging control. The Wang Image Annotation Tool Button and Image Scan controls link to Image Edit control to perform several functions.


Image Annotation Tool Button Control

The Image Annotation Tool Button control links to the 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.


Image Scan Control

The Image Scan control links to the Image Edit control to display images while they are being scanned.


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.

To link the Image Scan control to the Image Edit control:

  1. Set the DestImageControl property of the Image Scan 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.


Properties

The Image Edit control uses the following Properties:

AnnotationBackColor | CompressionInfo | ImageScaleWidth
AnnotationFillColor | CompressionType | ImageWidth
AnnotationFillStyle | DisplayScaleAlgorithm | MouseIcon
AnnotationFont | Enabled | MousePointer
AnnotationFontColor | FileType | Page
AnnotationGroupCount | hWnd | PageCount
AnnotationImage | Image | PageType
AnnotationLineColor | ImageControl | ScrollBars
AnnotationLineStyle | ImageDisplayed | ScrollPositionX
AnnotationLineWidth | ImageHeight | ScrollPositionY
AnnotationStampText | ImageModified | ScrollShortcutsEnabled
AnnotationTextFile | ImagePalette | SelectionRectangle
AnnotationType | ImageResolutionX | StatusCode
AutoRefresh | ImageResolutionY | Zoom
BorderStyle | ImageScaleHeight |


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. 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).

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

Annotation topics in Imaging Concepts

AnnotationFontColor property

AnnotationType property

GetSelectedAnnotationBackColor method

SetSelectedAnnotationBackColor method


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. 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).

The default color is red (255, 0, 0).

See Also

Annotation topics in Imaging Concepts

AnnotationFontColor property

AnnotationType property

GetSelectedAnnotationFillColor method

SetSelectedAnnotationFillColor method


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

Annotation topics in Imaging Concepts

AnnotationType property

GetSelectedAnnotationFillStyle method

SetSelectedAnnotationFillStyle method


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

Annotation topics in Imaging Concepts

AnnotationType property

GetSelectedAnnotationFont method

SetSelectedAnnotationFont method


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. 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).

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

Annotation topics in Imaging Concepts

AnnotationBackColor property

AnnotationFillColor property

AnnotationType property

GetSelectedAnnotationFontColor method

SetSelectedAnnotationFontColor method


AnnotationGroupCount Property

Returns the number of annotation groups that are on an image page.

Applies To

Image Edit control

Syntax

object.AnnotationGroupCount

Data Type

Integer

Remarks

The AnnotationGroupCount is used as the upper bound value when indexing through all of the annotation groups.

When a new annotation group is created, the AnnotationGroupCount is not incremented until at least one annotation mark is added to the group.

Available at run-time as read-only.

The Display method must be invoked prior to reading this property.

See Also

Annotation topics in Imaging Concepts

Display method

GetAnnotationGroup method

GetAnnotationMarkCount method

SetCurrentAnnotationGroup method

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. 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

Annotation topics in Imaging Concepts

AnnotationType property

Display method

GetSelectedAnnotationImage method

Image topics in Imaging Concepts

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. 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).

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

Annotation topics in Imaging Concepts

AnnotationType property

GetSelectedAnnotationLineColor method

SetSelectedAnnotationLineColor method


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

Annotation topics in Imaging Concepts

AnnotationLineWidth property

AnnotationType property

GetSelectedAnnotationLineStyle method

SetSelectedAnnotationLineStyle method


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

Annotation topics in Imaging Concepts

AnnotationLineStyle property

AnnotationType property

GetSelectedAnnotationLineWidth method

SetSelectedAnnotationLineWidth method


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:

The end user releases the left mouse button on a displayed image

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

  • 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

  • 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

    Annotation topics in Imaging Concepts

    AnnotationType property

    Draw method


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. A file extension is required for all files.

The AnnotationTextFile property is used with the Text From File annotation type.

See Also

Annotation topics in Imaging Concepts

AnnotationType property


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

Annotation topics in Imaging Concepts

AnnotationImage property

AnnotationStampText property

AnnotationTextFile property

Draw method

SelectTool method (Image Edit control)

ShowAnnotationToolPalette method (Image Edit control)


AutoRefresh Property

Returns or sets whether a displayed image is refreshed immediately after changes are made to properties that can affect its visual appearance.

Applies To

Image Edit control

Syntax

object.AutoRefresh[={True|False}]

Data Type

Boolean

Setting

Description

True | Refreshes the image immediately when changes are made to display-related properties
False (default) | The image is not refreshed immediately

Remarks

Set this property to True when you want the image to be refreshed every time a property is changed that affects its visual display.

Set this property to False when you do not want the image to be refreshed every time a property is changed that affects its visual display. The image can be refreshed at any time by invoking the Refresh method, which updates the image using the current settings.

When the AutoRefresh property is set to True, changing the following properties causes the displayed image to be refreshed automatically:

DisplayScaleAlgorithm property

ImagePalette property

ImageResolutionX property

ImageResolutionY property

ScrollBars property

ScrollPositionX property

ScrollPositionY property

Zoom property

See Also

Refresh method


BorderStyle Property

Returns or sets whether the control is displayed with a border.

Applies To

Image Edit control

Syntax

object.BorderStyle[=value]

Data Type

Integer (enumerated)

Setting

Description

0 | None
1 (default) | Fixed Single

Remarks

Single-line, fixed-size is the only available border style.

Available at design-time only.


CompressionInfo Property

Returns compression option information for the image specified in the Image property, and the page specified in the Page property.

Applies To

Image Edit control

Syntax

object.CompressionInfo

Data Type

Long

Property settings are expressed using the following bit-wise values:

Setting

Description

Notes

0 | No compression options set. | Applicable only to uncompressed image files
1 | EOL -- Include/expect End Of Line. Each line is terminated with a standard end-of-line bit. | Not used for JPEG compression
2 | Packed Lines -- Byte-align new lines. | Not used for JPEG compression
4 | Prefixed EOL -- Include/expect, prefixed End Of Line. Each strip of data is prefixed by a standard end-of-line bit sequence. | Not used for JPEG compression
8 | Compressed LTR -- Compressed bit order, Left-To-Right. The bit order for the compressed data is the most significant bit to the least significant bit. | Not used for JPEG compression
16 | Expand LTR -- Expanded bit order, Left-To-Right. The bit order for the expanded data is the most significant bit to the least significant bit. | Not used for JPEG compression
32 | Negate -- Invert black and white on expansion. Indicates the setting of the Photometric Interpretation field of a TIFF file. | Not used for JPEG compression
64 | High Compression/High Quality | Used for JPEG compression only
128 | High Compression/Medium Quality | Used for JPEG compression only
256 | High Compression/Low Quality | Used for JPEG compression only
512 | Medium Compression/High Quality | Used for JPEG compression only
1024 | Medium Compression/Medium Quality | Used for JPEG compression only
2048 | Medium Compression/Low Quality | Used for JPEG compression only
4096 | Low Compression/High Quality | Used for JPEG compression only
8192 | Low Compression/Medium Quality | Used for JPEG compression only
16384 | Low Compression/Low Quality | Used for JPEG compression only

Remarks

Image files with compression types other than JPEG can have CompressionInfo values between 1 and 63, in any combination. Image files with the JPEG compression type can have only one specific value between 64 and 16384 (as indicated in the preceding list).

The CompressionInfo value is independent of an image being displayed. If the image specified in the Image and Page properties is being displayed, the value indicates the compression of the displayed image. If the image specified in the Image and Page properties is not being displayed, the value indicates the compression of the image specified in the Image property.

Available at run-time as read-only.

See Also

Compression topics in Imaging Concepts

CompressionType property

Image property

Page property

SaveAs method


CompressionType Property

Returns the compression type of the image specified in the Image property, and the page specified in the Page property.

Applies To

Image Edit control

Syntax

object.CompressionType

Data Type

Integer (enumerated)

Property settings are expressed using the following values:

Setting

Description

0 | Unknown
1 | No compression
2 | Group3(1D)
3 | Group3(Modified Huffman)
4 | PackBits
5 | Group4(2D)
6 | JPEG
7 | RBA
8 | Group3(2D)
9 | LZW

Remarks

The CompressionType value is independent of an image being displayed. If the image specified in the Image and Page properties is being displayed, the value indicates the compression type of the displayed image. If the image specified in the Image and Page properties is not being displayed, the value indicates the compression type of the image specified in the Image property.

Available at run-time as read-only.

See Also

Compression topics in Imaging Concepts

CompressionInfo property

Image property

Page property

SaveAs method


DisplayScaleAlgorithm Property

Returns or sets the scaling algorithm used when displaying images.

Applies To

Image Edit control

Syntax

object.DisplayScaleAlgorithm[=integer]

Data Type

Integer (enumerated)

Property settings are expressed using the following values:

Setting

Description

Notes

0 (default) | Normal | Normal decimation
1 | Gray4 | 4-bit gray-scale, 16 shades of gray
2 | Gray8 | 8-bit gray-scale, 256 shades of gray
3 | Stamp | Used for thumbnail representation of images
4 | Optimize | Changes the display algorithm based on the image type of the displayed image

Remarks

The DisplayScaleAlgorithm value can be specified before or after an image is displayed. If the value is specified after an image is displayed, the displayed image may change visually.

When the AutoRefresh property is set to True, changing the DisplayScaleAlgorithm property causes the displayed image to be refreshed automatically. Some settings may not be apparent until the image is scaled to a Zoom value under 100 percent.

See Also

AutoRefresh property

Display topics in Imaging Concepts

Image property

Zoom property


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)


FileType Property

Returns the file type of the image file specified in the Image property, and the page specified in the Page property.

Applies To

Image Edit control

Syntax

object.FileType

Data Type

Integer (enumerated)

Property settings are expressed using the following values:

Setting

Description

1 | TIFF
2 | AWD
3 | BMP
4 | PCX
5 | DCX
6 | JPG
7 | XIF

Remarks

The FileType value is independent of an image being displayed. If the image specified in the Image and Page properties is being displayed, the value indicates the file type of the displayed image. If the image specified in the Image and Page properties is not being displayed, the value indicates the file type of the image specified in the Image property.

Available at run-time as read-only.

See Also

Image property

Image topics in Imaging Concepts

Page property

SaveAs method


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.


Image Property

Returns the fully-qualified filename of an image file being displayed, or sets the fully-qualified filename of an image file to be displayed or otherwise operated on by the Image Edit control.

Applies To

Image Edit control

Syntax

object.Image[=filename]

Data Type

String

Remarks

The name must be a fully-qualified filename.

See Also

Display method

Image topics in Imaging Concepts


ImageControl Property

Returns or sets the unique identifier to be specified for linking with another Imaging control. The Wang Image Annotation Tool Button and Image Scan controls link to the Image Edit control in order to perform several functions.

Applies To

Image Edit control

Syntax

object.ImageControl[=controlname]

Data Type

String

Remarks

A unique default name is provided when you draw the control on a form.

See Also

DestImageControl property (Image Annotation Tool Button control)

DestImageControl property (Image Scan control)

Image Annotation Tool Button control

Image Scan control

Image topics in Imaging Concepts


ImageDisplayed Property

Indicates whether an image is currently being displayed.

Applies To

Image Edit control

Syntax

object.ImageDisplayed

Data Type

Boolean

Setting

Description

True | An image is being displayed
False | An image is not being displayed

Remarks

Available at run-time as read-only.

See Also

Display method

Image topics in Imaging Concepts


ImageHeight Property

Returns the height in full-size coordinates of the image being displayed.

Applies To

Image Edit control

Syntax

object.ImageHeight

Data Type

Long

Remarks

If an image is not being displayed, the ImageHeight property returns the full-size height of the image specified in the Image property.

If an image is not being displayed and the Image property does not contain the filename of an image, the ImageHeight property generates an error.

Available at run-time as read-only.

See Also

Image property

Image topics in Imaging Concepts

ImageScaleHeight property

ImageWidth property


ImageModified Property

Indicates whether an image has been modified.

Applies To

Image Edit control

Syntax

object.ImageModified

Data Type

Boolean

Setting

Description

True | The image has been modified
False | The image has not been modified

Remarks

Because the value of this property indicates whether an image file has been modified, you can use it to determine whether your program should prompt the end user to save the image file.

Available at run-time as read-only.

Changes to the following properties set the ImageModified property to True:

· ImageResolutionX property

· ImageResolutionY property

Invoking the following methods sets the ImageModifed property to True:

· AddAnnotationGroup method

· BurnInAnnotations method

· ClipboardCut method

· ClipboardPaste method

· ConvertPageType method

· DeleteAnnotationGroup method

· DeleteImageData method

· DeleteSelectedAnnotations method

· Draw method

· EditSelectedAnnotationText method

· Flip method

· HideAnnotationGroup method

· RotateLeft method

· RotateRight method

· SetSelectedAnnotationBackColor method

· SetSelectedAnnotationFillColor method

· SetSelectedAnnotationFillStyle method

· SetSelectedAnnotationFont method

· SetSelectedAnnotationFontColor method

· SetSelectedAnnotationLineColor method

· SetSelectedAnnotationLineStyle method

· SetSelectedAnnotationLineWidth method

· ShowAnnotationGroup method

Drawing an annotation using the standard Annotation Tool Palette sets the ImageModifed property to True.

See Also

Close event

Image topics in Imaging Concepts

Save method

SaveAs method


ImagePalette Property

Returns or sets the palette to use when displaying an image.

Applies To

Image Edit control

Syntax

object.ImagePalette[=value ]

Data Type

Integer (enumerated)

Property settings are expressed using the following values:

Setting

Description

Notes

0 (default) | Custom | Selects a custom palette
1 | Common | Selects the common palette
2 | Gray8 | Selects the 8-bit gray-scale, 256 shades-of-gray palette
3 | RGB24 | Selects the 24-bit, millions-of-colors palette
4 | Black-and-white | Selects the black-and-white palette

Remarks

The ImagePalette value can be specified before or after an image is displayed. If the value is specified after an image is displayed, the displayed image may change visually.

When the AutoRefresh property is set to True, changing the ImagePalette property causes the displayed image to be refreshed automatically.

See Also

AutoRefresh property

Image topics in Imaging Concepts

Palette topics in Imaging Concepts

SetImagePalette method


ImageResolutionX Property

Returns or sets the horizontal resolution of the image being displayed.

Applies To

Image Edit control

Syntax

object.ImageResolutionX[=integer ]

Data Type

Long

Remarks

When the AutoRefresh property is set to True, changing the ImageResolutionX property causes the displayed image to be refreshed automatically.

If an image is not being displayed, the ImageResolutionX property returns or sets the horizontal resolution of the image specified in the Image property.

If an image is not being displayed and the Image property does not contain the filename of an image, the ImageResolutionX property generates an error.

Available at run-time as read-and-write.

See Also

AutoRefresh property

Image property

Image topics in Imaging Concepts

ImageResolutionY property


ImageResolutionY Property

Returns or sets the vertical resolution of the image being displayed.

Applies To

Image Edit control

Syntax

object.ImageResolutionY[=integer ]

Data Type

Long

Remarks

When the AutoRefresh property is set to True, changing the ImageResolutionY property causes the displayed image to be refreshed automatically.

If an image is not being displayed, the ImageResolutionY property returns or sets the vertical resolution of the image specified in the Image property.

If an image is not being displayed and the Image property does not contain the filename of an image, the ImageResolutionY property generates an error.

Available at run-time as read-and-write.

See Also

AutoRefresh property

Image property

Image topics in Imaging Concepts

ImageResolutionX property


ImageScaleHeight Property

Returns the height in pixels of the image as it is displayed.

Applies To

Image Edit control

Syntax

object.ImageScaleHeight

Data Type

OLE_YSIZE_PIXELS

Remarks

The Display method must be invoked prior to using this property.

The ImageScaleHeight property differs from the ImageHeight property. The ImageHeight property returns the height in full-size coordinates, while the ImageScaleHeight property value is affected by the current zoom factor.

The ImageScaleHeight and ImageHeight properties also differ for images with asymmetric resolutions. For example, when an 8½- by 11-inch image with a resolution of 200 by 100 dots per inch (dpi) is displayed, the ImageHeight property returns a value of 1100, while the ImageScaleHeight property returns a value of 2200 due to pixel replication that occurs at display-time to optimize display quality.

Available at run-time as read-only.

See Also

Display method

Image property

Image topics in Imaging Concepts

ImageHeight property

ImageResolutionX property

ImageResolutionY property

ImageScaleWidth property

Zoom property


ImageScaleWidth Property

Returns the width in pixels of the image as it is displayed.

Applies To

Image Edit control

Syntax

object.ImageScaleWidth

Data Type

OLE_XSIZE_PIXELS

Remarks

The Display method must be invoked prior to using this property.

The ImageScaleWidth property differs from the ImageWidth property. The ImageWidth property returns the width in full-size coordinates, while the ImageScaleWidth property value is affected by the current zoom factor.

The ImageScaleWidth and ImageWidth properties also differ for images with asymmetric resolutions. For example, when an 8½- by 11-inch image with a resolution of 100 by 200 dots per inch (dpi) is displayed, the ImageWidth property returns a value of 850, while the ImageScaleWidth property returns a value of 1700 due to pixel replication that occurs at display-time to optimize display quality.

Available at run-time as read-only.

See Also

Display method

Image property

Image topics in Imaging Concepts

ImageResolutionX property

ImageResolutionY property

ImageScaleHeight property

ImageWidth property

Zoom property


ImageWidth Property

Returns the width in full-size coordinates of the image being displayed.

Applies To

Image Edit control

Syntax

object.ImageWidth

Data Type

Long

Remarks

If an image is not being displayed, the ImageWidth property returns the full-size width of the image specified in the Image property.

If an image is not being displayed and the Image property does not contain the filename of an image, the ImageWidth property generates an error.

Available at run-time as read-only.

See Also

Image property

Image topics in Imaging Concepts

ImageHeight property

ImageScaleWidth property


MouseIcon Property

Returns or sets the mouse icon to be displayed when the mouse pointer is moved over an Image Edit control.

Applies To

Image Edit control

Syntax

object.MouseIcon=LoadPicture(pathname)

Data Type

String

The pathname is a string expression specifying the path and filename of the file containing the custom icon (.CUR or .ICO files).

Remarks

The MouseIcon property provides a custom icon that is used when the MousePointer property is set to 99.

See Also

MousePointer property


MousePointer Property

Returns or sets the type of mouse pointer to be displayed when the pointer is moved over an Image Edit control at run-time.

Applies To

Image Edit control

Syntax

object.MousePointer[=integer]

Data Type

Integer (enumerated)

Setting

Description

0 (Default) | As determined by the value of the AnnotationType property
1 | Arrow
2 | Cross (cross-hair pointer)
3 | I-Beam
4 | Arrow
5 | Size (four-pointed arrow pointing North, South, East, and West)
6 | Size NE SW (double arrow pointing NorthEast and SouthWest)
7 | Size N S (double arrow pointing North and South)
8 | Size NW SE (double arrow pointing NorthWest and SouthEast)
9 | Size W E (double arrow pointing West and East)
10 | Up Arrow
11 | Hourglass (wait)
12 | No Drop
13 | Arrow and Hourglass
14 | Arrow and Question mark
15 | Size All
16 | Freehand Line
17 | Hollow Rectangle
18 | Filled Rectangle
19 | Text Stamp
20 | Text
21 | Text From File
22 | Attach-a-Note
23 | Hand
24 | Image Selection
99 | Custom pointer specified by the MouseIcon property.

Remarks

The MouseIcon property must be set prior to setting the MousePointer property to 99.

Use this property to indicate changes in functionality as the mouse pointer passes over controls on a form or dialog box. Use the Hourglass setting (11) to indicate that the end user should wait for a process or operation to finish.

See Also

AnnotationType property

MouseIcon property


Page Property

Returns the page number of an image file where an action was performed, or sets the page number of an image file where an action is to be performed.

Applies To

Image Edit control

Syntax

object.Page[=integer]

Data Type

Long

Remarks

The default value for this property is 1. This property is typically used to specify the page to be displayed by the Display method.

See Also

Display method

Image Page topic in Imaging Concepts

PageCount property


PageCount Property

Returns the total number of pages in the image file that is currently being displayed.

Applies To

Image Edit control

Syntax

object.PageCount

Data Type

Long

Remarks

If an image is not being displayed, the PageCount property returns the total number of pages in the image file specified in the Image property.

If an image is not being displayed and the Image property does not contain the filename of an image, the PageCount property generates an error.

Available at run-time as read-only.

See Also

Image Page topic in Imaging Concepts

Image property

Page property


PageType Property

Returns the image type of the image specified in the Image property and the page specified in the Page property.

Applies To

Image Edit control

Syntax

object.PageType

Data Type

Integer (enumerated)

Property settings are expressed using the following values:

Setting

Description

1 | Black-and-white
2 | Gray4
3 | Gray8
4 | Palettized4
5 | Palettized8
6 | RGB24
7 | BGR24

Remarks

The PageType property value is independent of an image being displayed. If the image page specified in the Page property is being displayed, the value is the image type of the displayed image. If the image page specified in the Image and Page properties is not being displayed, the value is the image type of the page specified in the Image and Page properties.

Available at run-time as read-only.

See Also

ConvertPageType method

Image Page topic in Imaging Concepts

Page property

SaveAs method


ScrollBars Property

Returns or sets whether a displayed image contains horizontal and/or vertical scroll bars.

Applies To

Image Edit control

Syntax

object.ScrollBars[={True|False}]

Data Type

Boolean

Setting

Description

True (default) | Horizontal and/or vertical scroll bars are displayed
False | No scroll bars are displayed

Remarks

If this property is set to True, horizontal and/or vertical scroll bars are displayed only when the image extends beyond the object's borders.

If the image has scroll bars and the ScrollShortcutsEnabled property is set to True, accelerator keys are provided to permit the end user to scroll an image using the keyboard.

When the AutoRefresh property is set to True, changing the ScrollBars property causes the displayed image to be refreshed automatically.

See Also

AutoRefresh property

Image topics in Imaging Concepts

Scroll event

ScrollImage method

ScrollShortcutsEnabled property

ScrollPositionX property

ScrollPositionY property


ScrollPositionX Property

Returns or sets the horizontal scroll position in pixels.

Applies To

Image Edit control

Syntax

object.ScrollPositionX[=integer]

Data Type

Long

Remarks

Setting the ScrollPositionX property causes the displayed image to scroll horizontally to the pixel position specified.

To set the scroll position prior to displaying an image, the ScrollPositionX and ScrollPositionY properties must be set in the Load event.

When the image is first displayed using the Display method, this property is set to 0 by default.

When the AutoRefresh property is set to True, changing the ScrollPositionX property causes the displayed image to be refreshed automatically.

Available at run-time as read-and-write.

See Also

AutoRefresh property

Display method

Image topics in Imaging Concepts

Load event

Scroll event

ScrollBars property

ScrollImage method

ScrollPositionY property


ScrollPositionY Property

Returns or sets the vertical scroll position in pixels.

Applies To

Image Edit control

Syntax

object.ScrollPositionY[=integer ]

Data Type

Long

Remarks

Setting the ScrollPositionY property causes the displayed image to scroll vertically to the pixel position specified.

To set the scroll position prior to displaying an image, the ScrollPositionX and ScrollPositionY properties must be set in the Load event.

When the image is first displayed using the Display method, this property is set to 0 by default.

When the AutoRefresh property is set to True, changing the ScrollPositionY property causes the displayed image to be refreshed automatically.

Available at run-time as read-and-write.

See Also

AutoRefresh property

Display method

Image topics in Imaging Concepts

Load event

Scroll event

ScrollBars property

ScrollImage method

ScrollPositionX property


ScrollShortcutsEnabled Property

Returns or sets whether the object recognizes a set of accelerator keys for scrolling a displayed image provided horizontal and/or vertical scroll bars are present.

Applies To

Image Edit control

Syntax

object.ScrollShortcutsEnabled[={True|False}]

Data Type

Boolean

Setting

Description

True (default) | Accelerator keys can be used to scroll an image
False | Accelerator keys cannot be used

Remarks

If this property and the ScrollBars property are set to True, and the image extends beyond the object's borders, the end user can use accelerator keys to scroll the displayed image.

Under certain circumstances, it may be necessary to set the focus to the Image Edit control for the accelerator keys to function.

The following accelerator keys provide scrolling capabilities:

Accelerator Key

Description

Page Down | Scrolls the image downward by one full screen
Page Up | Scrolls the image upward by one full screen
Ctrl + Page Down | Scrolls the image to the right by one full screen
Ctrl + Page Up | Scrolls the image to the left by one full screen
Right Arrow | Scrolls the image to the right by 4 pixels
Left Arrow | Scrolls the image to the left by 4 pixels
Up Arrow | Scrolls the image upward by 4 pixels
Down Arrow | Scrolls the image downward by 4 pixels

See Also

Image topics in Imaging Concepts

Scroll event

ScrollBars property

ScrollImage method


SelectionRectangle Property

Indicates whether a selection box will be drawn when the end user clicks the left mouse button and drags the mouse pointer over a displayed image.

Applies To

Image Edit control

Syntax

object.SelectionRectangle[=boolean]

Data Type

Boolean

Setting

Description

True (default) | Selection box drawing is enabled
False | Selection box drawing is not enabled

Remarks

Once the end user draws a selection box, cutting and copying to the Clipboard can be accomplished.

See Also

ClipboardCopy method

ClipboardCut method

SelectionRectDrawn event

ZoomToSelection method


Zoom Property

Returns or sets the zoom factor for an image.

Applies To

Image Edit control

Syntax

object.Zoom[=value]

Data Type

Single

Remarks

The Zoom value is expressed as a percentage. The valid range is from 2 to 6500 percent; the default value is 100 percent.

When invoked, the FitTo and ZoomToSelection methods update the value of the Zoom property.

A Zoom value can be specified before or after an image is displayed. If the image currently specified in the Image property is being displayed when the Zoom value is changed, the displayed image may change visually.

When the AutoRefresh property is set to True, changing the Zoom property causes the displayed image to be refreshed automatically.

See Also

AutoRefresh property

Display topics in Imaging Concepts

FitTo method

Image property

ZoomToSelection method


Methods

The Image Edit control uses the following Methods:

AboutBox | GetAnnotationMarkCount | ScrollImage
AddAnnotationGroup | GetCurrentAnnotationGroup | SelectAnnotationGroup
BurnInAnnotations | GetSelectedAnnotationBackColor | SelectTool
ClearDisplay | GetSelectedAnnotationFillColor | SetCurrentAnnotationGroup
ClipboardCopy | GetSelectedAnnotationFillStyle | SetImagePalette
ClipboardCut | GetSelectedAnnotationFont | SetSelectedAnnotationBackColor
ClipboardPaste | GetSelectedAnnotationFontColor | SetSelectedAnnotationFillColor
CompletePaste | GetSelectedAnnotationImage | SetSelectedAnnotationFillStyle
ConvertPageType | GetSelectedAnnotationLineColor | SetSelectedAnnotationFont
DeleteAnnotationGroup | GetSelectedAnnotationLineStyle | SetSelectedAnnotationFontColor
DeleteImageData | GetSelectedAnnotationLineWidth | SetSelectedAnnotationLineColor
DeleteSelectedAnnotations | HideAnnotationGroup | SetSelectedAnnotationLineStyle
Display | HideAnnotationToolPalette | SetSelectedAnnotationLineWidth
DisplayBlankImage | IsClipboardDataAvailable | ShowAnnotationGroup
Draw | PrintImage | ShowAnnotationToolPalette
DrawSelectionRect | Refresh | ShowAttribsDialog
EditSelectedAnnotationText | RotateLeft | ShowRubberStampDialog
FitTo | RotateRight | ZoomToSelection
Flip | Save |
GetAnnotationGroup | SaveAs |


AddAnnotationGroup Method

Adds a new annotation group to an image page.

Applies To

Image Edit control

Syntax

object.AddAnnotationGroup GroupName

Argument

Parameter

Data Type

Setting

GroupName

String

The name of the new annotation group

Return Value

None

Remarks

The Display method must be invoked prior to calling this method.

The annotation group is not actually created until the first annotation mark is placed on the image.

See Also

Annotation topics in Imaging Concepts

DeleteAnnotationGroup method

Display method

Image topics in Imaging Concepts


BurnInAnnotations Method

Burns annotations onto an image, causing them to be permanently incorporated into the image. Use this method with caution because once annotations are burned-in, they can no longer be removed or modified.

Applies To

Image Edit control

Syntax

object.BurnInAnnotations Option,MarkOption[,GroupName]

Arguments

Parameter

Data Type

Setting

Description

Option | Integer (enumerated) | 0 | All annotations marks, invisible and visible, are saved to the base image
 |  | 1 | All annotations that are visible are saved to the base image
 |  | 2 | All annotations that are selected are saved to the base image
MarkOption (Refer to the Notes section following this list for more information.) | Integer (enumerated) | 0 | Changes annotations to black (on black-and-white images only)
 |  | 1 | Changes annotations to white (on black-and-white images only)
 |  | 2 | Default rendering -- Does not change the colors of annotations for non-bilevel images (for example, color and gray-scale images)
GroupName | String | Name | The name of the group that contains the annotations (if specified, the Option parameter is ignored)

Notes Regarding the Use of the MarkOption Parameter

MarkOption Set to 0

For black-and-white image types, the BurnInAnnotations method with a MarkOption of 0 changes annotations to black.

MarkOption Set to 1

For black-and-white image types, the BurnInAnnotations method with a MarkOption of 1 changes annotations to white.

MarkOption Set to 2

For black-and-white image types, the BurnInAnnotations method with a MarkOption of 2 changes annotations to black, white, or black-and-white dither patterns based on the type of annotation mark, its color, and its transparency setting. Refer to the following list:

Annotation Type

MarkOption2 Burn-In Format

Attach-a-Note | Burned-in as a black or white rectangle based on the original background color, with text burned-in as black or white based on the original color of the font. Light colors, like yellow, are burned-in as white; dark colors, like red, are burned-in as black. The underlying image data is obscured.
Freehand Line, Hollow Rectangle, Straight Line, Text, Text From File, and Text Stamp | Burned-in as black or white based on the original color of the annotation. Light colors, like yellow, are burned-in as white; dark colors, like red, are burned-in as black.
Filled Rectangle | Burned-in as black-and-white dithered rectangles. The underlying image data is obscured.
Highlighter | Burned-in as black-and-white transparent dithered rectangles. The underlying image data is visible.
Image Embedded and Image Reference | Burned-in as a black-and-white representation of the original image.

For all other image types, the BurnInAnnotations method with a MarkOption of 2 burns annotations onto the image using the displayed colors. Then it converts the image to a 24-bit color image (BGR24 or RGB24). Because 24-bit color images require a large amount of memory and disk space, use caution when selecting this option. To minimize the memory and disk space requirements of 24-bit color images, you can use the SaveAs method to save the 24-bit color images as 8-bit Palettized images.

To save color annotations on a black-and-white image, use the ConvertPageType method to convert the image to a page type other than black-and-white. Then invoke the BurnInAnnotations method with a Mark Option of 2; the BurnInAnnotations method burns the annotations onto the image in color.

Return Value

None

Remarks

After invoking the BurnInAnnotations method, the Save or SaveAs method must be invoked to save the combined image and annotation.

When a GroupName is specified, the Option parameter is ignored and all annotation marks in the specified GroupName are burned-in.

See Also

Annotation topics in Imaging Concepts

ConvertPageType method

Display method

Image topics in Imaging Concepts

Save method

SaveAs method


ClearDisplay Method

Clears a displayed image in the control.

Applies To

Image Edit control

Syntax

object.ClearDisplay

Arguments

None

Return Value

None

Remarks

An image must be displayed before the ClearDisplay method can be invoked.

The ClearDisplay method does not save any changes that may have been made to an existing image, nor does it change the value of the Image property. It does, however, trigger the Close event.

See Also

Close event

Display topics in Imaging Concepts

Image property


ClipboardCopy Method

Copies the selected or specified portion of an image or annotation to the Clipboard.

Applies To

Image Edit control

Syntax

object.ClipboardCopy [Left,Top,Width,Height]

Arguments

Parameter

Data Type

Setting

Left | Long | The upper-left corner of the selection rectangle in pixel coordinates of the displayed image
Top | Long | The top of the selection rectangle in pixel coordinates of the displayed image
Width | Long | The width of the selection rectangle in pixels
Height | Long | The height of the selection rectangle in pixels

Return Value

None

Remarks

If the ClipboardCopy method is invoked without parameters after an end user draws a selection rectangle, the image data bounded by the selection rectangle is copied to the Clipboard.

If the ClipboardCopy method is invoked without parameters and without an end user drawing a selection rectangle, the ClipboardCopy method generates an error.

To copy annotations to the Clipboard, the end user selects the desired annotation marks using the Select Annotations tool.

To copy image data to the Clipboard, the end user selects the desired area using the image selection rectangle, which is the default when no annotation tool is selected.

It is not possible to copy both image and annotation data to the Clipboard simultaneously.

See Also

ClipboardCut method

ClipboardPaste method

Display topics in Imaging Concepts

DrawSelectionRect method

SelectionRectangle property

SelectionRectDrawn event


ClipboardCut Method

Copies the selected or specified portion of an image or annotation to the Clipboard and then clears (cuts) the portion from the image or annotation.

Applies To

Image Edit control

Syntax

object.ClipboardCut [Left,Top,Width,Height]

Arguments

Parameter

Data Type

Setting

Left | Long | The upper-left corner of the selection rectangle in pixel coordinates of the displayed image
Top | Long | The top of the selection rectangle in pixel coordinates of the displayed image
Width | Long | The width of the selection rectangle in pixels
Height | Long | The height of the selection rectangle in pixels

Return Value

None

Remarks

If the ClipboardCut method is invoked without parameters after an end user draws a selection rectangle, the image data bounded by the selection rectangle is copied to the Clipboard and cleared from the image.

If the ClipboardCut method is invoked without parameters and without an end user drawing a selection rectangle, the ClipboardCut method generates an error.

To cut annotations to the Clipboard, the end user selects the desired annotation marks using the Select Annotations tool.

To cut image data to the Clipboard, the end user selects the desired area using the image selection rectangle, which is the default when no annotation tool is selected.

It is not possible to cut both image and annotation data to the Clipboard simultaneously.

See Also

ClipboardCopy method

ClipboardPaste method

Display topics in Imaging Concepts

DrawSelectionRect method

SelectionRectangle property

SelectionRectDrawn event


ClipboardPaste Method

Pastes image or annotation data from the Clipboard.

Applies To

Image Edit control

Syntax

object.ClipboardPaste [Left,Top]

Arguments

Parameter

Data Type

Setting

Left | Long | The left point of the displayed image in pixels
Top | Long | The top point of the displayed image in pixels

Return Value

None

Remarks

To determine if data is available for pasting from the Clipboard, invoke the IsClipboardDataAvailable method.

If the Left and Top parameters are not entered, the data is pasted at the left-top point of the displayed image.

See Also

ClipboardCopy method

ClipboardCut method

CompletePaste method

Display topics in Imaging Concepts

IsClipboardDataAvailable method

PasteCompleted event


CompletePaste Method

Completes a Clipboard paste operation, making the pasted image or annotation data part of the original image.

Applies To

Image Edit control

Syntax

object.CompletePaste

Arguments

None

Return Value

None

Remarks

The ClipboardPaste method pastes image or annotation data from the Clipboard into the control. After the image or annotation data appears in the control, it can be moved at will and is therefore not part of the original image. To make the pasted image or annotation data part of the original image, the Clipboard paste operation must be completed. When invoked, the CompletePaste method completes a Clipboard paste operation.

A Clipboard paste operation can also be completed by an end user clicking on the form, outside of the pasted data.

See Also

ClipboardPaste method

PasteCompleted event


ConvertPageType Method

Converts a displayed image to the page type specified and optionally repaints the image.

Applies To

Image Edit control

Syntax

object.ConvertPageType PageType[,Repaint]

Arguments

Parameter

Data Type

Setting

PageType | Integer (enumerated) | The desired PageType setting
Repaint | Boolean | True -- Image is repainted (default) False -- Image is not repainted

PageType Argument

Setting

Description

1 | Black-and-white
2 | Gray4
3 | Gray8
4 | Palettized4 (not available as a parameter for the ConvertPageType method unless the image presently has a 4-bit palette)
5 | Palettized8
6 | RGB24
7 | BGR24

Return Value

None

Remarks

An image must be displayed before the ConvertPageType method can be invoked. If the Repaint parameter is not specified, True is entered as a default (the image is repainted). Invoking this method sets the ImageModified property to True.

To save the converted image, the Save or SaveAs method must be invoked.

An image cannot be converted to a PageType of Palettized4 unless it presently has a 4-bit palette.

See Also

Image topics in Imaging Concepts

ImageModified property

PageType property

Save method

SaveAs method


DeleteAnnotationGroup Method

Deletes an annotation group as well as its annotation marks, and then redisplays the image.

Applies To

Image Edit control

Syntax

object.DeleteAnnotationGroup GroupName

Argument

Parameter

Data Type

Setting

GroupName

String

The name of the annotation group to delete

Return Value

None

Remarks

The Display method must be invoked prior to calling this method.

To save the image without the annotation marks, the Save or SaveAs method must be invoked.

See Also

AddAnnotationGroup method

Annotation topics in Imaging Concepts

DeleteSelectedAnnotations method

Display method

Save method

SaveAs method


DeleteImageData Method

Deletes a selected or specified portion of an image.

Applies To

Image Edit control

Syntax

object.DeleteImageData [Left,Top,Width,Height]

Arguments

Parameter

Data Type

Setting

Left | Long | The upper-left corner of the selection rectangle in pixel coordinates of the displayed image
Top | Long | The top of the selection rectangle in pixel coordinates of the displayed image
Width | Long | The width of the selection rectangle in pixels
Height | Long | The height of the selection rectangle in pixels

Return Value

None

Remarks

If the DeleteImageData method is invoked without parameters after an end user draws a selection rectangle, the area bounded by the selection rectangle is deleted. This method does not delete annotation data.

If the DeleteImageData method is invoked without parameters and without an end user drawing a selection rectangle, the DeleteImageData method generates an error.

After invoking the DeleteImageData method, the Save or SaveAs method must be invoked to save the altered image.

See Also

DeleteSelectedAnnotations method

DrawSelectionRect method

Image topics in Imaging Concepts

Save method

SaveAs method

SelectionRectangle property

SelectionRectDrawn event


DeleteSelectedAnnotations Method

Deletes selected annotations.

Applies To

Image Edit control

Syntax

object.DeleteSelectedAnnotations

Arguments

None

Return Value

None

Remarks

To be deleted, annotations must first be selected using the Select Annotations tool. If no annotations are selected, the DeleteSelectedAnnotations method generates an error.

After invoking the DeleteSelectedAnnotations method, the Save or SaveAs method must be invoked to save the altered image.

Note that annotations can also be deleted by invoking the DeleteAnnotationGroup method.

See Also

Annotation topics in Imaging Concepts

DeleteAnnotationGroup method

Save method

SaveAs method


Display Method

Displays the image specified in the Image property.

Applies To

Image Edit control

Syntax

object.Display

Arguments

None

Return Value

None

Remarks

The Display method triggers a Load event before the actual image is displayed. End users can then hide or show any of the annotation groups before they are actually displayed, or set any other display-oriented properties (for example, Zoom, ScrollPosition, etc.). If an image is already displayed, this method triggers a Close event.

See Also

Close event

Display topics in Imaging Concepts

Load event

Image property

ImageDisplayed property

Page property


DisplayBlankImage Method

Displays a blank image according to the dimensions specified.

Applies To

Image Edit control

Syntax

object.DisplayBlankImage ImageWidth,ImageHeight[,ResolutionX,ResolutionY,PageType]

Arguments

Parameter

Data Type

Setting

ImageWidth | Long | The width of the image in pixels at full-scale (100 percent)
ImageHeight | Long | The height of the image in pixels at full-scale (100 percent)
ResolutionX | Long | The horizontal resolution of the image in dots per inch
ResolutionY | Long | The vertical resolution of the image in dots per inch
PageType | Integer (enumerated) | The desired PageType setting

PageType Argument

Setting

Description

1 | Black-and-white
2 | Gray4
3 | Gray8
4 | Palettized4 (not available as a parameter for the ConvertPageType method unless the image presently has a 4-bit palette)
5 | Palettized8
6 | RGB24
7 | BGR24

Return Value

None

Remarks

When the DisplayBlankImage method is invoked with an image already displayed, it triggers a Close event. The displayed image file is closed without being saved, and the new image data is displayed. The value of the Image property remains unchanged.

If the ResolutionX parameter or the ResolutionY parameter is not entered, a value of 200 is used as a default. If the PageType parameter is not entered, the Black-and-White page type is used as a default.

See Also

Close event

Display topics in Imaging Concepts


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

Annotation topics in Imaging Concepts

AnnotationType property

Image topics in Imaging Concepts

MarkEnd event

SelectTool method (Image Edit control)


DrawSelectionRect Method

Draws a selection rectangle on an image.

Applies To

Image Edit control

Syntax

object.DrawSelectionRect Left,Top,Width,Height

Arguments

Parameter

Data Type

Setting

Left | Long | The beginning horizontal position of the rectangle relative to the image window in pixels
Top | Long | The beginning vertical position of the rectangle relative to the image window in pixels
Width | Long | The width of the selection rectangle in pixels
Height | Long | The height of the selection rectangle in pixels

Return Value

None

Remarks

None

See Also

ClipboardCopy method

ClipboardCut method

DeleteImageData method

Image topics in Imaging Concepts

SelectionRectangle property

SelectionRectDrawn event

ZoomToSelection method


EditSelectedAnnotationText Method

Displays a dialog box with the selected text annotation. The dialog box enables the end user to modify the text.

Applies To

Image Edit control

Syntax

object.EditSelectedAnnotationText Left,Top

Arguments

Parameter

Data Type

Setting

Left | Long | The beginning horizontal position of the mark to be edited
Top | Long | The beginning vertical position of the mark to be edited

Return Value

None

Remarks

The left and top coordinates of the annotation to be edited can be obtained from the MarkSelect event.

After invoking the EditSelectedAnnotationText method, the Save or SaveAs method must be invoked to save the altered annotation.

See Also

Annotation topics in Imaging Concepts

MarkSelect event

Save method

SaveAs method


FitTo Method

Scales the image relative to the image window.

Applies To

Image Edit control

Syntax

object.FitTo Option[,Repaint]

Arguments

Parameter

Data Type

Setting

Description

Option | Integer (enumerated) | 0 1 2 3 | Best fit -- Fits the image to the size of the window Fit to width -- Fits the image to the width of the window Fit to height -- Fits the image to the height of the window Inch to inch -- Maintains the relative size of the original image regardless of the resolution of the image
Repaint | Boolean | True False | Image is repainted (default) Image is not repainted

Return Value

None

Remarks

The Inch to inch setting calculates the size of the image dependent upon the dots per inch reported by the display driver.

When invoked, the FitTo method updates the Zoom property with the new zoom factor.

The FitTo method can be invoked before or after an image is displayed. If an image is displayed when the method is invoked, and the Repaint parameter is set to True, the image is redisplayed using the Option setting specified.

See Also

Display topics in Imaging Concepts

Zoom property

ZoomToSelection method


Flip Method

Rotates a displayed image by 180 degrees.

Applies To

Image Edit control

Syntax

object.Flip

Arguments

None

Return Value

None

Remarks

The Display method must be invoked prior to calling this method.

Invoking the Flip method modifies the displayed image. The Save or SaveAs method must be invoked to save the modified image.

See Also

Display method

Display topics in Imaging Concepts

RotateLeft method

RotateRight method

Save method

SaveAs method


GetAnnotationGroup Method

Returns the name of the annotation group based on the index specified.

Applies To

Image Edit control

Syntax

object.GetAnnotationGroup(Index)

Argument

Parameter

Data Type

Setting

Index

Integer

The index value of the annotation group

Return Value

String

Remarks

The Display method must be invoked prior to calling this method.

Index is a 0-based value, where 0 is the first annotation group in the array, 1 is the second, 2 is the third, and so on. The upper bound value of the index can be obtained from the AnnotationGroupCount property.

The GetAnnotationGroup method is valid only at run-time.

See Also

Annotation topics in Imaging Concepts

AnnotationGroupCount property

Display method

GetCurrentAnnotationGroup method

HideAnnotationGroup method

SelectAnnotationGroup method

SetCurrentAnnotationGroup method

ShowAnnotationGroup method


GetAnnotationMarkCount Method

Returns the number of annotation marks on an image page or in an annotation group.

Applies To

Image Edit control

Syntax

object.GetAnnotationMarkCount([GroupName,AnnotationType])

Arguments

Parameter

Data Type

Setting

GroupName | String | The name of the annotation group
AnnotationType | Integer (enumerated) | The desired AnnotationType setting

AnnotationType Argument

Setting

Description

0 | 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

Return Value

Integer

Remarks

The Display method must be invoked prior to calling this method.

If the GroupName and Annotation Type parameters are both entered, the GetAnnotationMarkCount method returns the number of annotation marks of the type specified that are in the annotation group specified.

If the GroupName parameter is entered, but the Annotation Type is not entered, the GetAnnotationMarkCount method returns the total number of annotation marks that are in the annotation group specified.

If the GroupName parameter is not entered, but the Annotation Type is entered, the GetAnnotationMarkCount method returns the number of annotation marks of the type specified that are in all of the annotation groups.

If no parameters are entered, the GetAnnotationMarkCount method returns the total number of annotation marks that are on the page.

The GetAnnotationMarkCount method is valid only at run-time.

See Also

Annotation topics in Imaging Concepts

AnnotationGroupCount property

AnnotationType property

Display method


GetCurrentAnnotationGroup Method

Returns the name of the annotation group to which subsequent annotations will belong.

Applies To

Image Edit control

Syntax

object.GetCurrentAnnotationGroup

Arguments

None

Return Value

String

Remarks

The GetCurrentAnnotationGroup method is valid only at run-time.

See Also

Annotation topics in Imaging Concepts

BurnInAnnotations method

GetAnnotationGroup method

HideAnnotationGroup method

SetCurrentAnnotationGroup method

SelectAnnotationGroup method

ShowAnnotationGroup method


GetSelectedAnnotationBackColor Method

Returns the background color of a selected Attach-a-Note annotation.

Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationBackColor

Arguments

None

Return Value

Color

Remarks

The GetSelectedAnnotationBackColor method is valid only at run-time. It is used with annotations of the Attach-a-Note type.

Color is expressed using the Red-Green-Blue (R,G,B) format.

See Also

Annotation topics in Imaging Concepts

AnnotationBackColor property

AnnotationType property

SetSelectedAnnotationBackColor method


GetSelectedAnnotationFillColor Method

Returns the color used to fill a selected Filled Rectangle annotation.

Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationFillColor

Arguments

None

Return Value

Color

Remarks

The GetSelectedAnnotationFillColor method is valid only at run-time. It is used with annotations of the Filled Rectangle type.

Color is expressed using the Red-Green-Blue (R,G,B) format.

See Also

Annotation topics in Imaging Concepts

AnnotationFillColor property

AnnotationType property

SetSelectedAnnotationFillColor method


GetSelectedAnnotationFillStyle Method

Returns the style used to fill a selected image or Filled Rectangle annotation.

Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationFillStyle

Arguments

None

Return Value

Integer (enumerated)

Value

Description

0 | Transparent
1 | Opaque

Remarks

The GetSelectedAnnotationFillStyle method is valid only at run-time. It is used with annotations of the following types:

Filled Rectangle

Image Embedded

Image Reference

See Also

Annotation topics in Imaging Concepts

AnnotationFillStyle property

AnnotationType property

SetSelectedAnnotationFillStyle method


GetSelectedAnnotationFont Method

Returns a font object's properties. Applies to selected text annotations.

Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationFont

Arguments

None

Return Value

Font object

Remarks

For example, the following code returns the properties of the font object identified by the GetSelectedAnnotationFont method of an Image Edit object:

Dim x As Font
Set x = Imgedit1.GetSelectedAnnotationFont
CommonDialog1.FontBold = x.Bold
CommonDialog1.FontItalic = x.Italic
CommonDialog1.FontName = x.Name
CommonDialog1.FontSize = x.SIZE
CommonDialog1.FontUnderline = x.Underline
CommonDialog1.Font Strikethru = x.StrikeThrough
CommonDialog1.Flags = &H103&
CommonDialog1.ShowFont

The GetSelectedAnnotationFont method is valid only at run-time. It is used with annotations of the following types:

Text

Attach-a-Note

Text From File

Text Stamp

See Also

Annotation topics in Imaging Concepts

AnnotationFont property

AnnotationType property

SetSelectedAnnotationFont method


GetSelectedAnnotationFontColor Method

Returns the color used in a selected text annotation.

Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationFontColor

Arguments

None

Return Value

Color

Remarks

The GetSelectedAnnotationFontColor method is valid only at run-time. It is used with annotations of the following types:

Text

Attach-a-Note

Text From File

Text Stamp

Color is expressed using the Red-Green-Blue (R,G,B) format.

See Also

Annotation topics in Imaging Concepts

AnnotationFontColor property

AnnotationType property

SetSelectedAnnotationFontColor method


GetSelectedAnnotationImage Method

Returns the fully-qualified filename of the image that is being used in a selected image annotation.

Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationImage

Arguments

None

Return Value

String

Remarks

The GetSelectedAnnotationImage method is valid only at run-time. It is used with annotations of the following types:

Image Embedded

Image Reference

See Also

Annotation topics in Imaging Concepts

AnnotationImage property

AnnotationType property

Image topics in Imaging Concepts


GetSelectedAnnotationLineColor Method

Returns the line color used in a selected line or Hollow Rectangle annotation.

Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationLineColor

Arguments

None

Return Value

Color

Remarks

The GetSelectedAnnotationLineColor method is valid only at run-time. It is used with annotations of the following types:

Freehand Line

Hollow Rectangle

Straight Line

Color is expressed using the Red-Green-Blue (R,G,B) format.

See Also

Annotation topics in Imaging Concepts

AnnotationLineColor property

AnnotationType property

SetSelectedAnnotationLineColor method


GetSelectedAnnotationLineStyle Method

Returns the line style used in a selected line or Hollow Rectangle annotation.

Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationLineStyle

Arguments

None

Return Value

Integer (enumerated)

Value

Description

0 | Transparent
1 | Opaque

Remarks

The GetSelectedAnnotationLineStyle method is valid only at run-time. It is used with annotations of the following types:

Freehand Line

Hollow Rectangle

Straight Line

See Also

Annotation topics in Imaging Concepts

AnnotationLineStyle property

AnnotationType property

SetSelectedAnnotationLineStyle method


GetSelectedAnnotationLineWidth Method

Returns the line width in pixels used in a selected line or Hollow Rectangle annotation.

Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationLineWidth

Arguments

None

Return Value

Integer

Remarks

The GetSelectedAnnotationLineWidth method is valid only at run-time. It is used with annotations of the following types:

Freehand Line

Hollow Rectangle

Straight Line

See Also

Annotation topics in Imaging Concepts

AnnotationLineWidth property

AnnotationType property

SetSelectedAnnotationLineWidth method


HideAnnotationGroup Method

Hides an annotation group.

Applies To

Image Edit control

Syntax

object.HideAnnotationGroup [GroupName]

Argument

Parameter

Data Type

Setting

GroupName

String

The name of the annotation group to hide

Return Value

None

Remarks

The Display method must be invoked prior to calling this method.

If the GroupName parameter is not specified, the HideAnnotationGroup method hides all annotation groups.

See Also

Annotation topics in Imaging Concepts

Display method

GetAnnotationGroup method

GetCurrentAnnotationGroup method

SetCurrentAnnotationGroup method

ShowAnnotationGroup method


HideAnnotationToolPalette Method

Hides the Annotation Tool Palette.

Applies To

Image Edit control

Syntax

object.HideAnnotationToolPalette

Arguments

None

Return Value

None

Remarks

The ShowAnnotationToolPalette method must be invoked prior to calling this method.

See Also

Annotation topics in Imaging Concepts

ShowAnnotationToolPalette method

ToolPaletteHidden event


IsClipboardDataAvailable Method

Determines whether image or annotation data is present in the Clipboard.

Applies To

Image Edit control

Syntax

object.IsClipboardDataAvailable

Arguments

None

Return Value

Boolean

Value

Description

True | Image or annotation data is in the clipboard
False | Image or annotation data is not in the clipboard

Remarks

Use the IsClipboardDataAvailable method to determine whether the ClipboardPaste method can be invoked.

See Also

Annotation topics in Imaging Concepts

ClipboardCopy method

ClipboardCut method

ClipboardPaste method

Image topics in Imaging Concepts


PrintImage Method

Prints the image being displayed.

Applies To

Image Edit control

Syntax

object.PrintImage [StartPage,EndPage,OutputFormat,Annotations,Printer,Driver,PortNumber]

Arguments

Parameter

Data Type

Setting

StartPage | Long | The starting page in a range of pages to be printed
EndPage | Long | The ending page in a range of pages to be printed
OutputFormat | Integer (enumerated) | The output format to be used: 0 -- Pixel to pixel 1 -- Inch to inch 2 -- Fit to page
Annotations | Boolean | Whether annotations will be printed with the image: True -- Annotations will be printed False -- Annotations will not be printed
Printer | String | The name of the printer
Driver | String | The name of the printer driver
PortNumber | String | The name of the output port

Return Value

None

Remarks

If an image is displayed when the PrintImage method is invoked, the image is printed as it appears, including any changes made.

If an image is not being displayed, the PrintImage method prints the image specified in the Image property. If an image is not being displayed and the Image property does not contain the filename of an image, the PrintImage method generates an error.

If the StartPage and EndPage parameters are not entered, this method prints all pages by default.

If the Annotations parameter is not specified, all annotations are printed by default.

See Also

Image property

Image topics in Imaging Concepts


Refresh Method

Repaints the contents of the Image Edit control.

Applies To

Image Edit control

Syntax

object.Refresh

Arguments

None

Return Value

None

Remarks

The Display method must be invoked prior to calling this method.

See Also

Display method

DisplayScaleAlgorithm property

ImagePalette property

ImageResolutionX property

ImageResolutionY property

ScrollBars property

ScrollPositionX property

ScrollPositionY property

Zoom property


RotateLeft Method

Rotates the displayed image 90 degrees to the left.

Applies To

Image Edit control

Syntax

object.RotateLeft

Arguments

None

Return Value

None

Remarks

The Display method must be invoked prior to calling this method.

Invoking the RotateLeft method modifies the displayed image. The Save or SaveAs method must be invoked to save the modified image.

See Also

Display method

Display topics in Imaging Concepts

Flip method

RotateRight method

Save method

SaveAs method


RotateRight Method

Rotates the displayed image 90 degrees to the right.

Applies To

Image Edit control

Syntax

object.RotateRight

Arguments

None

Return Value

None

Remarks

The Display method must be invoked prior to calling this method.

Invoking the RotateRight method modifies the displayed image. The Save or SaveAs method must be invoked to save the modified image.

See Also

Display method

Display topics in Imaging Concepts

Flip method

RotateLeft method

Save method

SaveAs method


Save Method

Saves the displayed image (page) to the original path and file.

Applies To

Image Edit control

Syntax

object.Save [SaveAtZoom]

Argument

Parameter

Data Type

Setting

SaveAtZoom

Boolean

Whether the image is saved using the current or original scale percentage value:

True -- The image is saved using the current scale percentage value, as specified in the Zoom property
False -- The image is saved using the original scale percentage value (Zoom value of 100 percent)

Return Value

None

Remarks

The Display method must be invoked prior to calling this method.

For the TIFF file type, annotations are saved as annotation data. For all other file types, annotations are lost unless the BurnInAnnotations method was invoked prior to calling the Save method. The BurnInAnnotations method burns annotations onto an image, causing them to be permanently incorporated into the image.

The Save method saves the image to the same file from which it was opened. The saved image remains in the display window at its original resolution.

If the SaveAtZoom parameter is not specified, the image is saved using the original zoom scale percentage value.

See Also

Annotation topics in Imaging Concepts

BurnInAnnotations method

Close event

Display method

Display topics in Imaging Concepts

Image topics in Imaging Concepts

ImageModified property

SaveAs method

Zoom property


SaveAs Method

Saves the displayed image using the filename specified.

Applies To

Image Edit control

Syntax

object.SaveAs Image[,FileType,PageType,CompressionType,CompressionInfo,SaveAtZoom]

Arguments

Parameter

Data Type

Setting

Image | String | The name of the image file being saved
FileType | Integer (enumerated) | The FileType the image is being saved as
PageType | Integer (enumerated) | The PageType the image is being saved as
CompressionType | Integer (enumerated) | The CompressionType at which the image is being saved
CompressionInfo | Integer (enumerated) | The CompressionInfo setting of the image being saved
SaveAtZoom | Boolean | Whether the image is being saved using the current or original scale percentage value: True -- The image is being saved using the current scale percentage value False -- The image is being saved using the original scale percentage value

FileType Argument

Setting

Description

1 | TIFF
2 | AWD
3 | BMP
4 | PCX (read-only)
5 | DCX (read-only)
6 | JPG (read-only)
7 | XIF (read-only)

Displayed file types of DCX, PCX, JPG, or XIF must be saved using a FileType setting of 1 (TIFF), 2 (AWD), or 3 (BMP).

If a multipage image file (AWD, DCX, TIFF, or XIF) is saved as a BMP file, only the page currently being displayed is saved to the new file.

PageType Argument

The valid PageType settings for the SaveAs method depend on the FileType setting entered. The following list shows the valid PageType settings:

Setting

Description

Prerequisite FileType

1 | Black-and-white | 1 – TIFF, or 3 -- BMP
2 | Gray4 | 1 -- TIFF
3 | Gray8 | 1 -- TIFF
4 | Palettized4 | 1 -- TIFF or 3 -- BMP
5 | Palettized8 | 1 -- TIFF or 3 -- BMP
6 | RGB24 | 1 -- TIFF
7 | BGR24 | 3 -- BMP

To use a PageType setting of 4 (Palettized4), the displayed image must already be a Palettized4 image.

CompressionType Argument

Setting

Description

1 | No compression
2 | Group3(1D)
3 | Group3(Modified Huffman)
4 | PackBits
5 | Group4(2D)
6 | JPEG
7 | RBA
8 | Group3(2D) (read only)
9 | LZW (read only)

BMP files must be saved using a CompressionType setting of 1.

JPG files must be saved using a CompressionType setting of 6.

CompressionInfo Argument

Setting

Description

0 | No compression -- If CompressionType is set to 1 (no compression) Default compression -- If CompressionType is set to a value other than 1
1 | EOL
2 | Packed Lines
4 | Prefixed EOL
8 | Compressed LTR
16 | Expand LTR
32 | Negate
64 | High Compression/High Quality (JPEG compression only)
128 | High Compression/Medium Quality (JPEG compression only)
256 | High Compression/Low Quality (JPEG compression only)
512 | Medium Compression/High Quality (JPEG compression only)
1024 | Medium Compression/Medium Quality (JPEG compression only)
2048 | Medium Compression/Low Quality (JPEG compression only)
4096 | Low Compression/High Quality (JPEG compression only)
8192 | Low Compression/Medium Quality (JPEG compression only)
16384 | Low Compression/Low Quality (JPEG compression only)

BMP and other uncompressed files must be saved using a CompressionInfo setting of 0.

Return Value

None

Remarks

The Display method must be invoked prior to calling this method.

The SaveAs method saves the image using the filename specified in the Image parameter. If the file already exists, it is overwritten.

Upon successful completion of the SaveAs method, the image display window continues to display the original image; the Image property value remains unchanged. Continuing to display the original image ensures that the image on display is the same as the image specified in the Image property. For example, assume the currently displayed image is payroll.tif and the value of the Image property is also payroll.tif. When the SaveAs method is invoked with its Image parameter set to payroll96.tif, the image is saved as payroll96.tif. The image display window continues to display payroll.tif, and the Image property value remains unchanged at payroll.tif.

If a multipage image file (AWD, DCX, TIFF, or XIF) is saved as a file type that does not support multipage image files (for example, BMP), only the page currently being displayed is saved to the new file.

For the TIFF file type, annotations are saved as annotation data. For all other file types, annotations are lost unless the BurnInAnnotations method is invoked prior to calling the SaveAs method. The BurnInAnnotations method burns annotations onto an image, causing them to be permanently incorporated into the image.

If the FileType parameter is not entered, the SaveAs method uses the original FileType setting of the image as a default. If the original FileType setting cannot be determined or is read-only, the method saves the image as a TIFF file. (For example, the SaveAs method saves a XIF file as a TIFF file.)

If the PageType and FileType parameters are not entered, the SaveAs method uses the original PageType setting of the image as a default. However, if a FileType is entered, the SaveAs method uses a PageType default setting that is associated with the FileType setting of the image. The following list describes the default PageType settings:

FileType Setting

Default PageType Setting

1 -- TIFF | PageType setting of the displayed image
3 -- BMP | PageType setting of the displayed image

If the CompressionType parameter is Group3(2D), the SaveAs method saves the image using the Group4(2D) compression type. If the CompressionType parameter is LZW, the SaveAs method saves the image using no compression.

If the CompressionType parameter is not entered, the SaveAs method uses a default CompressionType setting that is associated with the FileType and PageType settings of the image. The following list describes the default CompressionType settings:

FileType Setting

PageType Setting

Default CompressionType Setting

3 -- BMP | 1,5,7 -- All supported PageTypes | 1 -- No compression
1 -- TIFF | 1 -- Black-and-white | 2 -- Group3(1D)
1 -- TIFF | 2 -- Gray4 | 1 -- No compression
1 -- TIFF | 3 -- Gray8 | 6 -- JPEG
1 -- TIFF | 4 -- Palettized4 | 1 -- No compression
1 -- TIFF | 5 -- Palettized8 | 1 -- No compression
1 -- TIFF | 6 -- RGB24 | 6 -- JPEG

Note: To use a PageType setting of 4 (Palettized4), the displayed image must already be a Palettized4 image.

If the CompressionInfo parameter is not entered, the SaveAs method uses a default CompressionInfo setting that is associated with the CompressionType setting of the image. The following list describes the default CompressionInfo settings:

CompressionType Setting

CompressionInfo Default Setting

1 -- No compression | 0 -- No compression
2 -- Group3(1D) | 8 -- Compressed LTR, 16 -- Expand LTR, 1 -- EOL, and 4 -- Prefixed EOL
3 --Group3(Modified Huffman) | 8 -- Compressed LTR and 16 -- Expand LTR
4 -- PackBits | 16 -- Expand LTR
5 -- Group4(2D) | 2 -- Packed Lines, 8 -- Compressed LTR, and 16 -- Expand LTR
6 -- JPEG | 1024 -- Medium Compression/Medium Quality

When a CompressionInfo value of 0 is entered with the CompressionType parameter set to 1 (no compression), the file is saved using no compression.

When a CompressionInfo value of 0 is entered with the CompressionType parameter set to a value other than 1, the file is saved using the default CompressionInfo parameter settings that correspond to the setting of the CompressionType parameter (as explained in the preceding list).

For example, if the end user specifies a CompressionType value of 1 (no compression) and then a CompressionInfo value of 0, the file is saved using no compression. If the end user specifies a CompressionType value of 2 (Group3[1D]) and then a CompressionInfo value of 0, the file is saved using the default CompressionInfo values for Group3(1D):

8 -- Compressed LTR,
16 -- Expand LTR,
1 -- EOL, and
4 -- Prefixed EOL

If the SaveAtZoom parameter is not specified, the image is saved using the original zoom scale percentage value.

See Also

BurnInAnnotations method

Compression topics in Imaging Concepts

CompressionInfo property

CompressionType property

Close event

Display method

Display topics in Imaging Concepts

FileType property

Image property

Image topics in Imaging Concepts

ImageModified property

PageType property

Save method


ScrollImage Method

Scrolls a displayed image.

Applies To

Image Edit control

Syntax

object.ScrollImage Direction,ScrollAmount

Arguments

Parameter

Data Type

Setting

Direction | Integer (enumerated) | The direction in which to scroll the image: 0 -- Down 1 -- Up 2 -- Right 3 -- Left
ScrollAmount | Long | The number of pixels to scroll the image

Return Value

None

Remarks

The Display method must be invoked prior to calling this method.

See Also

Display method

Image topics in Imaging Concepts

Scroll event

ScrollBars property

ScrollPositionX property

ScrollPositionY property

ScrollShortcutsEnabled property


SelectAnnotationGroup Method

Selects all annotation marks within a specific group on the image page.

Applies To

Image Edit control

Syntax

object.SelectAnnotationGroup GroupName

Argument

Parameter

Data Type

Setting

GroupName

String

The name of the annotation group to select

Return Value

None

Remarks

The Display method must be invoked prior to calling this method.

See Also

AddAnnotationGroup method

Annotation topics in Imaging Concepts

Display method

GetAnnotationGroup method

GetCurrentAnnotationGroup method

MarkSelect event

SetCurrentAnnotationGroup method

ShowAnnotationGroup method


SelectTool Method

Selects an annotation tool from the Annotation Tool Palette.

Applies To

Image Edit control

Syntax

object.SelectTool ToolID

Argument

Parameter

Data Type

Setting

Description

ToolID

Integer
(enumerated)

0
1
2
3
4
5
6
7
8
9
10

No Tool
Selection
Freehand Line
Highlighter
Straight Line
Hollow Rectangle
Filled Rectangle
Text
Attach-a-Note
Text From File
Text Stamp

Return Value

None

Remarks

The Highlighter annotation type is composed of a Filled Rectangle annotation type with a transparent fill style.

When a tool is selected from the tool palette, the previous tool is deselected automatically.

The Annotation Tool Palette does not have to be visible to use this method.

See Also

Annotation topics in Imaging Concepts

ShowAnnotationToolPalette method

ToolSelected event


SetCurrentAnnotationGroup Method

Sets the annotation group to which subsequent annotations will belong.

Applies To

Image Edit control

Syntax

object.SetCurrentAnnotationGroup GroupName

Argument

Parameter

Data Type

Setting

GroupName

String

The name of the annotation group

Return Value

None

Remarks

The SetCurrentAnnotationGroup method is valid only at run-time.

The names of the groups can be obtained from the GetAnnotationGroup method.

A new group can be created using the AddAnnotationGroup method.

See Also

AddAnnotationGroup method

Annotation topics in Imaging Concepts

BurnInAnnotations method

GetAnnotationGroup method

GetCurrentAnnotationGroup method


SetImagePalette Method

Sets the palette to be used for the image currently being displayed, or an image to be displayed.

Applies To

Image Edit control

Syntax

object.SetImagePalette Option

Argument

Parameter

Data Type

Setting

Description

Option

Integer
(enumerated)

0
1

Foreground
Background

Return Value

None

Remarks

Images are displayed using the foreground palette by default. When the default foreground palette is used, it is loaded into the Windows palette, which can cause other images or other color-aware objects to become distorted. Setting the SetImagePalette Option value to 1 (Background) sets the existing palette, which has already been loaded by Windows.

See Also

Image topics in Imaging Concepts

ImagePalette property

Palette topics in Imaging Concepts


SetSelectedAnnotationBackColor Method

Sets the background color of a selected Attach-a-Note annotation.

Applies To

Image Edit control

Syntax

object.SetSelectedAnnotationBackColor Color

Argument

Parameter

Data Type

Setting

Color

Color

The desired Attach-a-Note color

Return Value

None

Remarks

The SetSelectedAnnotationBackColor method is used with annotations of the Attach-a-Note type.

Use the 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).

To ensure that the text in an Attach-a-Note annotation will be visible against the background, specify a background color that is significantly different from the font color set using the SetSelectedAnnotationFontColor method.

See Also

Annotation topics in Imaging Concepts

AnnotationBackColor property

AnnotationType property

GetSelectedAnnotationBackColor method

SetSelectedAnnotationFontColor method


SetSelectedAnnotationFillColor Method

Sets the color used to fill a selected Filled Rectangle annotation.

Applies To

Image Edit control

Syntax

object.SetSelectedAnnotationFillColor Color

Argument

Parameter

Data Type

Setting

Color

Color

The desired Filled Rectangle color

Return Value

None

Remarks

The SetSelectedAnnotationFillColor method is used with annotations of the Filled Rectangle annotation type.

Use the 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).

See Also

Annotation topics in Imaging Concepts

AnnotationFillColor property

AnnotationType property

GetSelectedAnnotationFillColor method

SetSelectedAnnotationFontColor method


SetSelectedAnnotationFillStyle Method

Sets the style used to fill a selected image or Filled Rectangle annotation.

Applies To

Image Edit control

Syntax

object.SetSelectedAnnotationFillStyle Style

Argument

Parameter

Data Type

Setting

Description

Style

Integer
(enumerated)

0
1

Transparent -- The underlying image data is visible
Opaque -- The underlying image data is obscured

Return Value

None

Remarks

The SetSelectedAnnotationFillStyle method is used with annotations of the following types:

Filled Rectangle

Image Embedded

Image Reference

See Also

Annotation topics in Imaging Concepts

AnnotationFillStyle property

AnnotationType property

GetSelectedAnnotationFillStyle method


SetSelectedAnnotationFont Method

Sets a font object's properties. Applies to selected text annotations.

Applies To

Image Edit control

Syntax

object.SetSelectedAnnotationFont Font

Argument

Parameter

Data Type

Setting

Font

Font object

The properties of the font object

Return Value

None

Remarks

Use the SetSelectedAnnotationFont method to identify the specific font object whose properties you want to set. The following list shows the properties you can 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 SetSelectedAnnotationFont method of an Image Edit object:

Dim x As Font
Set x = Form1.Font
x.Bold = True
x.Italic = True
x.Name = "Courier New"
x.SIZE = 14
x.Underline = True
x.StrikeThrough = True
Imgedit1.SetSelectedAnnotationFont x

The SetSelectedAnnotationFont method is used with annotations of the following types:

Text

Attach-a-Note

Text From File

Text Stamp

See Also

Annotation topics in Imaging Concepts

AnnotationFont property

AnnotationType property

GetSelectedAnnotationFont method


SetSelectedAnnotationFontColor Method

Sets the font color used in a selected text annotation.

Applies To

Image Edit control

Syntax

object.SetSelectedAnnotationFontColor Color

Argument

Parameter

Data Type

Setting

Color

Color

The desired font color

Return Value

None

Remarks

The SetSelectedAnnotationFontColor method is used with annotations of the following types:

Text

Attach-a-Note

Text From File

Text Stamp

Use the 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).

To ensure that the text in an Attach-a-Note annotation will be visible against the background, specify a font color that is significantly different from the background color set using the SetSelectedAnnotationBackColor method.

See Also

Annotation topics in Imaging Concepts

AnnotationFontColor property

AnnotationType property

GetSelectedAnnotationFontColor method

SetSelectedAnnotationBackColor method

SetSelectedAnnotationFillColor method


SetSelectedAnnotationLineColor Method

Sets the line color used in a selected line or Hollow Rectangle annotation.

Applies To

Image Edit control

Syntax

object.SetSelectedAnnotationLineColor Color

Argument

Parameter

Data Type

Setting

Color

Color

The desired line color

Return Value

None

Remarks

The SetSelectedAnnotationLineColor method is used with annotations of the following types:

Freehand Line

Hollow Rectangle

Straight Line

Use the 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).

See Also

Annotation topics in Imaging Concepts

AnnotationLineColor property

AnnotationType property

GetSelectedAnnotationLineColor method


SetSelectedAnnotationLineStyle Method

Sets the line style used in a selected line or Hollow Rectangle annotation.

Applies To

Image Edit control

Syntax

object.SetSelectedAnnotationLineStyle Style

Argument

Parameter

Data Type

Setting

Description

Style

Integer
(enumerated)

0
1

Transparent -- The underlying image data is visible
Opaque -- The underlying image data is obscured

Return Value

None

Remarks

The SetSelectedAnnotationLineStyle method is used with annotations of the following types:

Freehand Line

Hollow Rectangle

Straight Line

See Also

Annotation topics in Imaging Concepts

AnnotationLineStyle property

AnnotationType property

GetSelectedAnnotationLineStyle method


SetSelectedAnnotationLineWidth Method

Sets the line width used in a selected line or Hollow Rectangle annotation.

Applies To

Image Edit control

Syntax

object.SetSelectedAnnotationLineWidth Width

Argument

Parameter

Data Type

Setting

Width

Integer

The desired line width in pixels

Return Value

None

Remarks

The SetSelectedAnnotationLineWidth method is used with annotations of the following types:

Freehand Line

Hollow Rectangle

Straight Line

See Also

Annotation topics in Imaging Concepts

AnnotationLineWidth property

AnnotationType property

GetSelectedAnnotationLineWidth method


ShowAnnotationGroup Method

Shows the specified annotation group.

Applies To

Image Edit control

Syntax

object.ShowAnnotationGroup [GroupName]

Argument

Parameter

Data Type

Setting

GroupName

String

The name of the desired annotation group

Return Value

None

Remarks

The Display method must be invoked prior to calling this method.

If the GroupName parameter is not entered, the ShowAnnotationGroup method shows all annotation groups.

See Also

Annotation topics in Imaging Concepts

Display method

GetAnnotationGroup method

GetCurrentAnnotationGroup method

HideAnnotationGroup method

SelectAnnotationGroup method


ShowAnnotationToolPalette Method

Shows the Annotation Tool Palette, which enables end users to edit images displayed in this control.

Applies To

Image Edit control

Syntax

object.ShowAnnotationToolPalette [ShowAttributesDialog,Left,Top,ToolTipText]

Arguments

Parameter

Data Type

Setting

ShowAttributesDialog | Boolean | Whether the Annotation Attributes dialog box is invoked: True -- When the end user clicks on a tool palette button using the right mouse button and selects properties from a pop-up menu, the Annotation Attributes dialog box appears. When the end user clicks on the Rubber Stamp tool button, a pop-up menu appears that contains a list of previously defined stamps. False -- The Annotation Attributes dialog box cannot be invoked.
Left | Long | The horizontal position of the Annotation Tool Palette in pixels, relative to the upper-left corner of the Image Edit control.
Top | Long | The vertical position of the Annotation Tool Palette in pixels, relative to the upper-left corner of the Image Edit control.
ToolTipText | String | Contains the tool tip text used for each Annotation Tool Palette button. Ten strings are required; use the vertical bar (|) character to separate each string. If not specified, default strings are provided.

Return Value

None

Remarks

The ShowAnnotationToolPalette method can be invoked only once per control.

If the ShowAttributesDialog parameter is not entered, it is set to True by default.

If the Left and Top parameters are not entered, the Annotation Tool Palette is displayed at Position 10,10 relative to the Image Edit control.

ToolTip strings are displayed by default only as long as the tool palette control has focus. It is the responsibility of the calling application to insure that the control gets focus in the appropriate situations, either through explicit or implicit means.

To draw annotations using the Annotation Tool Palette, an annotation tool must be selected. This can be accomplished by the end user clicking on a button on the tool palette, or by invoking the SelectTool method. The annotation mark can then be drawn manually by the end user, or programatically by calling the Draw method. Changing the AnnotationType property with the Annotation Tool Palette displayed will not achieve the desired results.

See Also

Annotation topics in Imaging Concepts

Display method

Draw method

HideAnnotationToolPalette method

SelectTool method

ShowAttribsDialog method

ToolSelected event

ToolTip event


ShowAttribsDialog Method

Shows an Annotation Attributes dialog box, which the end user can use to change the attributes of the selected annotation mark.

Applies To

Image Edit control

Syntax

object.ShowAttribsDialog

Arguments

None

Return Value

None

Remarks

An annotation must be selected before invoking the ShowAttribsDialog method.

See Also

Annotation topics in Imaging Concepts

SelectAnnotationGroup method

SelectTool method


ShowRubberStampDialog Method

Can be used in conjunction with the Annotation Tool Palette to show the Rubber Stamp Properties dialog box to allow the end user to create, delete, and edit Rubber Stamps.

Applies To

Image Edit control

Syntax

object.ShowRubberStampDialog

Arguments

None

Return Value

None

Remarks

None

See Also

Annotation topics in Imaging Concepts

SelectTool method

ShowAnnotationToolPalette method


ZoomToSelection Method

Scales a selected portion of a displayed image so that it fits into the size of the control.

Applies To

Image Edit control

Syntax

object.ZoomToSelection

Arguments

None

Return Value

None

Remarks

A selection rectangle must be drawn on the image prior to calling the ZoomToSelection method.

The ZoomToSelection method updates the Zoom property with the zoom factor used.

See Also

Display method

Display topics in Imaging Concepts

DrawSelectionRect method

FitTo method

SelectionRectDrawn event

Zoom property


Events

The Image Edit control uses the following standard Events:

Click | KeyUp
DblClick | MouseDown
Error | MouseMove
KeyDown | MouseUp
KeyPress |

The Error event occurs only when an error condition triggers it. It does not occur when a property is set or a method is invoked.

If you are using Visual Basic, it adds the DragDrop, DragOver, GotFocus, and LostFocus events.

The Image Edit control also uses the following custom Events:

Close | Scroll
Load | SelectionRectDrawn
MarkEnd | ToolPaletteHidden
MarkSelect | ToolTip
PasteCompleted | ToolSelected


Close Event

This event occurs whenever one of the following methods is invoked:

· Display

· ClearDisplay

· DisplayBlankImage

The Close event can be used to indicate to the end user that the displayed image is about to be closed.

Applies To

Image Edit control

Syntax

Sub object_Close( )

Arguments

None

Remarks

Once a Close event occurs, any changes made to displayed images are lost unless the Save or SaveAs method is invoked.

If desired, your program can check the ImageModified property to see if any changes have been made to the displayed image. If changes have been made, the program can be written so it prompts the end user to save the changes.

See Also

ClearDisplay method

Display method

Display topics in Imaging Concepts

DisplayBlankImage method

ImageModified property

Save method

SaveAs method


Load Event

This event occurs immediately after the Display method is invoked.

Applies To

Image Edit control

Syntax

Sub object_Load(Zoom)

Argument

Parameter

Data Type

Setting

Zoom

Double

Returns the default zoom factor of 100.

The Zoom parameter can also return the following values:

-1 -- Fit to width. The image was fit to the width of the window when it was displayed.
-2 -- Fit to height. The image was fit to the height of the window when it was displayed.
-3 -- No previously saved zoom factor.

Note: Zoom values of -1 and -2 may not be compatible with some applications.

Remarks

Once a Load event occurs, the visibility of the group can be changed, and other properties and methods can be set or invoked.

If desired, your program can use the returned zoom factor to set the Zoom property, or the Option parameter of the FitTo method, prior to displaying another image.

See Also

Display method

Display topics in Imaging Concepts

FitTo method

Zoom property


MarkEnd Event

This event occurs immediately after the end user or program completes the drawing of an annotation mark.

Applies To

Image Edit control

Syntax

Sub object_MarkEnd(Left,Top,Width,Height,MarkType,GroupName)

Arguments

Parameter

Data Type

Setting

Left | Long | The starting horizontal position of the annotation mark within the image in image pixels
Top | Long | The starting vertical position of the annotation mark within the image in image pixels
Width | Long | The ending horizontal position of the annotation mark within the image in image pixels
Height | Long | The ending vertical position of the annotation mark within the image in image pixels
MarkType | Integer | The AnnotationType of the annotation mark (except for the Select Annotations annotation type)
GroupName | String | The name of the annotation group to which the annotation belongs

AnnotationType Argument

Setting

Description

0 | 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

Remarks

The MarkType parameter cannot be the Select Annotations annotation type.

A MarkEnd event does not occur if a Select Annotation rectangle is drawn (AnnotationType of 0).

See Also

Annotation topics in Imaging Concepts

Draw method


PasteCompleted Event

This event occurs immediately after pasted image or annotation data is committed to a location on an image. Pasted image or annotation data is committed when an end user clicks on a form, outside of a pasted image or annotation, or whenever the CompletePaste method is invoked.

Applies To

Image Edit control

Syntax

Sub object_PasteCompleted( )

Arguments

None

Remarks

The ClipboardPaste method must be invoked for this event to be triggered.

See Also

ClipboardPaste method

CompletePaste method


Scroll Event

This event occurs immediately after the end user or program scrolls an image in the control.

Applies To

Image Edit control

Syntax

Sub object_Scroll( )

Arguments

None

Remarks

None

See Also

ScrollBars property

ScrollImage method

ScrollShortcutsEnabled property

ScrollPositionX property

ScrollPositionY property


MarkSelect Event

This event occurs immediately after the end user or program selects an annotation mark.

Applies To

Image Edit control

Syntax

Sub object_MarkSelect(Button,Shift,Left,Top,Width,Height,MarkType,GroupName)

Arguments

Parameter

Data Type

Setting

Button | Integer (enumerated) | Specifies the mouse button pressed: 1 -- Left button 2 -- Right button 4 -- Middle button
Shift | Integer (enumerated) | Specifies whether the Shift, Ctrl, or Alt key is pressed: 1 -- Shift key 2 -- Ctrl key 4 -- Alt key
Left | Long | The beginning horizontal position within the image in image pixels
Top | Long | The beginning vertical position within the image in image pixels
Width | Long | The ending horizontal position within the image in image pixels
Height | Long | The ending vertical position within the image in image pixels
MarkType | Integer | The AnnotationType of the annotation mark (except for the Select Annotations annotation type)
GroupName | String | The name of the annotation group to which the annotation belongs

AnnotationType Argument

Setting

Description

0 | 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

Remarks

If multiple annotations are selected, a MarkType parameter value of 0 is returned.

The GroupName parameter is an empty string when multiple annotations are selected.

See Also

Annotation topics in Imaging Concepts

SelectAnnotationGroup method


SelectionRectDrawn Event

This event occurs immediately after the end user presses the left mouse button, or the DrawSelectionRect method is invoked.

Applies To

Image Edit control

Syntax

Sub object_SelectionRectDrawn(Left,Top,Width,Height)

Arguments

Parameter

Data Type

Setting

Left | Long | The beginning horizontal position within the image in image pixels relative to the upper-left corner of the Image Edit display window
Top | Long | The beginning vertical position within the image in image pixels relative to the upper-left corner of the Image Edit display window
Width | Long | The ending horizontal position within the image in image pixels relative to the upper-left corner of the Image Edit display window
Height | Long | The ending vertical position within the image in image pixels relative to the upper-left corner of the Image Edit display window

Remarks

The SelectionRectangle property must be set to True for this event to be triggered.

If the end user draws a selection rectangle of 3 pixels or less, no selection rectangle is drawn. When this happens, the SelectionRectDrawn event is still triggered, but all of its parameters contain a value of 0. Your program can use these 0 values to determine whether cut, copy, or delete operations should be enabled.

See Also

DrawSelectionRect method

Image topics in Imaging Concepts

SelectionRectangle property


ToolPaletteHidden Event

This event occurs immediately after the Annotation Tool Palette has been hidden.

Applies To

Image Edit control

Syntax

Sub object_ToolPaletteHidden(Left,Top)

Arguments

Parameter

Data Type

Setting

Left | Long | The horizontal position of the Annotation Tool Palette in pixels when it was closed, relative to the upper-left corner of the screen
Top | Long | The vertical position of the Annotation Tool Palette in pixels when it was closed, relative to the upper-left corner of the screen

Remarks

The Annotation Tool Palette can be hidden by invoking the HideAnnotationToolPalette method or by clicking on the Close icon on the Annotation Tool Palette caption bar.

See Also

Annotation topics in Imaging Concepts

HideAnnotationToolPalette method


ToolTip Event

This event occurs immediately after a tool tip has been displayed on the Annotation Tool Palette.

Applies To

Image Edit control

Syntax

Sub object_ToolTip(Index)

Argument

Parameter

Data Type

Setting

Index

Integer (enumerated)

Index value of the tool tip displayed, which corresponds to the Tool ID settings

Tool ID Argument

Parameter

Data Type

Setting

Description

ToolID

Integer
(enumerated)

0
1
2
3
4
5
6
7
8
9
10

No Tool
Select Annotations
Freehand Line
Highlighter
Straight Line
Hollow Rectangle
Filled Rectangle
Text
Attach-a-Note
Text From File
Rubber Stamp

Remarks

The ShowAnnotationToolPalette method displays the Annotation Tool Palette. The SelectTool method selects the annotation tool in the Annotation Tool Palette.

See Also

Annotation topics in Imaging Concepts

SelectTool method

ShowAnnotationToolPalette method

ToolSelected event


Wang Image Thumbnail Control

The Image Thumbnail control displays thumbnail views of the images contained in an image file in uniformly sized and spaced frames called thumbnail boxes. Thumbnails are useful for displaying each page of a multipage image file in a miniature format. When you specify an image file, thumbnail representations of images are generated and buffered for use. You can use the buffered thumbnails or choose to regenerate thumbnails to reflect subsequent changes made to the image file, such as inserted or deleted pages, or alterations made to pages (annotations).

The Thumbnail control can be configured to scroll either vertically or horizontally. When scrolled vertically, thumbnails are displayed sequentially from the top left, across the rows and down to the bottom right. When scrolled horizontally, thumbnails are displayed sequentially from the top left, down the columns and across to the bottom right. The scroll bar is displayed only when there are more thumbnails available than can fit in the control's window. A scrollbar is never displayed in the non-scrolling direction.

You can change the size of the thumbnail boxes collectively, making them smaller, to fit more into the control's window, or making them larger to see more detail. The views displayed in the thumbnail boxes maintain the same aspect ratio (height to width relationship) as the image pages they represent.

Although the Thumbnail control can only display views of the image, it can be used in conjunction with the Admin control to add or delete pages in the image file.

You can also choose to display text labels beneath the thumbnails, and assign different fonts, colors, and styles to the labels.


Properties

The Image Thumbnail control uses the following Properties:

BackColor | SelectedThumbCount
BorderStyle | StatusCode
Enabled | ThumbBackColor
FirstSelectedThumb | ThumbCaption
HighlightColor | ThumbCaptionColor
HighlightSelectedThumbs | ThumbCaptionFont
hWnd | ThumbCaptionStyle
Image | ThumbCount
LastSelectedThumb | ThumbHeight
MouseIcon | ThumbSelected[PageNumber]
MousePointer | ThumbWidth
ScrollDirection |


BackColor Property

Returns or sets the background color of the entire control.

Applies To

Image Thumbnail control

Syntax

object.BackColor[=color]

Data Type

Long

Remarks

Use the 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).

The default value is light gray -- RGB (192, 192, 192).

The color specified should be different from the color set by the HighlightColor property to ensure the highlight remains visible against the background.

Do not confuse this property with the ThumbBackColor property, which sets the color of the background of the thumbnail boxes.

See Also

HighlightColor property

ThumbBackColor property


BorderStyle Property

Returns or sets if the control is displayed with or without a border.

Applies To

Image Thumbnail control

Syntax

object.BorderStyle[=value]

Data Type

Integer (enumerated)

Setting

Description

0 | No border is displayed.
1 (default) | A single line, fixed size border is displayed.

Remarks

This property can only be set at design time.


FirstSelectedThumb Property

Returns the page number of the first selected thumbnail.

Applies To

Image Thumbnail control

Syntax

object.FirstSelectedThumb

Data Type

Long

Remarks

Available at run-time as read-only.

The value will be in the range 0 (zero) to ThumbCount, inclusive.

A value of 0 (zero) indicates there are no thumbnails selected.


HighlightColor Property

Returns or sets the color of the highlight that is applied to selected thumbnail boxes.

Applies To

Image Thumbnail control

Syntax

object.HighlightColor[=color]

Data Type

Long

Remarks

The highlight appears only if the HighlightSelectedThumbs property is set to True.

Use the 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).

The default value is black -- RGB (0, 0, 0).

The color specified should be different from the color set by the BackColor property to ensure the highlight remains visible against the background.

See Also

BackColor property

ThumbBackColor property

HighlightSelectedThumbs property


HighlightSelectedThumbs Property

Returns or sets whether a highlight will be displayed around selected thumbnails.

Applies To

Image Thumbnail control

Syntax

object.HighlightSelectedThumbs[={True|False}]

Data Type

Boolean

Setting

Description

True (default) | Selected thumbnails highlight is displayed.
False | Selected thumbnails highlight is not displayed.


Image Property

Returns or sets which image file's thumbnails are displayed.

Applies To

Image Thumbnail control

Syntax

object.Image[=filename]

Data Type

String

Remarks

An empty string is a valid value that resets the control so that no thumbnails are displayed.

Specifying a new image or respecifying the current image forces the following changes:

The thumbnails of the image are displayed with the thumbnail of the first page located in the upper-left corner of the control.

SelectedThumbCount property value is reset to (0).

FirstSelectedThumb property value is reset to (0).

LastSelectedThumb property value is reset to (0).

ThumbCount property value is reset to the number of pages in the specified file.

Each element in the ThumbSelected[PageNumber] array is reset to False.

See Also

Image topics in Imaging Concepts

FirstSelectedThumb property

LastSelectedThumb property

SelectedThumbCount property

ThumbCount property

ThumbSelected[PageNumber] property


LastSelectedThumb Property

Returns the page number of the last selected thumbnail.

Applies To

Image Thumbnail control

Syntax

object.LastSelectedThumb

Data Type

Long

Remarks

Available at run-time as read-only.

The value will be in the range 0 (zero) to ThumbCount, inclusive.

A value of 0 indicates there are no thumbnails selected.


MouseIcon Property

Returns or sets the cursor displayed when a custom MousePointer is used.

Applies To

Image Thumbnail control

Syntax

object.MouseIcon[=Picture]

Data Type

Picture

Remarks

Only ICO and CUR file types are supported.

See Also

MousePointer property


MousePointer Property

Returns or sets the type of mouse cursor displayed when the cursor is positioned over the control.

Applies To

Image Thumbnail control

Syntax

object.MousePointer[=integer]

Data Type

Integer (enumerated)

Setting

Description

0 (default) | Default (For this control, the default is 'Arrow')
1 | Arrow
2 | Cross
3 | I-Beam
4 | Arrow
5 | Size
6 | Size NESW
7 | Size NS
8 | Size NW SE
9 | Size W E
10 | Up Arrow
11 | Hourglass
12 | No Drop
13 | Arrow and Hourglass
14 | Arrow and Question mark
15 | Size All
99 | Custom pointer specified by this property

See Also

MouseIcon property


ScrollDirection Property

Returns or sets the scrolling direction.

Applies To

Image Thumbnail control

Syntax

object.ScrollDirection[= {0|1}]

Data Type

Integer (enumerated)

Setting

Description

0 | Displays a horizontal scrollbar.
1 (default) | Displays a vertical scrollbar.

Remarks

The scrollbar will be displayed in the direction selected, when required, to accommodate more thumbnails.

Note that either horizontal or vertical scroll may be specified, but not both.


SelectedThumbCount Property

Returns the number of thumbnails currently selected.

Applies To

Image Thumbnail control

Syntax

object.SelectedThumbCount

Data Type

Long

Remarks

Available at run-time as read-only.

The value will be in the range 0 (zero) to ThumbCount, inclusive.

A value of 0 (zero) means that no thumbnails are currently selected. This is the default value set each time a new image is specified by the Image property.

See Also

Image property


ThumbBackColor Property

Returns or sets the background color of the thumbnail boxes.

Applies To

Image Thumbnail control

Syntax

object.ThumbBackColor[=color]

Data Type

Long

Remarks

Use the 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).

The default value is dark gray -- RGB (128, 128, 128).

Do not confuse this property with the BackColor property, which sets the color for the control's entire background.

See Also

BackColor property

HighlightColor property


ThumbCaption Property

Returns or sets the optional custom caption used with the ThumbCaptionStyle property.

Applies To

Image Thumbnail control

Syntax

object.ThumbCaption[=caption]

Data Type

String

Remarks

Lets you customize the caption beneath each thumbnail.

Used when the ThumbCaptionStyle property specifies that captions are to be displayed.

You can use the ThumbCaptionFont property and ThumbCaptionColor property to alter the appearance of captions.

You can use the reserved characters # (number sign) to represent the thumbnail's page number, and * (asterisk) to represent the total number of thumbnails. For example, the captions 'Page 1 of 20', 'Page 2 of 20', and so on, can be displayed by specifying the string 'Page # of *'.

See Also

ThumbCaptionColor property

ThumbCaptionFont property

ThumbCaptionStyle property


ThumbCaptionColor Property

Returns or sets the color of caption labels displayed beneath thumbnails.

Applies To

Image Thumbnail control

Syntax

object.ThumbCaptionColor[=color]

Data Type

Long

Remarks

Use the 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).

The default value is black -- RGB (0, 0, 0).

You can use the ThumbCaptionFont property and ThumbCaptionStyle property to alter the appearance of captions.

See Also

ThumbCaptionFont property

ThumbCaptionStyle property


ThumbCaptionFont Property

Returns or sets the font used to display captions.

Applies To

Image Thumbnail control

Syntax

object.ThumbCaptionFont[=font]

Data Type

OLEFONT

Remarks

The default font is MS Sans Serif, regular weight, 12 point; no italic, underline, or strikethrough.

See Also

ThumbCaptionColor property

ThumbCaptionStyle property


ThumbCaptionStyle Property

Returns or sets the type of caption that appears beneath each thumbnail. You can also choose not to display captions.

Applies To

Image Thumbnail control

Syntax

object.ThumbCaptionStyle[=integer]

Data Type

Integer (enumerated)

Setting

Description

0 | No captions beneath the thumbnails.
1 (default) | Page number, left justified, beneath each thumbnail.
2 | Same as Setting 1, but also includes a graphic before the caption for those thumbnail pages whose image file pages have annotations present.
3 | The string set by the property ThumbCaption is displayed, left justified, beneath the thumbnail.
4 | Same as Setting 3, but also includes a graphic before the caption for those thumbnail pages whose image file pages have annotations present.

Remarks

You can use the ThumbCaptionColor and ThumbCaptionFont properties to alter the appearance of captions.

Note that any captions displayed are clipped to the width of the thumbnail box.

See Also

ThumbCaption property

ThumbCaptionColor property

ThumbCaptionFont property


ThumbCount Property

Returns the total number of pages present in the current image file.

Applies To

Image Thumbnail control

Syntax

object.ThumbCount

Data Type

Long

Remarks

Available at run-time as read-only.

ThumbCount is recalculated each time a valid image is specified, or when either of the methods InsertThumbs or DeleteThumbs is executed.

See Also

DeleteThumbs method

Image property

InsertThumbs method


ThumbHeight Property

Returns or sets the height of thumbnail boxes.

Applies To

Image Thumbnail control

Syntax

object.ThumbHeight[=value]

Data Type

Long

Remarks

Used with the ThumbWidth property to specify the size of the displayed thumbnail boxes.

Specify a height between 50 and 500 (pixels).

The default value of 110, used with the ThumbWidth property default value of 85, produces a close representation of a standard letter-sized sheet.

If the thumbnail box size is altered, new thumbnail representations must be generated for all pages of the specified image file. This is equivalent to calling the ClearThumbs method or respecifying the Image property.

See Also

ThumbWidth property

UISetThumbSize method


ThumbSelected[PageNumber] Property

Returns or sets the selection status of the specified thumbnail.

Applies To

Image Thumbnail control

Syntax

object.ThumbSelected[PageNumber][={True|False}]

Data Type

ThumbSelected | Boolean
PageNumber | Long

ThumbSelected

Setting

Description

True | The thumbnail is selected.
False (default for each item in the array) | The thumbnail is not selected.

Remarks

Valid PageNumber values must be between 1 and the current value of the ThumbCount property (inclusive).

If the HighlightSelectedThumbs property is set to True, selected thumbnails will display a border of the color set in the HighlightColor property.

See Also

DeselectAllThumbs method

FirstSelectedThumb property

HighlightColor property

HighlightSelectedThumbs property

LastSelectedThumb property

SelectAllThumbs method

SelectedThumbCount property


ThumbWidth Property

Returns or sets the width of the thumbnail boxes.

Applies To

Image Thumbnail control

Syntax

object.ThumbWidth[=value]

Data Type

Long

Remarks

Used with the ThumbHeight property to specify the size of the displayed thumbnail boxes.

Specify a width between 50 and 500 (pixels).

The default value of 85, used with the ThumbHeight default value of 110, produces a close representation of a standard letter sized sheet.

If the thumbnail box size is altered, new thumbnail representations must be generated for all pages of the specified image file. This is equivalent to calling the ClearThumbs method or respecifying the Image property

See Also

ThumbHeight property

UISetThumbSize method


Methods

The Image Thumbnail control uses the following Methods:

AboutBox | GetMinimumSize
ClearThumbs | GetScrollDirectionSize
DeleteThumbs | InsertThumbs
DeselectAllThumbs | Refresh
DisplayThumbs | ScrollThumbs
GenerateThumb | SelectAllThumbs
GetMaximumSize | UISetThumbSize


ClearThumbs Method

Clears the buffered thumbnail representations of one or all pages.

Applies To

Image Thumbnail control

Syntax

object.ClearThumbs pagenumber

Arguments

Parameter

Data Type

Description

PageNumber

Long

Optional. If a value is not specified, a default value of 0 (zero) is assumed. The value 0 clears all pages.

The one (1) relative page number that corresponds to the page whose thumbnail will be cleared.

Remarks

Thumbnails that have been cleared will be regenerated either when needed for display, or by calling the GenerateThumb method.


DeleteThumbs Method

Notifies the Thumbnail control that pages have been deleted from the image whose thumbnails are currently displayed.

Applies To

Image Thumbnail control

Syntax

object.DeleteThumbs DeleteAt, DeleteCount

Arguments

Parameter

Data Type

Description

DeleteAt | Long | The one (1) relative page number of the first page deleted. Valid values are in the range 1 to ThumbCount.
DeleteCount | Long | Optional. The number of pages to be deleted. If a value is not specified, a default value of 1 is used.

Remarks

The pages must be removed from the image file itself prior to calling this method. This can be done by first calling the Admin control's DeletePages method.

DeleteThumbs preserves the integrity of the control's internal mapping of displayed thumbnails and the pages of the specified image file. If pages are deleted from the displayed image, and this method is not called, the thumbnails displayed will not reflect the change.

This method refreshes the control's display.

See Also

DeletePages method, Wang Image Admin control


DeselectAllThumbs Method

Deselects all thumbnails.

Applies To

Image Thumbnail control

Syntax

object.DeselectAllThumbs

Remarks

This method is equivalent to setting each item in the ThumbSelected[ ] array to False.

See Also

ThumbSelected[PageNumber] property


DisplayThumbs Method

Displays thumbnails using specified options.

Applies To

Image Thumbnail control

Syntax

object.DisplayThumbs ThumbNumber, Option

Arguments

Parameter

Data Type

Description

ThumbNumber | Long | Optional. The number of the Thumbnail whose position will be set. If a value is not specified, a default value of 1 is used, and the Option parameter cannot be specified.
Option | Integer | Optional. Sets the position of the specified Thumbnail within the control. If no value is specified, a default value of 0 (zero) is used. Allowable values are:

Setting

Description

0 | Thumbnail box is displayed in the top row (for vertical scrolling).
0 | Thumbnail box is displayed in leftmost column (for horizontal scrolling).
1 | Thumbnail box is displayed in the middle row.
2 | Thumbnail box is displayed in the bottom row (for vertical scrolling).
2 | Thumbnail box is displayed in the rightmost column (for horizontal scrolling).

Remarks

This method refreshes the control's display.

Note that it is not necessary to call this method after setting the Image property to initiate a display of the specified image file's thumbnails.


GenerateThumb Method

Forces the generation or regeneration of the specified image's thumbnail representation.

Applies To

Image Thumbnail control

Syntax

object.GenerateThumb Option, PageNumber

Arguments

Parameter

Data Type

Description

Option

Integer

Indicates when the Thumbnail of a specified page should be generated. Allowable values are:

Setting

Description

0

Generates a thumbnail if one has not already been obtained.

Not specifying a PageNumber, or specifying a PageNumber of 0 causes all pages that have not been obtained to be generated.

1

Causes the thumbnail to be generated immediately. If the thumbnail was previously generated, a new one will be obtained.

Not specifying a PageNumber, or specifying a PageNumber of 0 causes all pages that have not been obtained to be generated.

PageNumber

Long

Optional. The number of the page for which a Thumbnail will be generated. If a value is not specified, a default value of 0, to indicate that ALL pages are to be generated, is used.

Remarks

This method should be called to reflect any changes made to the image file after a previous thumbnail was generated.

It is not always necessary to obtain new thumbnails (Option=1). Thumbnail images that have been generated during the current session remain buffered, even though they may not be displayed.

Use caution when using a PageNumber of 0. Resulting operations can be lengthy.


GetMaximumSize Method

Determines the largest non-scrolling control dimension that can be used to display a specified number of thumbnail boxes.

Applies To

Image Thumbnail control

Syntax

object.GetMaximumSize(ThumbCount, ScrollBar)

Arguments

Parameter

Data Type

Description

ThumbCount | Long | The number of thumbnail boxes desired in the non-scrolling direction.
ScrollBar | Boolean | Indicates whether or not the size value returned allows space for a scroll bar. True -- Allows space for a scroll bar. False -- Does not allow space for a scroll bar.

Return Value

Long

The maximum control size, in pixels, needed to accommodate the number of thumbnail boxes specified by the ThumbCount parameter.

Remarks

GetMaximumSize uses the current values of the ScrollDirection, ThumbHeight, and ThumbWidth properties to calculate this value.

GetMaximumSize and GetMinimumSize should be used together to determine a range of control sizes that allow for a display that fits the required number of thumbnails in the non-scrolling dimension.

A control size larger than this dimension in the non-scrolling direction will contain space for more than the specified number of thumbnails.

Once a control size is determined (based on the results of GetMaximumSize and GetMinimumSize), a call to the GetScrollDirectionSize method may be used to calculate the size required in the scrolling direction to display a specified number of thumbnails.

See Also

GetMinimumSize method

GetScrollDirectionSize method

ScrollDirection property

ThumbHeight property

ThumbWidth property


GetMinimumSize Method

Determines the smallest non-scrolling control dimension that can be used to display a specified number of thumbnail boxes.

Applies To

Image Thumbnail control

Syntax

object.GetMinimumSize(ThumbCount, ScrollBar)

Arguments

Parameter

Data Type

Description

ThumbCount | Long | The number of thumbnail boxes desired in the non-scrolling direction.
ScrollBar | Boolean | Indicates whether or not the size value returned allows space for a scroll bar. True -- Allows space for a scroll bar. False -- Does not allow space for a scroll bar.

Return Value

Long

The minimum control size needed to accommodate the number of thumbnail boxes specified by the ThumbCount parameter.

Remarks

GetMinimumSize uses the current values of the ScrollDirection, ThumbHeight, and ThumbWidth properties to calculate this value.

GetMaximumSize and GetMinimumSize should be used together to determine a range of control sizes that allow for a display that fits the required number of thumbnails in the non-scrolling dimension.

A control size smaller than this dimension in the non-scrolling direction will contain space for fewer than the specified number of thumbnails.

Once a control size is determined (based on results of GetMaximumSize and GetMinimumSize), a call to the GetScrollDirectionSize method may be used to calculate the size required in the scrolling direction to display a specified number of thumbnails.

See Also

GetMaximumSize method

GetScrollDirectionSize method

ScrollDirection property

ThumbHeight property

ThumbWidth property


GetScrollDirectionSize Method

Determines what the control size has to be, in the scrolling dimension, to display a specified number of thumbnails.

Applies To

Image Thumbnail control

Syntax

object.GetScrollDirectionSize(ScrollDirectionThumbCount, NonScrollDirectionThumbCount, NonScrollDirectionSize, ScrollBar)

Arguments

Parameter

Data Type

Description

ScrollDirectionThumbCount | Long | The number of thumbnail boxes desired in the scrolling direction.
NonScrollDirectionThumbCount | Long | The number of thumbnail boxes desired in the non-scrolling direction.
NonScrollDirectionSize | Long | The size of the control's area, in pixels, in the non-scrolling dimension for which a corresponding scroll direction size is desired.
ScrollBar | Boolean | Indicates whether or not the size specified for NonScrollDirectionSize allows space for a scroll bar. True -- Allows space for a scroll bar. False -- Does not allow space for a scroll bar.

Return Value

Long

Returns the control size, in pixels, needed to accommodate the number of thumbnail boxes specified by the parameter ScrollDirectionThumbCount in the scrolling direction.

Remarks

If NonScrollDirectionSize is determined by first calling the GetMaximumSize and GetMinimumSize methods, GetScrollDirectionSize can calculate the size and scrolling direction required to display a specified number of thumbnails.

The value of the argument NonScrollDirectionThumbCount must be the same value passed as the argument ThumbCount to the GetMaximumSize and GetMinimumSize methods.

The value of the argument ScrollBar must be the same in the GetMaximumSize, GetMinimumSize, and GetScrollDirectionSize methods.

See Also

GetMinimumSize method

GetMaximumSize method

ThumbWidth property

ThumbHeight property

ScrollDirection property


InsertThumbs Method

Informs the Thumbnail control that pages have been inserted into the currently displayed image file.

Applies To

Image Thumbnail control

Syntax

object.InsertThumbs InsertBeforeThumb, InsertCount

Arguments

Parameter

Data Type

Description

InsertBeforeThumb | Long | Optional. The page number of the thumbnail before which the new thumbnails will be inserted. A value of 1 means the thumbnails will be inserted before the first page. A value of ThumbCount+1 means the thumbnails will be inserted after the last page. If InsertBeforeThumb is not specified, the default value of ThumbCount+1 is used, and the InsertCount parameter cannot be set.
InsertCount | Long | Optional. The number of pages inserted. If a value is not specified, the default value of 1 is used.

Remarks

The pages must be inserted into the image file itself prior to calling this method. This can be done by first calling the Admin control's Insert method.

InsertThumbs preserves the integrity of the control's internal mapping of displayed thumbnails and the pages of the specified image file. If pages are inserted into the displayed image file and this method is not called, the thumbnails displayed will not reflect the change.

This method refreshes the control's display.

See Also

InsertThumbs method

Insert method, Wang Image Admin control

ThumbCount property


Refresh Method

Repaints the control.

Applies To

Image Thumbnail control

Syntax

object.Refresh

Arguments

None

Remarks

If the control has an active window, the refresh occurs synchronously. Otherwise, the control is refreshed asynchronously.

This method refreshes the control's display.


ScrollThumbs Method

Specifies a direction and amount for scrolling.

Applies To

Image Thumbnail control

Syntax

object.ScrollThumbs(Direction, Amount)

Arguments

Parameter

Data Type

Description

Direction

Integer

Specifies the direction of scroll.

A value of 0 (zero) scrolls the control towards the last thumbnail.

A value of 1 scrolls the control towards the first thumbnail.

Amount

Integer

Specifies the amount of scroll desired.

A value of 0 (zero) scrolls in the requested direction by almost a full control screenful. A small amount of original screen area is left to serve as a reference.

The amount scrolled is equivalent to the amount scrolled when you click in the scroll bar (between the up / down arrows and the scroll box).

A value of 1 scrolls the control in the requested direction by a small amount.

The amount scrolled is equivalent to the amount scrolled when you click the scroll bar's up or down arrow box once.

Return Value

Boolean

The return value indicates if the control was scrolled.

Setting

Description

True | The scroll was performed.
False | The scroll was not performed (for example, if the scroll was at either end of its scrolling limit and could not scroll any further).

See Also

ScrollDirection property


SelectAllThumbs Method

Selects all thumbnails.

Applies To

Image Thumbnail control

Syntax

object.SelectAllThumbs

Remarks

This method is equivalent to setting each item in the ThumbSelected[ ] array to True.

See Also

ThumbSelected[ ] property


UISetThumbSize Method

Displays a dialog box from which a user can set the width and height of the thumbnail box.

Applies To

Image Thumbnail control

Syntax

object.UISetThumbSize(Image, PageNumber)

Arguments

Parameter

Data Type

Description

Image

String

Optional. Used with the PageNumber parameter to specify the name and page of the image file to be displayed in the sample thumbnail.

If not specified, the default value of an empty string will be used, and an image will not be displayed.

PageNumber

Long

Optional. Used with the Image parameter to specify the name and page of the image file to be displayed in the sample thumbnail.

If a value is not specified, a default value of 1 is used.

Return Value

Boolean

Setting

Description

True | The dialog box was dismissed with the OK button, generally indicating new values have been set for the ThumbHeight and ThumbWidth properties.
False | The dialog box was dismissed with the CANCEL button, indicating the values for the ThumbHeight and ThumbWidth properties are unchanged.

Remarks

If the thumbnail box size is altered, new thumbnail representations must be generated for all pages of the specified image file. This is equivalent to calling the ClearThumbs method or respecifying the Image property.

See Also

ClearThumbs method


Events

The Events used by the Thumbnail control are all standard.

*Click | *MouseDown
*DblClick | *MouseMove
KeyDown | *MouseUp
KeyUp |

Events with an asterisk (*) use the additional argument ThumbNumber.

Argument

Parameter

Data Type

Description

ThumbNumber

Long

The number of the thumbnail on which the event occurred. This parameter is 1 relative (that is, a value of 1 means the event occurred on the thumbnail for page 1).

A 0 (zero) value means an event occurred on the control, but not on a thumbnail.


Imaging for Windows 95 OLE Automation

Release 1.0

2nd Edition — July 1996

Copyright © Wang Laboratories, Inc., 1996

All rights reserved.

WANG LABORATORIES, INC.

600 Technology Park Drive · Billerica, MA 01851-4130 · TEL. (508) 459-5000, TELEX 172108


Disclaimer of Warranties and Limitation of Liabilities

The staff of Wang Laboratories, Inc., has taken due care in preparing this manual. However, nothing contained herein modifies or alters in any way the standard terms and conditions of the Wang purchase, lease, or license agreement by which the product was acquired, nor increases in any way Wang's liability to the customer. In no event shall Wang or its subsidiaries be liable for incidental or consequential damages in connection with or arising from the use of the product, the accompanying manual, or any related materials.


Software Notice

All Wang Program Products (software) are licensed to customers in accordance with the terms and conditions of the Wang Standard Software License. No title or ownership of Wang software is transferred, and any use of the software beyond the terms of the aforesaid license, without written authorization of Wang, is prohibited.


Restricted Rights Legend

Use, duplication, or disclosure by the Government of this technical data is subject to restrictions stated in paragraph (A) (15) of the Rights in Technical Data and Computer Software clause at 48-CFR-252-227-7013.

Microsoft and Windows are registered trademarks of Microsoft Corporation.

Other product names mentioned in this guide may be trademarks or registered trademarks of their respective companies.


Overview

This chapter describes the OLE Automation component of Wang's Imaging for Windows 95 product set. Imaging OLE Automation allows you to access Imaging objects programmatically using Visual Basic or any other application that supports OLE automation.

Using Imaging OLE Automation you can:

  • Open and manage the Imaging application window
  • Display and print image files
  • Perform various actions on image files, such as rotating, flipping, editing, saving, and deleting files

Contents

  • The Object Hierarchy
  • Coordination of Automation and the Imaging Application
  • Example of Imaging Automation


The Object Hierarchy

The Imaging OLE Automation object model includes one top-level object (the Application object) and one document object (the ImageFile object). The Application object is added to the system registry the first time you start the Imaging application. In addition, there are two supporting objects, Page and PageRange, for the ImageFile object.

Imaging OLE Automation exposes only the Application object for creation. Other programmable objects are created or deleted by referencing the Application object.


Coordination of Automation and the Imaging Application

Automation is not aware of changes made interactively by an end-user in the Imaging application. The objects known to automation stay in the same state in which they were left programmatically. If an end-user changes a displayed object, automation does not update this object in its Application object. For example, if the end-user changes the active page, automation does not update the ActivePage property. However, properties and methods are available so that you can determine if a change has occurred, and you can update the objects known to automation, if desired.


Example of Imaging for Windows 95 Automation

The following code demonstrates how to create the Imaging application window as a stay-on-top object. It also shows how to create and perform actions on an image object displayed in the window, and how to close the image file and exit from the application.

'Declare the Application object and the ImageFile object

'as variables of type Object

Dim App As Object

Dim Img As Object

'Create the Application object (Standard VB call)

Set App = CreateObject("WangImage.Application")

'Create the ImageFile object

Set Img = App.CreateImageViewerObject(1)

'Set the application's TopWindow property to TRUE

'(stay on top)

App.TopWindow = True

'Call the ImageFile object Open Method to display page 1

'of myimage.tif

Img.Open "c:\images\myimage.tif", True, 1

'Create and rotate one Page object

Img.Pages(1).RotateLeft

'Return the height of the image from the Page object

x = Img.Pages(1).Height

'Create a PageRange object and print pages 1 and 2

y = Img.Pages(1,2).Print

'Display page 2 of the image

Img.ActivePage = 2

'Close ImageFile object

Img.Close

'Quit the application

App.Quit


The Application Object

The Application object is a top-level object that controls every other object you create. The Application object also allows you to set the environment, for example, you can control the size and position of the Imaging application window, and the visibility of scroll bars, the status bar, and the toolbar.


Application Object Properties

Table 2.1 lists the Application object properties. Note that the properties that affect the displayed image (for example, DisplayScaleAlgorithm, ImagePalette, and Zoom) affect every image displayed in the Application object.

Table 2.1 Application Object Properties

Property | Description
ActiveDocument | Returns the active ImageFile object.
AnnotationPaletteVisible | Sets or returns the visibility of the application's annotation palette.
Application | Returns the Application object.
DisplayScaleAlgorithm | Sets or returns the scaling algorithm used for displaying images.
Edit | Sets or returns the application's ability to edit the displayed object.
FullName | Returns the file specification for the Application object.
Height | Sets or returns the distance between the top and bottom edge of the application window.
ImagePalette | Sets or returns the image palette used for image display.
ImageView | Sets or returns the present image view.
Left | Sets or returns the distance between the left edge of the physical screen and the main application window.
Name | Returns the name of the Application object.
Parent | Returns the Application object.
Path | Returns the path specification for this application's executable file.
ScrollBarsVisible | Sets or returns the visibility of the application's scroll bars.
StatusBarVisible | Sets or returns the visibility of the application's status bar.
ToolBarVisible | Sets or returns the visibility of the application's toolbar.
Top | Sets or returns the distance between the top edge of the physical screen and application's window.
TopWindow | Sets or returns the application's top window flag.
Visible | Returns the visibility of the application.
Width | Sets or returns the distance between the left and right edges of the application's window.
Zoom | Sets or returns the zoom factor for image display.


ActiveDocument Property

Description

Returns the active ImageFile object in the Application object. Read-only property.

Usage

ApplicationObject.ActiveDocument

Data Type

Object

Example

This example returns the ImageFile object in the application.

Dim Img as Object
Set Img = App.ActiveDocument


AnnotationPaletteVisible Property

Description

Sets or returns the visibility of the annotation palette. Read/write property.

Usage

ApplicationObject.AnnotationPaletteVisible = [{True|False}]

Data Type

Integer (Boolean)

Remarks

The AnnotationPaletteVisible property settings are:

Setting | Description
True | (Default) The annotation palette is visible.
False | The annotation palette is not visible.


Application Property

Description

Returns the Application object. Read-only property.

Usage

ApplicationObject.Application

Data Type

Object

Example

This example returns the Application object.

Dim Parent As Object
Set Parent = App.Application


DisplayScaleAlgorithm Property

Description

Sets or returns the scaling algorithm used for displaying images. Read/write property.

Usage

ApplicationObject.DisplayScaleAlgorithm = [setting]

Data Type

Short

Remarks

The DisplayScaleAlgorithm property settings are:

Setting | Description
0 | (Default) Normal decimation.
1 | Gray4. 4-bit gray scale. 16 shades of gray.
2 | Gray8. 8-bit gray scale. 256 shades of gray.
3 | Stamp. Represents the image as a thumbnail.
4 | Optimize. Changes the display scale algorithm based on the image type of the displayed image.

Note The DisplayScaleAlgorithm property must be set prior to opening the ImageFile object. For this property to take effect after an image is open, you must reopen the image.


Edit Property

Description

Sets or returns the Application object's ability to edit the displayed object. It is recommended to set the Edit property prior to opening each ImageFile object. Read/write property.

Usage

ApplicationObject.Edit = [{True|False}]

Data Type

Integer (Boolean)

Remarks

The Edit property settings are:

Setting | Description
True | (Default) Image editing is available.
False | The displayed object cannot be changed.

Note You must set the Edit property prior to opening the ImageFile object. You can only set the Edit property once.


FullName Property

Description

Returns the file specification for the Application object, including the path. Read-only property.

Usage

ApplicationObject.FullName

Data Type

String


Height Property

Description

Sets or returns the distance between the top and bottom edge of the Application object's window in pixels. Read/write property.

Usage

ApplicationObject.Height = [setting]

Data Type

Long

Remarks

The Height property must be set prior to opening the ImageFile object. This property only takes effect if the Width, Top, and Left properties are also set. If you set the Height property to less than the minimum allowable window size, the value is ignored. The minimum setting is usually 27.

The Height property only returns the value that you set programmatically prior to opening the window. It does not return changes made to the window after it has been opened.


ImagePalette Property

Description

Sets or returns the image palette used to display an image. Read/write property. The ImagePalette property must be set prior to opening the ImageFile object. For this property to take effect after an image is open, you must reopen the image.

Usage

ApplicationObject.ImagePalette = [setting]

Data Type

Short

Remarks

The ImagePalette property settings are:

Setting | Description
0 | (Default) Custom
1 | Common
2 | Gray8 (256 shades of gray)
3 | RGB24 (millions of colors)
4 | Black and white


ImageView Property

Description

Sets or returns the present image view. Read/write property.

Usage

ApplicationObject.ImageView = [setting]

Data Type

Short

Remarks

The ImageView property settings are:

Setting | Description
0 | (Default) One page view
1 | Thumbnails view
2 | Page and Thumbnails view

The ImageView property and the ImageFileObject.ActivePage property have the following relationships:

View | Relationship
One Page | (Default) The active page is displayed
Thumbnails | The active page appears in thumbnail view
Page and Thumbnails | The active page is the page that is displayed

See Also

ImageFileObject.ActivePage property


Left Property

Description

Sets or returns the distance between the left edge of the physical screen and the Application object's window in pixels. Read/write property.

Usage

ApplicationObject.Left = [setting]

Data Type

Long

Remarks

The Left property must be set prior to opening the ImageFile object. This property only takes effect if the Height, Width, and Top properties are also set.

The Left property only returns the value that you set programmatically prior to opening the window. It does not return changes made to the window after it has been opened.


Name Property

Description

Returns the name of this Application object. Read-only property. Value Property.

Usage

ApplicationObject.Name

Data Type

String


Parent Property

Description

Returns the parent of the Application object. Read-only property.

Usage

ApplicationObject.Parent

Data Type

Object


Path Property

Description

Returns the path specification for the Application object's executable file. Read-only property.

Usage

ApplicationObject.Path

Data Type

String


ScrollBarsVisible Property

Description

Sets or returns the visibility of the Application object's scroll bars. Read/write property.

Usage

ApplicationObject.ScrollBarsVisible = [{True|False}]

Data Type

Integer (Boolean)

Remarks

The ScrollBarsVisible property settings are:

Setting | Description
True | (Default) Scroll bars are visible
False | Scroll bars are not visible

Note The ScrollBarsVisible property must be set prior to opening the ImageFile object. For this property to take effect after an image is open, you must reopen the image.


StatusBarVisible Property

Description

Sets or returns the visibility of this Application object's status bar. Read/write property.

Usage

ApplicationObject.StatusBarVisible = [{True|False}]

Data Type

Integer (Boolean)

Remarks

The StatusBarVisible property settings are:

Setting | Description
True | (Default) Status bar is visible
False | Status bar is not visible


ToolBarVisible Property

Description

Sets or returns the visibility of this Application object's toolbar. Read/write property.

Usage

ApplicationObject.ToolBarVisible = [{True|False}]

Data Type

Integer (Boolean)

Remarks

The ToolBarVisible property settings are:

Setting | Description
True | (Default) Toolbar is visible
False | Toolbar is not visible


Top Property

Description

Sets or returns the distance between the top edge of the physical screen and main application window in pixels. Read/write property.

Usage

ApplicationObject.Top

Data Type

Long

Remarks

The Top property must be set prior to opening the ImageFile object. This property only takes effect if the Height, Width, and Left properties are also set.

The Top property only returns the value that you set programmatically prior to opening the window. It does not return changes made to the window after it has been opened.


TopWindow Property

Description

Sets or returns this Application object's top window flag. Read/write property.

Usage

ApplicationObject.TopWindow = [{True|False}]

Data Type

Integer (Boolean)

Remarks

The TopWindow property settings are:

Setting | Description
True | The application is a stay-on-top window
False | (Default) The application is not a stay-on-top window

Example

This example makes the application window a stay-on-top window.

App.TopWindow = True


Visible Property

Description

Returns the visibility of the Application object. Read-only property.

Usage

ApplicationObject.Visible

Data Type

Integer (Boolean)

Remarks

The Visible property settings are:

Setting | Description
True | The application is visible.
False | The application is not visible.


Width Property

Description

Sets or returns the distance between the left and right edges of the Application object's window in pixels. Read/write property.

Usage

ApplicationObject.Width = [setting]

Data Type

Long

Remarks

The Width property must be set prior to opening the ImageFile object. This property only takes effect if the Top, Left, and Height properties are also set. If you set the Width property to less than the minimum allowable window size, the value is ignored. The minimum setting is usually 112.

The Width property only returns the value that you set programmatically prior to opening the window. It does not return changes made to the window after it has been opened.


Zoom Property

Description

Sets or returns the zoom factor used for displaying images. Read/write property.

Usage

ApplicationObject.Zoom = [setting]

Data Type

Float

Remarks

The zoom factor is a percent value.

Example

This example sets the zoom factor to 100%.

App.Zoom = 100

This example returns the current zoom factor.

x = App.Zoom

Note The ScrollBarsVisible property must be set prior to opening the ImageFile object. For this property to take effect after an image is open, you must reopen the image.


Application Object Methods

Table 2.2 lists the Application object methods.

Table 2.2 Application Object Methods

Method | Description
CreateImageViewerObject | Creates an Imaging object of the specified class.
Help | Displays online Help.
Quit | Exits this application and closes all open objects.
FitTo | Displays the image at the specified zoom option.


CreateImageViewerObject Method

Description

Creates and returns an ImageFile object. The ImageFile object is empty, with no image file associated with it. Use the object's Open or New method to associate a specific image file.

Syntax

ApplicationObject.CreateImageViewerObject(objectclass)

Data Type

Object

Remarks

The only object supported by this method is the ImageFile object, for which the setting is 1.

Example

This example creates an ImageFile object.

Dim Img as Object
Set Img = App.CreateImageViewerObject(1)


FitTo Method

Description

Displays the current image at the specified zoom option. This method updates the Application object's zoom property with the actual zoom factor.

This method affects each view as follows:

View | Display
One Page | The page is zoomed.
Thumbnails | No affect. However, the Application property is changed and will affect other views when they are used.
Page & Thumbnails | The page is zoomed. There is no affect on thumbnails.

Syntax

ApplicationObject.FitTo zoomoption

Data Type

Short

Remarks

ZoomOption settings are:

Setting | Description
1 | Best fit.
2 | Fit to width.
3 | Fit to height.
4 | Actual size.


Help Method

Description

Displays the Imaging online Help table of contents.

Syntax

ApplicationObject.Help


Quit Method

Description

Closes all open objects and exits the application. The Application object is no longer active or available.

Syntax

ApplicationObject.Quit


ImageFile Object

An ImageFile object represents an image file. An ImageFile object can have:

  • One Page object, representing the currently displayed page of the ImageFile object.
  • One or more PageRange objects, each representing different and possibly overlapping page ranges.


ImageFile Object Properties

Table 3.1 lists the ImageFile object properties.

Table 3.1 ImageFile Object Properties

Property | Description
ActivePage | Sets or returns the ImageFile object's current page number.
Application | Returns the Application object.
FileType | Returns the ImageFile object's file type.
Name | Returns the name of the active image file.
PageCount | Returns the number of pages in the ImageFile object.
Parent | Returns the parent of the ImageFile object.
Saved | Returns a flag indicating whether or not the file has ever been saved.


ActivePage Property

Description

Sets or returns the ImageFile object's active page number. Read/write property.

Setting the ActivePage property to a page number causes that page to become active, which updates the display if the Application object is visible. Refer to the Application object's ImageView property for more information about the relationships between the active page and different views of the page.

Page selection and navigation by the end-user have no affect on the ActivePage property. The active page is always the active page according to automation. For more information, refer to the section "Coordination of Automation and the Imaging Application" in Chapter 1.

Usage

ImageFileObject.ActivePage = [setting]

Data Type

Long

Remarks

The number is the page number value.

See Also

ApplicationObject.ImageView property


Application Property

Description

Returns the Application object. Read-only property.

Usage

ImageFileObject.Application

Data Type

Object

Example

This example returns the Application object.

Dim Parent As Object
Set Parent = Img.Application


FileType Property

Description

Returns the file type of this ImageFile object. Read-only property.

Usage

ImageFileObject.FileType

Data Type

Short

Remarks

The FileType property settings are:

Setting | Description
1 | TIFF
2 | AWD
3 | BMP
4 | PCX
5 | DCX
6 | JPEG
7 | XIF


Name Property

Description

Returns a string that contains the name of the active image file. Read-only property.

Usage

ImageFileObject.Name

Data Type

String


PageCount Property

Description

Returns the number of pages in this ImageFile object. Read-only property.

Usage

ImageFileObject.PageCount

Data Type

Long


Parent Property

Description

Returns the parent of the ImageFile object. Read-only property.

Usage

ImageFileObject.Parent

Data Type

Object

Example

This example returns the parent of the ImageFile object.

Dim App As Object
App = Img.Parent


Saved Property

Description

Returns the saved state of the ImageFile object. Read-only property.

Usage

ImageFileObject.Saved

Data Type

Integer (Boolean)

Remarks

The Saved property settings are:

Setting | Description
True | Returns True if the ImageFile object has been saved and it has not changed since it was last saved.
False | Returns False if the ImageFile object has never been saved and it has changed since it was created; or if it has been saved, but has changed since it was last saved.

Example

This example returns the saved state of the file.

x = Img.Saved


ImageFile Object Methods

Table 3.2 lists the ImageFile object methods.

Table 3.2 ImageFile Object Methods

Method | Description
AppendExistingPages | Appends existing pages to the end of the ImageFile object.
Close | Closes the ImageFile object.
Help | Displays online Help.
InsertExistingPages | Inserts existing pages in the ImageFile object.
New | Creates a new blank ImageFile object.
Open | Opens the ImageFile object.
Pages | Returns a Page or PageRange object for the ImageFile object.
Print | Prints the ImageFile object.
RotateAll | Rotates all ImageFile object pages (AWD files only).
Save | Saves changes to the ImageFile object.
SaveAs | Saves the ImageFile object under another name.


AppendExistingPages Method

Description

Appends specified page(s) to the end of the ImageFile object. Page(s) to be appended must come from an existing file. If the page(s) being appended come from an image file of a type different than the active image file, the pages are converted before being appended. After appending page(s), all PageRange objects are invalid. You can optionally display a dialog box that allows the end-user to select a file from which to append page(s).

Syntax

ImageFileObject.AppendExistingPages [imagefile][, pagenumber][, count][, dialogflag]

Remarks

The AppendExistingPages method uses these parts:

Part | Description
imagefile | The image file from which pages will be appended (the source image file).
pagenumber | The page within the source image file from which to start appending pages.
count | The number of pages to append.
dialogflag | If True, displays a dialog box that allows the end-user to select a source image file. The default is False.

Example

This example appends the first page from the file, BW.TIF.

Img.AppendExistingPages "c:\bw.tif", 1

This example appends three pages from a file selected from a dialog box, starting with the first page.

Img.AppendExistingPages "", 1, 3, True


Close Method

Description

Closes the ImageFile object. Closing an ImageFile object deletes it and all Page and PageRange objects associated with it are deleted. The Application object no longer has an ImageFile object associated with it.

Syntax

ImageFileObject.Close [savechangesflag]

Data Type

Integer (Boolean)

Remarks

The Close method savechangesflag argument has the following settings:

Setting | Description
True | Changes are saved when the image file closes.
False | (Default) Changes are not saved when the image file closes.


Help Method

Description

Displays the Imaging online Help table of contents.

Syntax

ImageFileObject.Help


InsertExistingPages Method

Description

Inserts page(s) in the ImageFile object.

Page(s) to be inserted must come from an existing file. If the pages being inserted come from an image file of a type different than the active image file, the pages are converted before being inserted. After inserting page(s), all PageRange objects are invalid. You can optionally cause a dialog box to open for the end-user to select a file from which to insert page(s).

Syntax

ImageFileObject.InsertExistingPages [imagefile][, page][, count]
[, pagenumber][, dialogflag]

Remarks

The InsertExistingPages method uses these parts:

Part | Description
imagefile | The image file from which page(s) will be inserted (the source image file).
page | The page to insert before. Page(s) are inserted before the active page if page is not specified.
count | The number of pages to insert. The default is 1.
pagenumber | The page in the source image file from which to start inserting pages.
dialogflag | If True, displays a dialog box that allows the end-user to select a source image file. The default is False.

Example

This example inserts pages 4 and 5 from the file BW.TIF before page 1.

Img.InsertExistingPages "c:\bw.tif", 1, 2, 4

This example inserts page 2 from a file selected by the end-user from a dialog box before page 1.

Img.InsertExistingPages "", 1, 1, 2, True


New Method

Description

Displays a dialog box that allows the end-user to create a new ImageFile object that contains one blank page.

Creating a new ImageFile object causes the new object to become active. If the active ImageFile object is unsaved, the end-user is prompted to save it before the new object is created.

No image file is associated with the object until you save it. The file type of the new object is the same as the file type of the active object.

Syntax

ImageFileObject.New

Example

This example creates a new image object.

'Create the image object
Dim As Object
Set Img = App.CreateImageViewerObject(1)
'Call the image object New Method
Img.New


Open Method

Description

Opens an image file in the parent application window. This associates an image file with the ImageFile object. If the current image file is unsaved, the end-user is prompted to save it before the new image file is opened.

The Imaging application has the focus after an Open. You can reset focus programmatically after an Open, if desired.

Syntax

ImageFileObject.Open [imagefile][, annotationflag][, pagenumber]
[, dialogflag]

Remarks

The Open method uses these parts:

Part | Description
imagefile | Name string of ImageFile object to open.
annotationflag | If True, if the image has annotations, the annotations are displayed. If False, if the image has annotations, the image is displayed without the annotations. The default is True.
pagenumber | Page number in the image file to display.
dialogflag | If True, displays a dialog box that allows the end-user to select a file to open. The default is False.

See Also

ApplicationObject.Edit


Pages Method

Description

Returns the Page or PageRange object for the ImageFile object.

Syntax

ImageFileObject.Pages(pagenumber [, pagenumber])

Data Type

Object

Remarks

If you specify one page number, this method returns a Page object. If you specify two page numbers, this method returns a PageRange object. To return a range of pages, specify the starting page number and ending page number.

Example

This example returns a Page object and a PageRange object.

Dim Page As Object
Dim PageRange As Object
Set Page = Img.Pages(1)
Set PageRange = Img.Pages(1,3)


Print Method

Description

Prints the image file associated with the ImageFile object. You can optionally display a dialog box to allow the end-user to select the print options.

Syntax

ImageFileObject.Print [dialogflag]

Remarks

The Print method dialogflag argument has the following settings:

Setting | Description
True | Displays a dialog box that allows the end-user to select print file options.
False | (Default) No dialog box is displayed.

Example

This example prints the specified image file.

x = Img.Print


RotateAll Method

Description

Rotates all ImageFile object pages. Pages are rotated clockwise in 90 degree increments. You can only use this method with AWD files.

Syntax

ImageFileObject.RotateAll

Example

This example rotates all pages of the currently displayed image.

Img.RotateAll


Save Method

Description

Saves changes to the ImageFile object. If no image file is associated with the ImageFile object, the SaveAs method is executed instead of the Save method.

Syntax

ImageFileObject.Save


SaveAs Method

Description

Saves the ImageFile object as another ImageFile object. Copies its image file and renames it.

This method allows you to specify the new object's image parameters. If specified, the file can be converted from one type to another. The current image file is closed without being saved and the Save As object becomes the active image file. You can optionally display a dialog box that allows the end-user to name the file for the first time or select a file to overwrite.

Syntax

ImageFileObject.SaveAs [imagefile] [, filetype] [, dialogflag]

DataType

String

Remarks

The SaveAs method uses these parts:

Part | Description
imagefile | The destination's ImageFile object name string.
filetype | Image file type to save to.
dialogflag | If True, displays a dialog box that allows the end-user to enter or select a filename and options for saving the file. The default is False.

The SaveAs method filetype argument settings are:

Setting | Description
1 | TIFF
2 | AWD
3 | BMP
4 | PCX
5 | DCX
6 | JPEG

Example

This example saves a file in TIF format.

Img.SaveAs "picture1.tiff", 1

This example opens a Save As dialog box so that the end-user can name the file for the first time or overwrite an existing file:

Img.SaveAs "", 0, True


Page Object

A Page object represents a page in an ImageFile object. Page objects can only be accessed by using the Pages method of the parent ImageFile object.


Page Object Properties

Table 4.1 lists the Page object properties.

Table 4.1 Page Object Properties

Property | Description
Application | Returns the Application object.
CompressionInfo | Returns the page's compression information.
CompressionType | Returns the page's compression type.
Height | Returns the page's height.
ImageResolutionX | Sets or returns the page's horizontal resolution.
ImageResolutionY | Sets or the returns page's vertical resolution.
Name | Returns the page number of this page.
PageType | Returns the page's image type.
Parent | Returns the parent of the Page object.
ScrollPositionX | Sets or returns this page's horizontal scroll position.
ScrollPositionY | Sets or returns this page's vertical scroll position.
Width | Returns the page's width.


Application Property

Description

Returns the Application object. Read-only property.

Usage

ImageFileObject.Pages(pagenumber).Application

Data Type

Object

Example

This example returns the Application object.

Dim Img As Object
Dim Parent As Object
Set Parent = Img.Pages(1).Application


CompressionInfo Property

Description

Returns this page's compression information. Read-only property.

Usage

ImageFileObject.Pages(pagenumber).CompressionInfo

Data Type

Long

Remarks

The CompressionInfo property settings are:

Setting | Description
1 | EOLs (Include/expect EOLs). Not used for JPEG.
2 | Packed Lines (Byte align new lines). Not used for JPEG.
4 | Prefixed EOLs (Include/expect prefixed EOLs). Not used for JPEG.
8 | Compressed_LTR (Compressed bit order left to right). Not used for JPEG.
16 | Expanded_LTR (Expand bit order left to right). Not used for JPEG.
32 | Negate (Invert black/white on expansion). Not used for JPEG.
64 | Hi_Compression/Hi_Quality (JPEG compression only).
128 | Hi_Compression/Med_Quality (JPEG compression only).
256 | Hi_Compression/Low_Quality (JPEG compression only).
512 | Med_Compression/Hi_Quality (JPEG compression only).
1024 | Med_Compression/Med_Quality (JPEG compression only).
2048 | Med_Compression/Low_Quality (JPEG compression only).
4098 | Low_Compression/Hi_Quality (JPEG compression only).
8196 | Low_Compression/Med_Quality (JPEG compression only).
16392 | Low_Compression/Low_Quality (JPEG compression only).

Example

This example returns the page's compression information.

x = Img.Pages(1).CompressionInfo

Image files that do not have a compression type of JPEG will have a value between 1 and 63. This value will be a combination of the values of 1 to 32. For JPEG files, the value will from 64 to 16384 and will only be one of these values.


CompressionType Property

Description

Returns this page's compression type. Read-only property.

Usage

ImageFileObject.Pages(pagenumber).CompressionType

Data Type

Short

Remarks

The CompressionType property settings are:

Setting | Description
0 | Unknown
1 | No Compression
2 | Group 3 1D FAX
4 | Packed Bits
5 | Group 4 2D FAX
6 | JPEG

Example

This example returns this page's compression type.

x = Img.Pages(1).CompressionType


Height Property

Description

Returns this page's height in pixels. Read-only property.

Usage

ImageFileObject.Pages(pagenumber).Height

Data Type

Long

Example

This example returns this page's height in pixels.

x = Img.Pages(1).Height


ImageResolutionX Property

Description

Sets or returns this page's horizontal resolution. Read/write property.

Usage

ImageFileObject.Pages(pagenumber).ImageResolutionX = [setting]

Data Type

Long

Example

This example sets this page's horizontal resolution.

Img.Pages(1).ImageResolutionX = 200

This example returns this page's horizontal resolution.

XRes = Img.Pages(1).ImageResolutionX


ImageResolutionY Property

Description

Sets or returns this page's vertical resolution. Read/write property.

Usage

ImageFileObject.Pages(pagenumber).ImageResolutionY = [setting]

Data Type

Long

Example

This example sets this page's vertical resolution.

Img.Pages(1).ImageResolutionY = 200

This example returns this page's vertical resolution.

YRes = Img.Pages(1).ImageResolutionY


Name Property

Description

Returns the page number of the page in the ImageFile object. Read-only property. Value Property.

Usage

ImageFileObject.Pages(pagenumber).Name

Data Type

Long

Example

This example returns the page number of the page in the ImageFile object.

x = Img.Pages(1).Name


PageType Property

Description

Returns the page's image type. Read-only property.

Usage

ImageFileObject.Pages(pagenumber).PageType

Data Type

Short

Example

This example returns the page's image type.

x = Img.Pages(1).PageType


Parent Property

Description

Returns the parent of the Page object. Read-only property.

Usage

ImageFileObject.Pages(pagenumber).Parent

Data Type

Object

Example

This example returns the parent of the Page object.

x = Img.Pages(1).Parent


ScrollPositionX Property

Description

Sets or returns this page's horizontal scroll position in pixels. Read/write property. Persistent.

Usage

ImageFileObject.Pages(pagenumber).ScrollPositionX = [setting]

Data Type

Long

Example

This example sets this page's horizontal scroll position.

Img.Pages(1).ScrollPositionX = 200

This example returns this page's horizontal scroll position.

xpos = Img.Pages(1).ScrollPositionX


ScrollPositionY Property

Description

Sets or returns this page's vertical scroll position in pixels. Read/write property. Persistent.

Usage

ImageFileObject.Pages(pagenumber).ScrollPositionY = [setting]

Data Type

Long

Example

This example sets this page's vertical scroll position.

Img.Pages(1).ScrollPositionY = 200

This example returns this page'svertical scroll position.

ypos = Img.Pages(1).ScrollPositionY


Width Property

Description

Returns this page's width in pixels. Read-only property.

Usage

ImageFileObject.Pages(pagenumber).Width

Data Type

Long

Example

This example returns this page's width in pixels.

x = Img.Pages(1).Width


Page Object Methods

Table 4.2 lists the Page object methods.

Table 4.2 Page Object Methods

Method | Description
Delete | Deletes the page.
Flip | Rotates the page 180 degrees.
Help | Displays online Help.
Print | Prints the page.
RotateLeft | Rotates the page counterclockwise 90 degrees.
RotateRight | Rotates the page clockwise 90 degrees.
Scroll | Scrolls the page.


Delete Method

Description

Deletes the specified page from the active object. After deleting a page, the next page is displayed if it exists. Otherwise, the previous page is displayed.

Syntax

ImageFileObject.Pages(pagenumber)Delete

Example

This example deletes the specified page.

Img.Pages(1).Delete


Flip Method

Description

Rotates the specified page 180 degrees. This change becomes permanent when the image file is saved.

Syntax

ImageFileObject.Pages(pagenumber)Flip

Example

This example flips the page.

Img.Pages(1).Flip


Help Method

Description

Displays the Imaging online Help table of contents.

Syntax

ImageFileObject.Pages(pagenumber)Help


Print Method

Description

Prints the page.

Syntax

ImageFileObject.Pages(pagenumber).Print

Example

This example prints the page.

x = Img.Pages(1).Print


RotateLeft Method

Description

Rotates the page 90 degrees counterclockwise. This change becomes permanent when the image file is saved.

Syntax

ImageFileObject.Pages(pagenumber).RotateLeft

Example

This example rotates the page 90 degrees to the left.

Img.Pages(1).RotateLeft


RotateRight Method

Description

Rotates the page 90 degrees clockwise. This change becomes permanent when the image file is saved.

Syntax

ImageFileObject.Pages(pagenumber).RotateRight

Example

This example rotates the page 90 degrees to the right.

Img.Pages(1).RotateRight


Scroll Method

Description

Scrolls the page.

Syntax

ImageFileObject.Pages(pagenumber).Scroll direction amount

Remarks

The amount is the number of pixels to scroll. The direction settings are:

Setting | Description
0 | Default. Scrolls down.
1 | Scrolls up.
2 | Scrolls right.
3 | Scrolls Left.

Example

This example scrolls the page down 200 pixels.

Img.Pages(1).Scroll 0 200


PageRange Object

A PageRange object represents a range of consecutive pages in an ImageFile object. A page range is a set of pages starting at the StartPage property and ending at the EndPage property. PageRange objects can only be accessed by using the Pages method of the parent ImageFile object.


PageRange Object Properties

Table 5-1 lists the PageRange object properties.

Table 5.1 PageRange Object Properties

Property | Description
Application | Returns the Application object.
Count | Returns the number of pages in this range.
EndPage | Returns or sets the page number of the last page in the range.
StartPage | Returns or sets the page number of the first page in the range.
Parent | Returns the parent of the PageRange object.


Application Property

Description

Returns the Application object. Read-only property.

Usage

ImageFileObject.Pages(pagenumber, pagenumber).Application

Data Type

Object


Count Property

Description

Returns the number of pages in this range. Read-only property. Value Property.

Usage

ImageFileObject.Pages(pagenumber, pagenumber).Count

Data Type

Long


EndPage Property

Description

Returns or sets the page number of the last page in the range. Read/write property.

Usage

ImageFileObject.Pages(pagenumber, pagenumber).EndPage = [setting]

Data Type

Long

Remarks

The property setting is the number of the last page. The value of EndPage must be greater than or equal to the value of StartPage.


Parent Property

Description

Returns the parent of the PageRange object. Read-only property.

Usage

ImageFileObject.Pages(pagenumber, pagenumber).Parent

Data Type

Object

Example

This example returns the parent of the PageRange object.

x = Img.Pages(1,7).Parent


StartPage Property

Description

Returns or sets the page number of the first page in the range. Read/write property.

Usage

ImageFileObject.Pages(pagenumber, pagenumber).StartPage = [setting]

Data Type

Long

Remarks

The property setting is the number of the first page.


PageRange Object Methods

Table 5.2 lists the PageRange object methods.

Table 5.2 PageRange Object Methods

Method | Description
Delete | Deletes the page range.
Print | Prints the page range.


Delete Method

Description

Removes pages from the ImageFile object. After deleting a PageRange object, all page ranges are invalid.

Syntax

ImageFileObject.Pages(pagenumber, pagenumber)Delete

Example

This example deletes the pages 1 through 3.

Img.Pages(1,3).Delete


Print Method

Description

Prints the page range.

Syntax

ImageFileObject.Pages(pagenumber, pagenumber).Print

Example

This example prints pages 1 through 5.

x = Img.Pages(1,5).Print


Alternative Implementation

This document describes the proposed annotation extension developed for TIFF 6.0 by Wang Laboratories, Inc. to provide information for creating and reading annotation data. This document:

  • Defines annotation data and lists available annotation marks.

  • Describes the format of annotation data that is stored in TIFF 6.0 files.

  • Explains the annotation mark attribute structure.

  • Discusses named blocks and defines the annotation named block structures.

  • Defines each type of annotation mark and summarizes the associated attributes and named blocks.

An alternative way to create annotation data is available in the Wang Imaging for Windows® 95 product. This product includes OCXs that provide a higher-level interface to the creation of annotation data. In particular, the Image Edit OCX and the Image Annotation Tool Button OCX include properties, methods, and events that enable application engineers to implement programmatic generation of annotations. OCX methods are callable from many programming environments, including Visual Basic and Visual C++.

Imaging for Windows® 95 is available on the Wang or Microsoft home page at the following locations:

http://www.wang.com

http://www.microsoft.com/windows

You can download and install Imaging for Windows® 95, and then display the OCX help text, called wangocxd.hlp, which is located in the Windows help directory. Alternatively, you can read about the OCXs on the Wang home page in the topic, Review of the OLE Custom Controls.


Annotation Data

Annotation data is stored information about simple drawings or notations. These drawings or notations are referred to as annotation marks. The following types of annotation marks are available.

Attach-a-Note

Image reference


Processing of Annotation Data in TIFF Image Files

Annotation data is included as part of a TIFF image page. It is accessed using a private tag in the page image file directory (IFD), as follows:

Tag ID = 32932 (decimal)

Tag Data Type = BYTE

Tag Data Count = size of annotation data

Tag Val/Offset = file offset to annotation data


Annotation Data File Format

The data associated with an annotation tag in a TIFF file consists of zero or more blocks of default data, followed by the data necessary to describe each annotation mark. Default data consists of default named blocks, designated Type 2 data. Annotation mark data consists of an attribute structure, designated Type 5 data, followed by one or more named blocks, designated Type 6 data.

The annotation data itself consists of a 4-byte header, which is not currently used (reserved for future use). The header should be skipped on read and written as zeros. Note, however, that it is included in the TIFF tag's Data Count field. The header is followed by four bytes in Intel order that specify size of INTs and UINTs and byte ordering:

4 bytes

0 = Intel 16-bit

(least-significant byte to most-significant byte and two-byte INTs and UINTs)

Default data and mark data follow:

4 bytes = type of data (integer 2, 5, or 6, as explained below)


Supported Data Types

The following data types are supported:

Type = 2

A default named block.
8 bytes = name of named block
4 bytes = size (n) of named block
4 bytes = reserved. Only present and necessary with
Intel 16-bit format. Skip on read and write
as zeros.
n bytes = named block data
8 bytes = name of named block
4 bytes = size (n) of named block data
4 bytes = reserved. Only present and necessary with
Intel 16-bit format. Skip on read and write
as zeros.
n bytes = named block data


Annotation Mark Attributes

All annotation marks have a set of attributes associated with them. Attributes that do not apply are ignored.


Attribute Structure

typedef struct tagOIAN_MARK_ATTRIBUTES{

UINT uType; // The type of the mark.
// 1 = Image embedded
// 2 = Image reference
// 3 = Straight line
// 4 = Freehand line
// 5 = Hollow rectangle
// 6 = Filled rectangle
// 7 = Typed text
// 8 = Text from file
// 9 = Text stamp
//10 = Attach-a-Note
//12 = Form

LRECT lrBounds; // Rectangle in FULLSIZE units; equivalent to type RECT.
// Can be a rectangle or two points.

RGBQUAD rgbColor1; // The main color; for example, the color of all lines,
// all rectangles, and standalone text.

RGBQUAD rgbColor2; // The secondary color; for example, the color of the text of
// an Attach-a-Note.

BOOL bHighlighting; // TRUE — The mark is drawn highlighted. Highlighting
// performs the same function as a highlighting marker on a
// piece of paper. Valid only for lines, rectangles, and
// freehand.

BOOL bTransparent; // TRUE — The mark is drawn transparent. A transparent
// mark does not draw white pixels. That is, transparent
// replaces white pixels with whatever is behind those pixels.
// Available only for images.

UINT uLineSize; // The width of the line in pixels.

UINT uReserved1; // Reserved; must be set to 0.

UINT uReserved2; // Reserved; must be set to 0.

LOGFONT lfFont; // The font information for the text, consisting of standard
// font attributes of font size, name, style, effects, and
// background color.

DWORD bReserved3; // Reserved; must be set to 0x0FF83F.

time_t Time; // The time that the mark was first saved, in seconds, from
// 00:00:00 1-1-1970 GMT. Every annotation mark has
// time as one of its attributes. If you do not set the time before
// the file is saved, the time is set to the date and time that the
// save was initiated. This time is in the form returned by the
// "time" C call, which is the number of seconds since
// midnight 00:00:00 on 1-1-1970 GMT. If necessary, refer
// to your C documentation for a more detailed description.

BOOL bVisible; // TRUE — The mark is currently set to be visible.
// Annotation marks can be visible or hidden.

DWORD dwReserved4; // Reserved; must be set to 0.

long lReserved[10]; // Must be set to 0.

}OIAN_MARK_ATTRIBUTES;


Annotation Named Blocks

A named block can be used to hold any data for any purpose; for example, named blocks can be used to store

Internal mark data

Public mark data

Group information

Selection operations criteria

Access control data

A named block is a block of data that is referenced by an 8-byte name. The data is structured as follows:

8 bytes = name of named block

4 bytes = size (n) in bytes, of named block data

4 bytes = reserved. Only present and necessary with Intel 16-bit format.

Skip on read and write as zeros.

n bytes = named block data


Named Block Conventions

The name of a named block is case sensitive; for example, ABC is not the same as aBc.

The named block name is left-justified and padded with nulls to eight bytes. All eight bytes are used and compared regardless of content.

All annotation marks allow any number of named blocks to be associated with them. Each named block is associated with one and only one structure. A mark cannot have multiple blocks with the same name.

All names beginning with Oi (Oixxxxxx) are reserved. Oi indicates OPEN/image.


Reserved Named Blocks

The reserved named blocks defined for annotation marks and their associated structures and usage are as follows:

Named Block

Associated Structure

Usage


Named Block Structures

The structures used by annotation named blocks are as follows:

Structure

DefinitionAN_POINTStypedef struct tagAnPoints{ int nMaxPoints; // The maximum number of points; must
// be equal to the value of nPoints. int nPoints; // The current number of points. POINT ptPoint[1]; // Points marking the beginning and
// ending of the line segment(s); in
// FULLSIZE (not scaled) coordinates
// relative to the upper left corner
// of lrBounds in
// OIAN_MARK_ATTRIBUTES.} AN_POINTS;
// 2=Rotate right (90 degrees clockwise)
// 3=Flip (180 degrees clockwise)
// 4=Rotate left (270 degrees clockwise) // 5=Vertical mirror (reflected around a
// vertical line) // 6=Vertical mirror + Rotate right
// 7=Vertical mirror + Flip
// 8=Vertical mirror + Rotate left int scale; // Set to 1000. int nHRes; // Set to value of nOrigHRes. int nVRes; // Set to value of nOrigVRes. int nOrigHRes; // Resolution of image mark in DPI. int nOrigVRes; // Resolution of image mark in DPI. BOOL bReserved1; // Set to 0. BOOL bReserved2; // Set to 0. int nReserved[6];}AN_NEW_ROTATE_STRUCT;
// filename; terminated with a NULL.}AN_NAME_STRUCT;
// in tenths of a degree; valid
// values are 0, 900, 1800, 2700. UINT uReserved1; // Always 1000 when writing;
// ignore when reading. UINT uReserved2; // Always 1000 when writing;
// ignore when reading. UINT uAnoTextLength; // 64K byte limit (32K for multi-
// byte data) for Attach-a-Note,
// typed text, text from file;
// 255 byte limit for text stamp. char szAnoText[1]; // Text string for text mark types.}OIAN_TEXTPRIVDATA;


Annotation Marks

There can be any number of annotation marks on an image, and any number of named blocks on a mark. Every mark must be at least five pixels in from the edge of the image.

The following alphabetical listing of supported annotation mark types defines each mark and specifies its attributes and named blocks. Note that all mark types require the uType, lrBounds, and bVisible attribute.


Attach-a-Note

Definition

A colored rectangle that contains text.


Filled Rectangle

Definition

A rectangle with a filled center.


Form

Definition

A black and white image included by indirect reference. Only one form mark is allowed per image. It is placed on top of the base image before all other marks. If the image is not found at display time, an error is returned.


Freehand Line

Definition

A series of lines such that the starting point of line n+1 is the same as the ending point of line n.


Hollow Rectangle

Definition

A rectangle with a center that is not filled.


Image Embedded

Definition

An embedded image.


Image Reference

Definition

An image included by reference. If the image is not found at display time, an error is returned.

Note: To reference images at different locations on different PCs, you can use the following technique to specify the image filename. For example, to reference c:\oi\bw.tif, first define a section in the win.ini file called [O/i ImagePath], with an entry such as x=c:\oi\, where x is an integer from 1 to 9. After this setting is defined, use the filename x:bw.tif to access c:\oi\bw.tif. The path specified for x (c:\oi\) concatenates with what follows after the colon in the filename (bw.tif) to produce c:\oi\bw.tif.


Straight Line

Definition

A line with a defined starting and ending point.


Typed Text

Definition

A series of characters entered from the keyboard.


Text From File

Definition

Text supplied from a file. The file format is Text Only, which is only ASCII with carriage returns, line feeds, and tabs.


Text Stamp

Definition

Text that contains a pre-defined string which may include, for example, the date and/or time when the mark was applied.