Copyright: Copyright © Kodak, 1995-2000


Image Annotation Tool Button Control

See Also	Properties	Methods	Event
What the Image Annotation Tool Button control lets you do

The Image Annotation Tool Button (IATB) control lets you [image] the application developer [image] add image annotation functions to applications that support 32-bit ActiveX controls.

Specifically, you include one or more IATB controls in your application to create a custom annotation tool bar or palette.  Each control is actually a button that invokes an annotation type when the end user clicks on it.

Your custom annotation tool bar or palette can contain buttons that provide:

Discrete annotation types

The same annotation type with different annotation styles

A combination of both

Note: The IATB control is an ActiveX control in:

Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5

Imaging for Windows 98

And an OCX control in:

Imaging for Windows 95

Imaging for Windows NT 4.0

What the IATB control lets your users do

Each IATB control lets your users draw text or graphical annotations on displayed image documents.

Prerequisites

You must include at least one Image Admin control and one Image Edit control in your application.

Further, you must link each IATB control to the Image Edit control that displays images to be annotated by your end users.

The link permits the IATB control to send messages to the Image Edit control.  These messages change the annotation properties of the Image Edit control to the values set within the IATB control.  It is the Image Edit control that actually draws the annotations.

To link an Image Annotation Tool Button control to an 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.


AnnotationBackColor Property

See Also	Example-VB	Example-VC++
Returns or sets the background color of an Attach-a-Note annotation object.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Annotation Tool Button control, Image Edit control

Syntax

object.AnnotationBackColor[=color]

Data Type

OLE_COLOR

Remarks

Use the RGB format.  The default color is yellow (255, 255, 0).

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


AnnotationBackColor Example - VB
AnnotationBackColor Example [image] VB

This example adds an annotation group, sets the annotation type, sets the background color of the annotation, and then draws the mark.  (Annotation groups are not actually created until a mark is drawn in the group.)

Private Sub cmdAddGroup_Click()

    ImgEdit1.AddAnnotationGroup "Accounting Dept"

    ImgEdit1.AnnotationType = wiTextAttachment  '10

    ImgEdit1.AnnotationBackColor = vbYellow

    ImgEdit1.Draw 10, 10, 150, 100

    'The user must manually enter the text on the attachment

End Sub


AnnotationBackColor Example - VC++
AnnotationBackColor Example [image] VC++

This example adds an annotation group, sets the annotation type, sets the background color of the annotation, and then draws the mark. (Annotation groups are not actually created until a mark is drawn in the group.)

void CFrmGroup::OnAddGroup()

{

    // Adds a group and draws a mark in the group. Annotation groups

    // are not actually created until a mark is drawn in the group.

    CString szCurGroup;

    szCurGroup.Format("Accounting Dept %i",rand());

    // Get the name of the group the user clicked on in the listbox

    m_GroupList.AddString(szCurGroup);

    if(pParentDlg)

    {

      pParentDlg->ImgEdit1.AddAnnotationGroup(szCurGroup);

      pParentDlg->ImgEdit1.SetAnnotationType(10);  // wiTextAttachment  // 10

      pParentDlg->ImgEdit1.SetAnnotationBackColor(0xFFFF); // vbYellow

      VARIANT vWidth; V_VT(&vWidth) = VT_I2; V_I2(&vWidth) = 150;

      VARIANT vHeight; V_VT(&vHeight) = VT_I2; V_I2(&vHeight) = 100;

      pParentDlg->ImgEdit1.Draw(10, 10, vWidth, vHeight);

    }

    // The user must manually enter the text on the attachment

}


AnnotationFillColor Property

See Also	Example-VB
Returns or sets the color used to fill a Filled Rectangle annotation object.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Annotation Tool Button control, Image Edit control

Syntax

object.AnnotationFillColor[=color]

Data Type

OLE_COLOR

Remarks

Use the RGB format.  The default color is red (255, 0, 0).


AnnotationFillColor Example - VB
AnnotationFillColor Example [image] VB

This example uses the AnnotationFillColor property to set the color of a Filled Rectangle annotation to blue.  The annotation is then drawn on the Image Edit control specified by the DestImageControl property.

Private Sub cmdDestImage_Click()

    'If there are multiple ImgEdit controls within an

    'application, use the DestImage control to define

    'which image window to place annotation marks on.

    'ImageControl names will default to ImgEdit1, ImgEdit2,

    'etc. at the time the controls are drawn.  The control

    'name could be changed at design time if desired.

    'Draw a straight line on the Image Edit control whose

    'ImageControl name is ImgEdit2

    ImgAnnTool1.DestImageControl = "ImgEdit2"

    ImgAnnTool1.AnnotationType = wiStraightLine

    ImgAnnTool1.Draw 10, 10, 100, 100

    'Sets the AnnotationType to a filled rectangle and

    'the fill color of the rectangle to blue using Visual

    'Basic color constants.

    ImgAnnTool1.AnnotationType = wiFilledRect '4

    ImgAnnTool1.AnnotationFillColor = vbBlue

    'Draw the blue rectangle on the Image Edit control whose

    'ImageControl name is ImgEdit1

    ImgAnnTool1.DestImageControl = "ImgEdit1"

    ImgAnnTool1.Draw 10, 10, 100, 100

End Sub


AnnotationFillStyle Property

See Also	Example-VB	Example-VC++
Returns or sets the pattern used to fill image and Filled Rectangle annotation objects.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Annotation Tool Button control, Image Edit control

Syntax

object.AnnotationFillStyle[=value]

Data Type

Integer (enumerated)

Constant	Setting	Description
wiTransparent	0 (default)	Transparent [image] The underlying image data is visible
wiOpaque	1	Opaque [image] The underlying image data is obscured
Remarks

The AnnotationFillStyle property is used with the following annotation types:

Filled Rectangle

Image Embedded

Image Reference


AnnotationFillStyle Example - VB
AnnotationFillStyle Example [image] VB

This example places a company logo (image) annotation at the top of a new page.  The AnnotationFillStyle property is set to opaque so none of the underlying image data is visible through the logo.

Private Sub cmdDrawLogo_Click()

    'Create a new 8 1/2 X 11" black and white image at 100 dpi

    ImgEdit1.DisplayBlankImage 850, 1100, 100, 100, wiPageTypeBW

    ImgEdit1.AnnotationImage = "D:\image2\corplogo.bmp"

    'Logo would obscure any text under it if Opaque

    ImgEdit1.AnnotationFillStyle = wiOpaque   '1

    'If image is embedded rather than referenced, the source

    'image need not be present when the image is displayed

    ImgEdit1.AnnotationType = wiImageEmbedded   '5

    'Image mark only requires left and top parameters to draw

    'Start not quite halfway across page, 25 pixels from top (1/4")

    ImgEdit1.Draw 350, 25

End Sub


AnnotationFillStyle Example - VC++
AnnotationFillStyle Example [image] VC++

This example places a company logo (image) annotation at the top of a new page.  The AnnotationFillStyle property is set to opaque so none of the underlying image data is visible through the logo.

void CImgEdit1Dlg::OnImageStamp()

{

    // This would place a company logo at the top center of a new page

    // Create a new 8 1/2 X 11" black and white image at 100 dpi

    VARIANT vPageType; V_VT(&vPageType) = VT_I2;	// set to PageType for saveas

    V_I2(&vPageType) = 1; // wiPageTypeBW

    VARIANT vRes; V_VT(&vRes) = VT_I4; V_I4(&vRes) = 100;

    ImgEdit1.DisplayBlankImage (850, 1100, vRes, vRes, vPageType);

    ImgEdit1.SetAnnotationImage("D:\\image2\\corplogo.bmp");

    // Logo would obscure any text under it if Opaque

    ImgEdit1.SetAnnotationFillStyle(1);  // wiOpaque   // 1

    // If image is embedded rather than referenced, the source

    // image need not be present when the image is displayed

    ImgEdit1.SetAnnotationType(5);  // wiImageEmbedded   // 5

    // Image mark only requires left and top parameters to draw

    // Start not quite halfway across page, 25 pixels from top (1/4")

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.Draw(350, 25, evt, evt);

}


AnnotationFont Property

See Also	Example-VB	Example-VC++
Returns or sets a font object’s properties.  Applies to all text annotation types.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Annotation Tool Button control, Image Edit control

Syntax

object.AnnotationFont

Data Type

IFontDisp

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 [image] Selects bold attribute False [image] Deselects bold attribute	False
Italic	Boolean	True [image] Selects italic attribute False [image] 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 [image] Selects underline attribute False [image] Deselects underline attribute	False
StrikeThrough	Boolean	True [image] Selects strikethrough attribute False [image] Deselects strikethrough attribute	False
The AnnotationFont property is used with the following annotation types:

Attach-a-Note

Hyperlink

Text

Text From File

Text Stamp

Note:  Hyperlink annotations are available with Imaging for Windows Professional Edition (V1.0, V1.1, V2.0, and V2.5) only.


AnnotationFont Example - VB
AnnotationFont Example [image] VB

Example 1 places a customized rubber stamp at a predetermined location on the image. The AnnotationFont and AnnotationFontColor properties are set to determine the stamp's font and font color.

Example 2 shows how to change the properties of the font object identified by the AnnotationFont property.

Example 1

Private Sub cmdStamp_Click()

    ImgEdit1.AnnotationFont = "Courier"

    ImgEdit1.AnnotationFontColor = vbRed

    'This stamp uses embedded text macros for date and time

    ImgEdit1.AnnotationStampText = "Application received on %B %d, %Y at %H"

    ImgEdit1.AnnotationType = wiTextStamp  '8

    ImgEdit1.Draw 10, 10

End Sub

Example 2

Private Sub cmdAnnoFont_Click()

    'This example shows how to change the properties of the font

    'object identified by the AnnotationFont property.  This

    'would define the font to be used for all text annotations.

    Dim AnnoFont As IFontDisp

    Set AnnoFont = ImgEdit1.AnnotationFont

    With AnnoFont

        .Bold = True

        .Italic = True

        .Name = "Arial"

        .Size = 16

        .Underline = True

        .Strikethrough = True

    End With

End Sub


AnnotationFont Example - VC++
AnnotationFont Example [image] VC++

This example places a customized rubber stamp at a predetermined location on the image. The AnnotationFont and AnnotationFontColor properties are set to determine the stamp's font and font color.

void CImgEdit1Dlg::OnRubberStamp()

{

    // Places a customized rubber stamp at a predetermined

    // location on the image.  Font used is Courier and color

    // is red

    COleFont szFontType;

    szFontType = ImgEdit1.GetAnnotationFont();

    szFontType.SetName("Courier New");

    ImgEdit1.SetAnnotationFont(szFontType);

    ImgEdit1.SetAnnotationFontColor(0xFF);  // vbRed

    // This stamp uses embedded text macros for date and time

    ImgEdit1.SetAnnotationStampText("Application received on %B %d, %Y at %H");

    ImgEdit1.SetAnnotationType(8); // wiTextStamp  // 8

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.Draw(10, 10, evt, evt);

}


AnnotationFontColor Property

See Also	Example-VB	Example-VC++
Returns or sets the font color of text annotation objects.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Annotation Tool Button control, Image Edit control

Syntax

object.AnnotationFontColor[=color]

Data Type

OLE_COLOR

Remarks

Use the RGB format.  The default color is black (0, 0, 0).

The AnnotationFontColor property is used with the following annotation types:

Attach-a-Note

Hyperlink

Text

Text From File

Text Stamp

Note:  Hyperlink annotations are available with Imaging for Windows Professional Edition (V1.0, V1.1, V2.0, and V2.5) only.


AnnotationFontColor Property - VB
AnnotationFontColor Example [image] VB

This example places a customized rubber stamp at a predetermined location on the image. The AnnotationFont and AnnotationFontColor properties are set to determine the stamp's font and font color.

Private Sub cmdStamp_Click()

    ImgEdit1.AnnotationFont = "Courier"

    ImgEdit1.AnnotationFontColor = vbRed

    'This stamp uses embedded text macros for date and time

    ImgEdit1.AnnotationStampText = "Application received on %B %d, %Y at %H"

    ImgEdit1.AnnotationType = wiTextStamp  '8

    ImgEdit1.Draw 10, 10

End Sub


AnnotationFontColor Property - VC++
AnnotationFontColor Example [image] VC++

This example places a customized rubber stamp at a predetermined location on the image. The AnnotationFont and AnnotationFontColor properties are set to determine the stamp's font and font color.

void CImgEdit1Dlg::OnRubberStamp()

{

    // Places a customized rubber stamp at a predetermined

    // location on the image.  Font used is Courier and color

    // is red

    COleFont szFontType;

    szFontType = ImgEdit1.GetAnnotationFont();

    szFontType.SetName("Courier New");

    ImgEdit1.SetAnnotationFont(szFontType);

    ImgEdit1.SetAnnotationFontColor(0xFF);  // vbRed

    // This stamp uses embedded text macros for date and time

    ImgEdit1.SetAnnotationStampText("Application received on %B %d, %Y at %H");

    ImgEdit1.SetAnnotationType(8); // wiTextStamp  // 8

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.Draw(10, 10, evt, evt);

}


AnnotationImage Property

See Also	Example-VB	Example-VC++
Returns or sets the fully-qualified file name of an image file.  When the annotation is applied, the image file specified will be placed on the image currently displayed by the Image Edit control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 file name.  File extensions are required as part of the file name.

The AnnotationImage property is used with the following annotation types:

Image Embedded

Image Reference


AnnotationImage Example - VB
AnnotationImage Example [image] VB

This example places a company logo (image) annotation at the top, center of a new page.

Private Sub cmdDrawLogo_Click()

    'Create a new 8 1/2 X 11" black and white image at 100 dpi

    ImgEdit1.DisplayBlankImage 850, 1100, 100, 100, wiPageTypeBW

    ImgEdit1.AnnotationImage = "D:\image2\corplogo.bmp"

    'Logo would obscure any text under it if Opaque

    ImgEdit1.AnnotationFillStyle = wiOpaque   '1

    'If image is embedded rather than referenced, the source

    'image need not be present when the image is displayed

    ImgEdit1.AnnotationType = wiImageEmbedded   '5

    'Image mark only requires left and top parameters to draw

    'Start not quite halfway across page, 25 pixels from top (1/4")

    ImgEdit1.Draw 350, 25

End Sub


AnnotationImage Example - VC++
AnnotationImage Example [image] VC++

This example places a company logo (image) annotation at the top, center of a new page.

void CImgEdit1Dlg::OnImageStamp()

{

    // This would place a company logo at the top center of a new page

    // Create a new 8 1/2 X 11" black and white image at 100 dpi

    VARIANT vPageType; V_VT(&vPageType) = VT_I2; // set to PageType for saveas

    V_I2(&vPageType) = 1; / wiPageTypeBW

    VARIANT vRes; V_VT(&vRes) = VT_I4; V_I4(&vRes) = 100;

    ImgEdit1.DisplayBlankImage (850, 1100, vRes, vRes, vPageType);

    ImgEdit1.SetAnnotationImage("D:\\image2\\corplogo.bmp");

    // Logo would obscure any text under it if Opaque

    ImgEdit1.SetAnnotationFillStyle(1);  // wiOpaque   // 1

    // If image is embedded rather than referenced, the source

    // image need not be present when the image is displayed

    ImgEdit1.SetAnnotationType(5);  // wiImageEmbedded   // 5

    // Image mark only requires left and top parameters to draw

    // Start not quite halfway across page, 25 pixels from top (1/4")

    VARIANT evt; V_VT(&evt) = VT_ERROR; / set to default

    ImgEdit1.Draw(350, 25, evt, evt);

}


AnnotationLineColor Property

See Also	Example-VB	Example-VC++
Returns or sets the line color for line and Hollow Rectangle annotation objects.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Annotation Tool Button control, Image Edit control

Syntax

object.AnnotationLineColor[=color]

Data Type

OLE_COLOR

Remarks

Use the RGB format.  The default color is red (255, 0, 0).

The AnnotationLineColor property is used with the following annotation types:

Freehand Line

Hollow Rectangle

Straight Line


AnnotationLineColor Example - VB
AnnotationLineColor Example [image] VB

This example draws a green line across the width of an image.

Private Sub cmdDrawLine_Click()

    Dim XWidth As OLE_XSIZE_PIXELS

    'Determine the width of the image -- this will

    'work even if the image is scaled up or down

    XWidth = ImgEdit1.ImageScaleWidth

    'line will be green, transparent, 10 pixels wide

    ImgEdit1.AnnotationLineColor = vbGreen

    ImgEdit1.AnnotationLineStyle = wiTransparent  '0

    ImgEdit1.AnnotationLineWidth = 10

    ImgEdit1.AnnotationType = wiStraightLine  '1

    'Draw the line

    'left position = 0 (start at left side)

    'top position = 100 pixels from top of page

    'width of line = width of image as it is displayed

    'height of line = 0 (line will be horizontal)

    ImgEdit1.Draw 0, 100, XWidth, 0

End Sub


AnnotationLineColor Example - VC++
AnnotationLineColor Example [image] VC++

This example draws a green line across the width of an image.

void CImgEdit1Dlg::OnDrawline()

{

    // This would draw a line across the width of an image

    long XWidth;

    // Determine the width of the image -- this will

    // work even if the image is scaled up or down

    XWidth = ImgEdit1.GetImageScaleWidth();

    // line will be green, transparent, 10 pixels wide

    ImgEdit1.SetAnnotationLineColor(0xFF00);    // vbGreen

    ImgEdit1.SetAnnotationLineStyle(0);  // 0

    ImgEdit1.SetAnnotationLineWidth(10); // 10

    ImgEdit1.SetAnnotationType(1); // wiStraightLine 1

    // Draw the line

    // left position = 0 (start at left side)

    // top position = 100 pixels from top of page

    // width of line = width of image as it is displayed

    // height of line = 0 (line will be horizontal)

    VARIANT vWidth; V_VT(&vWidth) = VT_I4; V_I4(&vWidth) = XWidth;

    VARIANT vHeight; V_VT(&vHeight) = VT_I4; V_I4(&vHeight) = 0;

    ImgEdit1.Draw(0, 100, vWidth, vHeight);

}


AnnotationLineStyle Property

See Also	Example-VB	Example-VC++
Returns or sets the line style for line and Hollow Rectangle annotation objects.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Annotation Tool Button control, Image Edit control

Syntax

object.AnnotationLineStyle[=value]

Data Type

Integer (enumerated)

Constant	Setting	Description
wiTransparent	0 (default)	Transparent [image] The underlying image data is visible
wiOpaque	1	Opaque [image] The underlying image data is obscured
Remarks

The AnnotationLineStyle property is used with the following annotation types:

Freehand Line

Hollow Rectangle

Straight Line


AnnotationLineStyle Example - VB
AnnotationLineStyle Example [image] VB

This example draws a transparent line across the width of an image.

Private Sub cmdDrawLine_Click()

    Dim XWidth As OLE_XSIZE_PIXELS

    'Determine the width of the image -- this will

    'work even if the image is scaled up or down

    XWidth = ImgEdit1.ImageScaleWidth

    'line will be green, transparent, 10 pixels wide

    ImgEdit1.AnnotationLineColor = vbGreen

    ImgEdit1.AnnotationLineStyle = wiTransparent  '0

    ImgEdit1.AnnotationLineWidth = 10

    ImgEdit1.AnnotationType = wiStraightLine  '1

    'Draw the line

    'left position = 0 (start at left side)

    'top position = 100 pixels from top of page

    'width of line = width of image as it is displayed

    'height of line = 0 (line will be horizontal)

    ImgEdit1.Draw 0, 100, XWidth, 0

End Sub


AnnotationLineStyle Example - VC++
AnnotationLineStyle Example [image] VC++

This example draws a transparent line across the width of an image.

void CImgEdit1Dlg::OnDrawline()

{

    // This would draw a line across the width of an image

    long XWidth;

    // Determine the width of the image -- this will

    // work even if the image is scaled up or down

    XWidth = ImgEdit1.GetImageScaleWidth();

    // line will be green, transparent, 10 pixels wide

    ImgEdit1.SetAnnotationLineColor(0xFF00);    // vbGreen

    ImgEdit1.SetAnnotationLineStyle(0);  // 0

    ImgEdit1.SetAnnotationLineWidth(10); // 10

    ImgEdit1.SetAnnotationType(1); // wiStraightLine 1

    // Draw the line

    // left position = 0 (start at left side)

    // top position = 100 pixels from top of page

    // width of line = width of image as it is displayed

    // height of line = 0 (line will be horizontal)

    VARIANT vWidth; V_VT(&vWidth) = VT_I4; V_I4(&vWidth) = XWidth;

    VARIANT vHeight; V_VT(&vHeight) = VT_I4; V_I4(&vHeight) = 0;

    ImgEdit1.Draw(0, 100, vWidth, vHeight);

}


AnnotationLineWidth Property

See Also	Example-VB	Example-VC++
Returns or sets the line width for line and Hollow Rectangle annotation objects.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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


AnnotationLineWidth Example - VB
AnnotationLineWidth Example [image] VB

This example draws a 10-pixel-wide line across the width of an image.

Private Sub cmdDrawLine_Click()

    Dim XWidth As OLE_XSIZE_PIXELS

    'Determine the width of the image -- this will

    'work even if the image is scaled up or down

    XWidth = ImgEdit1.ImageScaleWidth

    'line will be green, transparent, 10 pixels wide

    ImgEdit1.AnnotationLineColor = vbGreen

    ImgEdit1.AnnotationLineStyle = wiTransparent  '0

    ImgEdit1.AnnotationLineWidth = 10

    ImgEdit1.AnnotationType = wiStraightLine  '1

    'Draw the line

    'left position = 0 (start at left side)

    'top position = 100 pixels from top of page

    'width of line = width of image as it is displayed

    'height of line = 0 (line will be horizontal)

    ImgEdit1.Draw 0, 100, XWidth, 0

End Sub


AnnotationLineWidth Example - VC++
AnnotationLineWidth Example [image] VC++

This example draws a 10-pixel-wide line across the width of an image.

void CImgEdit1Dlg::OnDrawline()

{

    // This would draw a line across the width of an image

    long XWidth;

    // Determine the width of the image -- this will

    // work even if the image is scaled up or down

    XWidth = ImgEdit1.GetImageScaleWidth();

    // line will be green, transparent, 10 pixels wide

    ImgEdit1.SetAnnotationLineColor(0xFF00);    // vbGreen

    ImgEdit1.SetAnnotationLineStyle(0);  // 0

    ImgEdit1.SetAnnotationLineWidth(10); // 10

    ImgEdit1.SetAnnotationType(1); // wiStraightLine 1

    // Draw the line

    // left position = 0 (start at left side)

    // top position = 100 pixels from top of page

    // width of line = width of image as it is displayed

    // height of line = 0 (line will be horizontal)

    VARIANT vWidth; V_VT(&vWidth) = VT_I4; V_I4(&vWidth) = XWidth;

    VARIANT vHeight; V_VT(&vHeight) = VT_I4; V_I4(&vHeight) = 0;

    ImgEdit1.Draw(0, 100, vWidth, vHeight);

}


AnnotationStampText Property

See Also	Example-VB	Example-VC++
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.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 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, 97 for 1997
%Y	ASCII numeric full year; for example, 1997
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-97

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


AnnotationStampText Example - VB
AnnotationStampText Example [image] VB

This example places a customized rubber stamp at a predetermined location on the image.  TheAnnotationStampText property is set to the desired stamp content, which includes a combination of text and date macros.

Private Sub cmdStamp_Click()

    ImgEdit1.AnnotationFont = "Courier"

    ImgEdit1.AnnotationFontColor = vbRed

    'This stamp uses embedded text macros for date and time

    ImgEdit1.AnnotationStampText = "Application received on %B %d, %Y at %H"

    ImgEdit1.AnnotationType = wiTextStamp  '8

    ImgEdit1.Draw 10, 10

End Sub


AnnotationStampText Example - VC++
AnnotationStampText Example [image] VC++

This example places a customized rubber stamp at a predetermined location on the image.  TheAnnotationStampText property is set to the desired stamp content, which includes a combination of text and date macros.

void CImgEdit1Dlg::OnRubberStamp()

{

    // Places a customized rubber stamp at a predetermined

    // location on the image.  Font used is Courier and color

    // is red

    COleFont szFontType;

    szFontType = ImgEdit1.GetAnnotationFont();

    szFontType.SetName("Courier New");

    ImgEdit1.SetAnnotationFont(szFontType);

    ImgEdit1.SetAnnotationFontColor(0xFF);  // vbRed

    // This stamp uses embedded text macros for date and time

    ImgEdit1.SetAnnotationStampText("Application received on %B %d, %Y at %H");

    ImgEdit1.SetAnnotationType(8); // wiTextStamp  // 8

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.Draw(10, 10, evt, evt);

}


AnnotationTextFile Property

See Also	Example-VB	Example-VC++
Returns or sets the fully-qualified file name of a text file to embed into an image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 file name.  A file extension is required for all files.

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


AnnotationTextFile Example - VB
AnnotationTextFile Example [image] VB

This example uses the SelectTool method to select the Text From File annotation type.  It then uses the content of the AnnotationTextFile property and the Draw method to overlay text from a text file onto an image.

Private Sub cmdSelectTool_Click()

    'If the annotation tool palette is utilized within an

    'application, SelectTool should be used rather than

    'setting the AnnotationType property for drawing marks

    'programatically.

    ImgEdit1.SelectTool 9 'Text from file

    ImgEdit1.AnnotationTextFile = "C:\text\disclaim.txt"

    ImgEdit1.Draw 20, 20

End Sub


AnnotationTextFile Example - VC++
AnnotationTextFile Example [image] VC++

This example uses the SelectTool method to select the Text From File annotation type.  It then uses the content of the AnnotationTextFile property and the Draw method to overlay text from a text file onto an image.

void CImgEdit1Dlg::OnSelectTool()

{

    // Uses the SelectTool method to select the Text from file

    // annotation type.  Overlays text from a text file onto an

    // image.

    // If the annotation tool palette is utilized within an

    // application, SelectTool should be used rather than

    // setting the AnnotationType property for drawing marks

    // programatically.

    ImgEdit1.SelectTool(9); // Text from file

    ImgEdit1.SetAnnotationTextFile("C:\\text\\disclaim.txt");

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.Draw(10, 10, evt, evt);

}


AnnotationType Property

See Also	Example-VB	Example-VC++
Returns or sets the type of annotation to be drawn.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Note: Hyperlink and OCR Zone annotation types are available with Imaging for Windows Professional Edition V1.0, V1.1, and V2.0 only.

Applies To

Image Annotation Tool Button control, Image Edit control

Syntax

object.AnnotationType[=value]

Data Type

Integer (enumerated)

Constant	Setting	Description
wiNone	0 (default)	None
wiStraightLine	1	Straight Line
wiFreehandLine	2	Freehand Line
wiHollowRect	3	Hollow Rectangle
wiFilledRect	4	Filled Rectangle
wiImageEmbedded	5	Image Embedded
wiImageReference	6	Image Reference
wiText	7	Text
wiTextStamp	8	Text Stamp
wiTextFromFile	9	Text From File
wiTextAttachment	10	Attach-a-Note
wiAnnotationSelection	11	Select Annotations
wiHyperlink	12	Hyperlink
wiOcrRegion	13	OCR Zone
wiInitials	14	Initials
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 an 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.

Do not attempt to change the AnnotationType property when the standard Annotation Tool Palette is displayed.  Use the SelectTool method instead.

Tab Characters

The Image Annotation Tool Button control and the Image Edit control do not support the use of Tab characters in any of the text-related annotation types.

Image Embedded and Image Reference Annotation 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 (file name only).

Hyperlink Annotation Remarks

The Hyperlink annotation type (setting 12) lets end users enter hypertext jumps on an image.   (The hypertext jumps are similar to those encountered on the Word Wide Web.)

When end users draw the text box for a Hyperlink annotation at run time, Imaging invokes the Link To dialog box, which enables them to specify the item they want the annotation to be linked to.  Hyperlink annotations can be linked to the following items:

An image page in a TIFF image document stored on a local or network drive

Universal Resource Locator (URL) on the World Wide Web

While users can draw a Hyperlink annotation on any type of image, a Hyperlink annotation can be saved to disk only when the image upon which it is drawn is saved as a TIFF file.  If end users burn-in a Hyperlink annotation, it no longer functions as a hypertext jump.

Keep in mind that any annotation type can be a Hyperlink annotation.  You can use the ShowAttribsDialog method of the Image Edit control to invoke the Link To dialog box at run time.  The Link To dialog box lets end users specify the item they want a selected annotation to be linked to.

OCR Zone Annotation Remarks

The OCR Zones annotation type (setting 13) lets end users draw OCR zones on an image.  OCR zones control the process of recognizing image documents (otherwise known as performing OCR).  Depending on the setting of the AnnotationOcrType property, OCR zones can be text zones or picture zones.

OCR Text zones [image] Define areas of an image containing text to be processed by the OCR engine.  When the OCR engine encounters a text zone, it converts the underlying image to text.  When drawn, OCR Text zones are dark green in color.

OCR Picture zones [image] Define areas of an image containing one or more pictures that should not be processed by the OCR engine.  When the OCR engine encounters a picture zone, it does not convert the underlying image to text, it retains the image as a graphic instead.  When drawn, OCR Picture zones are dark magenta in color.

While users can draw OCR Zone annotations on any type of image, OCR processing functions only with zones drawn on read/write TIFF images.  OCR Zone annotations cannot be burned into TIFF images.


AnnotationType Example - VB
AnnotationType Example [image] VB

This example lets the user draw OCR text regions on an image for zoned recognition.  The AnnotationType property is set to the OCR Zone annotation type, and the AnnotationOcrType property is set so a Text OCR zone can be drawn.

Private Sub cmdDrawOcrZone_Click()

    ImgEdit1.AnnotationType = wiOcrRegion

    ImgEdit1.AnnotationOcrType = wiOcrTypeText

End Sub


AnnotationType Example - VC++
AnnotationType Example [image] VC++

This example lets the user draw OCR text regions on an image for zoned recognition.  The AnnotationType property is set to the OCR Zone annotation type, and the AnnotationOcrType property is set so a Text OCR zone can be drawn.

void CImgEdit1Dlg::OnDrawOcrZone()

{

    // This would enable the user to draw OCR text regions

    // on an image for zone recognition.

    ImgEdit1.SetAnnotationType(13);    // wiOcrRegion

    ImgEdit1.SetAnnotationOcrType(0);  // wiOcrTypeText

}


DestImageControl Property

See Also	Example-VB
Returns or sets the link to the Image Edit control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Annotation Tool Button control

Syntax

object.DestImageControl[=controlname]

Data Type

String

Remarks

Set the DestImageControl property to the name of the desired Image Edit control.  The ImageControl property of the Image Edit control must also be set to the same name. A unique default name is provided when you draw the control on a form.

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.


DestImageControl Example - VB
DestImageControl Example [image] VB

In this example, the DestImageControl property determines which Image Edit control will draw Image Annotation Tool Button annotations.

Private Sub cmdDestImage_Click()

    'If there are multiple ImgEdit controls within an

    'application, use the DestImage control to define

    'which image window to place annotation marks on.

    'ImageControl names will default to ImgEdit1, ImgEdit2,

    'etc. at the time the controls are drawn.  The control

    'name could be changed at design time if desired.

    'Draw a straight line on the Image Edit control whose

    'ImageControl name is ImgEdit2

    ImgAnnTool1.DestImageControl = "ImgEdit2"

    ImgAnnTool1.AnnotationType = wiStraightLine

    ImgAnnTool1.Draw 10, 10, 100, 100

    'Sets the AnnotationType to a filled rectangle and

    'the fill color of the rectangle to blue using Visual

    'Basic color constants.

    ImgAnnTool1.AnnotationType = wiFilledRect '4

    ImgAnnTool1.AnnotationFillColor = vbBlue

    'Draw the blue rectangle on the Image Edit control whose

    'ImageControl name is ImgEdit1

    ImgAnnTool1.DestImageControl = "ImgEdit1"

    ImgAnnTool1.Draw 10, 10, 100, 100

End Sub


Enabled Property

See Also	Example-VB
Enables or disables the control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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)
Note:  The properties of the Image Annotation Tool Button control cannot be updated when the control is disabled.


Enabled Example [image] VB

This example.


hWnd Property

See Also	Example-VB
Indicates the window handle to the control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


hWnd Example [image] VB

This example.


PictureDisabled Property

See Also	Example-VB
Returns or sets the bitmap image that appears on the control when its Enabled property is set to False (disabled).

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Annotation Tool Button control

Syntax

object.PictureDisabled[=picture]

Data Type

Picture

Remarks

The bitmap is scaled to fit the size of the control.  If no bitmap is specified, the default bitmap is used.


PictureDisabled Example - VB
PictureDisabled Example [image] VB

This example demonstrates how to use the PictureUp, PictureDown, and PictureDisabled properties to display the appropriate bitmap images on an Image Annotation Tool Button control.

PictureUp [image] Sets the bitmap picture that is displayed when the button is enabled, but not selected.

PictureDown [image] Sets the bitmap picture that is displayed when the button is selected.

PictureDisabled [image] Sets the bitmap picture that is displayed when the button is disabled.

Private Sub frmToolPal_Load()

    'When using the annotation control to create a custom

    'tool palette, you can designate bitmaps to be used on

    'the tools when they are in various states. If these

    'values are not specified, default values will be used.

    'Note that it may be more efficient to set these

    'properties at design time.

    'Defines what picture will be shown if the button is

    'enabled

    ImgAnnTool1.PictureUp = LoadPicture("D:\yourapp\lineup.bmp")

    'Defines what picture will be shown when the button is

    'selected

    ImgAnnTool1.PictureDown = LoadPicture("D:\yourapp\linedown.bmp")

    'Defines what picture will be shown when the button is

    'disabled (grayed)

    ImgAnnTool1.PictureDisabled = LoadPicture("D:\yourapp\lineoff.bmp")

End Sub


PictureDown Property

See Also	Example-VB
Returns or sets the bitmap image that appears on the control when it is selected.  A control is selected when an end user clicks on it, or when its Value property is set to True within a program.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Annotation Tool Button control

Syntax

object.PictureDown[=picture]

Data Type

Picture

Remarks

The bitmap is scaled to fit the size of the control.  If no bitmap is specified, the default bitmap is used.

The following remark applies when more than one Image Annotation Tool Button control is used with an Image Edit control (in other words, when each button has the same DestImageControl property value):

When an Image Annotation Tool Button control is clicked by the end user, its Value property changes to True and its bitmap changes to the image assigned to its PictureDown property.  For each of the other Image Annotation Tool Button controls, the Value property changes to False and the bitmap assigned to its PictureUp property is displayed.


PictureDown Example - VB
PictureDown Example [image] VB

This example demonstrates how to use the PictureUp, PictureDown, and PictureDisabled properties to display the appropriate bitmap images on an Image Annotation Tool Button control.

PictureUp [image] Sets the bitmap picture that is displayed when the button is enabled, but not selected.

PictureDown [image] Sets the bitmap picture that is displayed when the button is selected.

PictureDisabled [image] Sets the bitmap picture that is displayed when the button is disabled.

Private Sub frmToolPal_Load()

    'When using the annotation control to create a custom

    'tool palette, you can designate bitmaps to be used on

    'the tools when they are in various states. If these

    'values are not specified, default values will be used.

    'Note that it may be more efficient to set these

    'properties at design time.

    'Defines what picture will be shown if the button is

    'enabled

    ImgAnnTool1.PictureUp = LoadPicture("D:\yourapp\lineup.bmp")

    'Defines what picture will be shown when the button is

    'selected

    ImgAnnTool1.PictureDown = LoadPicture("D:\yourapp\linedown.bmp")

    'Defines what picture will be shown when the button is

    'disabled (grayed)

    ImgAnnTool1.PictureDisabled = LoadPicture("D:\yourapp\lineoff.bmp")

End Sub


PictureUp Property

See Also	Example-VB
Returns or sets the bitmap image that appears on the control when it is enabled but not selected.  A control is enabled when its Enabled property is set to True.  A control is not selected (deselected) when the end user has not clicked on it, or when its Value property is set to False within a program.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Annotation Tool Button control

Syntax

object.PictureUp[=picture]

Data Type

Picture

Remarks

The bitmap is scaled to fit the size of the control.  If no bitmap is specified, the default bitmap is used.


PictureUp Example -VB
PictureUp Example [image] VB

This example demonstrates how to use the PictureUp, PictureDown, and PictureDisabled properties to display the appropriate bitmap images on an Image Annotation Tool Button control.

PictureUp [image] Sets the bitmap picture that is displayed when the button is enabled, but not selected.

PictureDown [image] Sets the bitmap picture that is displayed when the button is selected.

PictureDisabled [image] Sets the bitmap picture that is displayed when the button is disabled.

Private Sub frmToolPal_Load()

    'When using the annotation control to create a custom

    'tool palette, you can designate bitmaps to be used on

    'the tools when they are in various states. If these

    'values are not specified, default values will be used.

    'Note that it may be more efficient to set these

    'properties at design time.

    'Defines what picture will be shown if the button is

    'enabled

    ImgAnnTool1.PictureUp = LoadPicture("D:\yourapp\lineup.bmp")

    'Defines what picture will be shown when the button is

    'selected

    ImgAnnTool1.PictureDown = LoadPicture("D:\yourapp\linedown.bmp")

    'Defines what picture will be shown when the button is

    'disabled (grayed)

    ImgAnnTool1.PictureDisabled = LoadPicture("D:\yourapp\lineoff.bmp")

End Sub


Value Property

See Also	Example-VB
Selects or deselects the control at run-time.  Setting this property to True selects the control, which is the same as an end user clicking on it.  Setting this property to False deselects the control.

When a control is selected, the following events occur:

The bitmap specified in the PictureDown property is drawn on the control

Other controls on the form with the same DestImageControl property value have their Value property set to False automatically

The AnnotationType property in the Image Edit control is changed to the value of the AnnotationType property in the Image Annotation Tool Button control.

When a control is deselected, the bitmap specified in the PictureUp property is drawn on the control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Annotation Tool Button control

Syntax

object.Value[={True|False}]

Data Type

Boolean

Setting	Description
True	Control is selected
False (default)	Control is deselected
Remarks

This property is available only at run-time.


Value Example [image] VB

This example.


Draw Method

See Also	Example-VB	Example-VC++
Draws the annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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:

Attach-a-Note

Filled Rectangle

Freehand Line

Hollow Rectangle

Select Annotations (optional; see the following Note)

Straight Line

Text

Invoking the Draw method sets the ImageModifed property of the Image Edit control to True.

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.


Draw Example - VB
Draw Example [image] VB

This example uses the SelectTool method to select the Text From File annotation type.  It then uses the content of the AnnotationTextFile property and the Draw method to overlay text from a text file onto an image.

Private Sub cmdSelectTool_Click()

    'If the annotation tool palette is utilized within an

    'application, SelectTool should be used rather than

    'setting the AnnotationType property for drawing marks

    'programatically.

    ImgEdit1.SelectTool 9 'Text from file

    ImgEdit1.AnnotationTextFile = "C:\text\disclaim.txt"

    ImgEdit1.Draw 20, 20

End Sub


Draw Example - VC++
Draw Example [image] VC++

This example uses the SelectTool method to select the Text From File annotation type.  It then uses the content of the AnnotationTextFile property and the Draw method to overlay text from a text file onto an image.

void CImgEdit1Dlg::OnSelectTool()

{

    // Uses the SelectTool method to select the Text from file

    // annotation type.  Overlays text from a text file onto an

    // image.

    // If the annotation tool palette is utilized within an

    // application, SelectTool should be used rather than

    // setting the AnnotationType property for drawing marks

    // programatically.

    ImgEdit1.SelectTool(9); // Text from file

    ImgEdit1.SetAnnotationTextFile("C:\\text\\disclaim.txt");

    VARIANT evt; V_VT(&evt) = VT_ERROR;	// set to default

    ImgEdit1.Draw(10, 10, evt, evt);

}


GetVersion Method

See Also	Example-VB
Returns the Product Version number of the Imaging control (for example, 1.09.1403).

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
The GetVersion method of the Image Annotation Tool Button control is available in all versions of Imaging for Windows.

Applies To

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

Syntax

object.GetVersion

Arguments

None

Return Value

String

Remarks

None


GetVersion Example [image] VB


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


Annotation styles

You can assign the same annotation type to two or more IATB controls.  When you do, you can set some of the properties of each control to different values to create distinctive annotation styles.

Example

You may want to include two buttons (controls) in your application that let users draw two different types of Attach-a-Note annotations.

While both controls are assigned to the same annotation type, each is set to different AnnotationBackColor and AnnotationFontColor property values, resulting in two distinct annotation styles.  One button lets users draw Attach-a-Note annotations with a yellow background and black text, while the other button lets users draw Attach-a-Note annotations with a red background and white text.


Annotation types

The Image Annotation Tool Button Control supports the following discrete 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 Highlights text when drawn using the transparent line style
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
Hyperlink	Enters a hypertext link directly on an image; invokes the Link To dialog box to permit end users to specify the desired link
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)
OCR Zone	Draws an OCR Text or Picture zone on an image
Select Annotations	Selects annotation marks for deleting, modifying, moving, or resizing
Straight Line	Underlines text, demarcates a section of a page, or draws callout lines Highlights text when drawn using the transparent line style
Text	Enters text directly on an image
Text From File	Enters text from a file on an image
Text Stamp	Places a text stamp directly on an image
Note:  Hyperlink and OCR Zones are available with Imaging for Windows Professional Edition (V1.0, V1.1, V2.0, and V2.5) only.


pixel

Also known as a picture element, a pixel is a dot that represents the smallest graphic unit of measure on a screen.  A pixel is a screen-dependent unit of measure, meaning that its size varies with the display system and resolution.


Extender Properties (Image Annotation Tool Button)
IATB Extender Properties

See Also	Example
This topic lists the Extender properties that are available when the Image Annotation Tool Button control is drawn on a Visual Basic form.

Name	Description
Container	Returns the container of an object
DataBindings	Returns the DataBindings collection object containing the available bindable properties
DragIcon	Returns or sets the mouse pointer icon in a drag-and-drop operation
DragMode	Returns or sets the drag mode (manual or automatic)
Height	Returns or sets the height of an object
HelpContextID	Returns or sets the Help context ID for an object
Index	Returns or sets the subscript value of a control in an array of controls
Left	Returns or sets the distance between the left edge of an object and the left edge of its container
Name	Returns the name of an object
Object	Returns a reference to a property or method of a control that has the same name as a property or method extended to the control
Parent	Returns the form, object, or collection that contains either a control, or another object or collection
TabIndex	Returns or sets the tab order of an object within its parent
TabStop	Returns or sets whether the Tab key can be used to move focus to an object
Tag	Returns or sets ancillary data
ToolTipText	Returns or sets a tool tip.
Top	Returns or sets the distance between the top edge of an object and the top edge of its container
Visible	Returns or sets whether an object is visible or hidden
WhatsThisHelpID	Returns or sets the context-sensitive help ID for an object
Width	Returns or sets the width of an object
Refer to the Visual Basic on-line help for more information about these properties.


Extender Methods (Image Annotation Tool Button)
IATB Extender Methods

See Also	Example
This topic lists the Extender methods that are available when the Image Annotation Tool Button control is drawn on a Visual Basic form.

Name	Description
Drag	Begins, ends, or cancels a drag operation.
Move	Moves an object
SetFocus	Gives focus to the object specified
ShowWhatsThis	Displays the help topic corresponding to the value of the WhatsThisHelpID property
Zorder	Places an object at the front or back of the z-order within its graphical level
Refer to the Visual Basic on-line help for more information about these methods.


Extender Events (Image Annotation Tool Button)
IATB Extender Events

See Also	Example
This topic lists the Extender events that are available when the Image Annotation Tool Button control is drawn on a Visual Basic form.

Name	Description
Click	Fires when a user presses and then releases a mouse button over an object
DragDrop	Fires when a drag-and-drop operation is completed.
DragOver	Fires when a drag-and-drop operation is in progress
Error	Fires when an error occurs
GotFocus	Fires when an object receives focus
KeyDown	Fires when a user presses a key while the object has focus
KeyPress	Fires when a user presses and then releases a key while the object has focus
KeyUp	Fires when a user releases a key while the object has focus
LostFocus	Fires when an object loses focus
MouseDown	Fires when a user presses a mouse button
MouseMove	Fires when a user moves the mouse
MouseUp	Fires when a user releases a mouse button
Refer to the Visual Basic on-line help for more information about these events.


Extender properties, methods, and events

Extender properties, methods, and events are provided by the container of the Imaging control, rather than by the control itself.

Examples of Extender properties are:

Name

Index

Top

Examples of Extender methods are:

Drag

SetFocus

ShowWhatsThis

Examples of Extender events are:

Click

DragDrop

MouseMove

Some Extender properties, methods, and events are standard for all containers, others are provided only by specific containers.

Refer to the documentation that came with your development environment for more information about Extender properties, methods, and events.


Imaging Concepts

  Annotations

  Compression

  Display

  Images

  Optical Character Recognition (OCR)

  Palettes

  Scanning


Annotations

  What Are Annotations?

  Annotation Functions

  Annotation Groups

  Annotation Types

  Hyperlinks

  OCR Zones


Compression

  What Is Compression?

  Compression Options

  Compression Type Support

  Compression Types


Display

  What Are Display Functions?

  Display Types

  Enhancement Functions

  Flipping and Rotating

  Image Color Matching

  Magnifying

  Scrolling

  Zooming In and Out


Images

  What Is An Image?

  Dithering

  Enhancement Functions

  File Types

  Image Color Matching

  Image Document Files

  Image Page

  Page (Color) Types

  Summary Properties

  Thumbnails

  Imaging Units of Measure


Units of Measure
Imaging Units of Measure

  Dots Per Inch

  Pixel

  Resolution


Palettes

  What Is A Palette?

  Common Palette?

  Custom Palette?


Scanning

  What Is Scanning?

  TWAIN Specification


Optical Character Recognition (OCR)
OCR

  What Is OCR?

  Document Recomposition

  Input Quality Types

  Interactive Training

  Layout Types

  OCR Zones

  Original Document Language

  Output Types

  Training Files

  User-Defined Dictionaries


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 (TIFF image documents only).

Link annotation marks to pages in image documents, to other files on the user's system, or to Universal Resource Locators (URLs) on the World Wide Web.  Such annotations become hypertext jumps.  When users click on them, the destination image or Web page appears.  Image pages appear in an Image Edit and/or Image Thumbnail control; Web pages appear in the registered Web browser.

Note:  Hyperlink annotations are available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5.


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.


Hyperlinks

Hyperlinks are image annotations that function the same as hypertext jumps typically encountered in help systems and on the World Wide Web.  They provide a way to navigate within image documents and to Web pages.

When drawn, hyperlink annotations become hypertext jumps.  When users click on them, the destination image or Web page appears.

Note:  Hyperlink annotations are available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5.


Annotation Types

Imaging ActiveX 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
Hollow Rectangle	Places a border around areas of an image for emphasis
Hyperlink	Enters a hypertext link directly on an image; invokes the Link To dialog box to let end users specify the desired link
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)
Initials	Places an initials stamp on the image. The initials of the user who is logged on are used.
OCR Zones	Draws an OCR Text or Picture zone on an 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
Note:  Hyperlink and OCR Zone annotations are available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5.


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.

Digitized annotations can be linked to pages in image documents, to other files on the user's system, or to Universal Resource Locators (URLs) on the World Wide Web.  Such annotations become hypertext jumps, similar to those encountered on the Web.

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

Annotation marks can be saved within a TIFF image file as annotation data that is kept separate from the image data.  The marks can also 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.

Notes:  Linked annotations cease to function as hypertext jumps when they are burned in.

Hyperlink annotations are available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5.


What Is Compression?

When saved to disk, images can require a large amount of storage space.  Compression is a technique that reduces this large disk space requirement.  The more compression is applied when saving images, the lower the disk space requirement.

However, an inverse relationship can exist between compression and image quality.  When you use a lossy compression type (such as JPEG), image quality decreases as compression increases.

Accordingly, you must exercise caution and use the compression setting that satisfies your requirements.


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 ActiveX method, the software checks the relationship for validity.


Compression Option Support

Imaging ActiveX controls support the following compression options:

Compressed LTR [image] 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 option is used by the LZW compression type and serves as the default option for all black-and-white compression types except PackBits.

EOL [image] 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 [image] 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 and LZW.

Negate [image] 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 [image] 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 [image] 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 [image] Joint Photographics Experts Group compression options.  JPEG compression options comprise all combinations of high, medium, or low resolution and high, medium, or low quality.

The higher the compression, the lower the disk space requirement; the higher the resolution, the greater the image quality.  An image compressed with the High Resolution/High Quality option has the highest disk space requirement and the highest image quality.  Conversely, an image compressed with the Low Resolution/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 page type, the Imaging ActiveX controls support the following compression types:

File Type	Page Type	Compression Type Supported
AWD	Black-and-White	RBA (read-only, Microsoft-proprietary)
BMP	Black-and-White Palettized4 Palettized8 BGR24	None
DCX/PCX (read-only)	Black-and-White Palettized4 Palettized8 RGB24	PCX-proprietary
GIF (read-only)	Gray4 Gray8 Palettized4 Palettized8	LZW
JPG	Gray8 RGB24	JPEG
TIFF	Black-and White Gray4 Gray8 Palettized4 Palettized8 RGB24	None, Group3(1D), Group3(2D), Group3(MH), Group4(2D), PackBits None, LZW None, JPEG, LZW None, LZW  None, LZW None, JPEG, LZW
WIFF (read-only)	Black-and-White	None, Group3(1D), Group4(2D)
XIF (read-only)	Black-and-White	None, Xerox-proprietary
Notes:  For TIFF file types, the Palettized4 page type is read-only.  The Group3(2D) compression type is read-only.

AWD is not available with Imaging for Windows NT 4.0.
GIF and WIFF are available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5, as well as with Imaging for Windows 98.


Compression Types

Imaging ActiveX controls support the following compression types:

RBA (read-only) [image] 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) [image] A compression type based on the CCITT Group3 fax standard, Group3(1D) is used to compress black-and-white TIFF image document 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) (read-only) [image] Similar to the Group3(1D) compression type, Group3(2D) is used to compress black-and-white TIFF image document files for fax transmission exclusively.  Group 3(2D) encodings provide a high degree of error recovery during fax transmission.

Group3(Modified Huffman [MH]) [image] Group3(MH) is also used to compress black-and-white TIFF image document files.  Group3(MH) encodings are designed to provide reliable delivery of image data over inherently unreliable data links.  It differs from Group3(1D) in that it provides increased compression.

Group4(2D) [image] Based on the CCITT Group4 fax standard, Group4(2D) is used to compress black-and-white TIFF image document files saved to disk, or sent as faxes or e-mail messages 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 [image] The Joint Photographics Experts Group compression type is used to compress 24-bit color (RGB24) and 8-bit gray-scale (Gray8) TIFF image document files.  JPEG produces a high compression ratio, but some image data is actually lost during compression.

JPEG is a lossy compression type, which means that some data is altered and lost during compression.  Most of the time, data alteration and loss are not significant.  Lossy compression types typically offer higher compression ratios than do lossless compression types.

When using the JPEG compression type, JPEG compression options can also be specified.  These options determine the overall quality of image documents and the storage space they require.

LZW (Lempel-Ziv-Welch) [image] The LZW compression type compresses TIFF image documents of any page type (except black-and-white).  It is a lossless compression type, which means that no data is altered or lost during compression.  Lossless compression types typically offer lower compression ratios than do lossy compression types.

PackBits [image] PackBits is used to compress black-and-white TIFF image documents for any purpose.  PackBits is a simple, byte-oriented run-length compression scheme that has a good worst-case behavior.

PCX (read-only) [image] A ZSoft-proprietary compression type, PCX is used to compress multipage DCX and single-page PCX black-and-while and color images.

Xerox-proprietary (read-only) [image] The Xerox-proprietary compression type is used to compress XIF images.


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.


What Are Display Functions?

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

Copying, cutting, and pasting to the Clipboard

Flipping and Rotating

Magnifying

Scrolling

Zooming

Except for those methods that rotate all pages in a multipage image document, 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.  Using the magnifier window does not affect the image even when it 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 ActiveX controls support the following display types:

Black-and-White (Bi-Level) [image] 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.

Common [image] 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 [image] 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 [image] Displays an image using a linear-scale palette of up to 128 shades of gray.

RGB24 [image] 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.


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 ActiveX controls support the following file types:

AWD [image] The AWD (At Work Document) file type is used by Microsoft Fax.  AWD supports the black-and-white page type only; its image documents can contain multiple image pages.  AWD image documents are compressed using Microsoft's RBA compression.

BMP [image] The BMP (bitmap) file type is used by many Windows applications.  A Bitmap image is a representation of a graphic image, displayed by setting individual pixels to white, black, or a color.  BMP supports all page types; its image documents can contain only a single image page.  Compression of BMP image document files is not supported.

DCX (read-only) [image] The DCX file type was made popular by ZSoft Corporation's PC Paintbrush program and continues to be used by many graphics programs.  DCX supports all page types; its image documents can contain multiple image pages.  DCX image document files are compressed using PCX compression.

GIF (read-only) [image] The GIF (Graphics Interchange Format) file type was made popular by CompuServe and continues to be used by many graphics programs.  GIF supports the following page types: Gray4, Gray8, Palettized4, and Palettized8.  Its image documents can contain only a single image page.  GIF image document files are compressed using LZW compression.

JPG [image] The file format for Joint Photographics Experts Group (JPEG) images.  JPG supports the following page types: Palettized8 and RGB24.  Its image documents can contain only a single image page. JPG image document files are compressed using JPEG compression.

PCX (read-only) [image] The PCX file type was made popular by ZSoft Corporation's PC Paintbrush program and continues to be used by many graphics programs.  PCX supports all page types; its image documents can contain only a single image page.  PCX image document files are compressed using PCX compression.

TIFF [image] The TIFF (Tagged Image File Format) file type is used by many applications.  TIFF supports all page types.  Its image documents can contain multiple image pages, and can store Summary property information and image annotation data separate from the actual image data.  TIFF supports several compression types.

WIFF (read-only) [image] The WIFF (Wang Image File Format) file type is used by Wang Integrated Image Systems.  WIFF supports the black-and-white page type; its image documents can contain multiple image pages.  WIFF supports several compression types.

XIF (read-only) [image] XIF is the file type for Xerox image documents.  When read by Imaging, XIF supports the black-and-white page type; its image documents can contain multiple image pages.  XIF image document files are compressed using Xerox-proprietary compression.

Note:  AWD is not available with Imaging for Windows NT 4.0.  GIF and WIFF are available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5, as well as with Imaging for Windows 98.


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.


Image Files
Image Document Files

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

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


Image Color Matching

Image Color Matching (ICM) is Microsoft's implementation of device-independent color management support, as defined by the International Color Consortium (ICC).

ICM makes it possible to accurately display and print colors regardless of the devices being used.  ICM relies upon ICC-standard device profiles that:

Convert the color space of a source device into a standard CIE (International Commission on Illumination) color space, and then

Convert the standard CIE color space to that of the output device

When ICM support is enabled in the Image Edit control, Imaging uses color management profiles when displaying or printing an image document so the output devices display or print the colors of the image document as accurately and consistently as possible.

Note:  ICM is available with Imaging for Windows Professional Edition V2.0 and V2.5, as well as with Imaging for Windows 98.


Thumbnails

Thumbnails are miniature representations of image document pages.  The Image Thumbnail control lets you manage thumbnails.

If implemented in your program, end users can use thumbnails in multipage image documents to:

Display each page of the image document in a miniature format

Select pages for enlarged display, deletion, or some other purpose

Rearrange the order of image pages within the image document


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

WIFF

XIF

Note:  AWD is not available with Imaging for Windows NT 4.0. WIFF is available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5, as well as with Imaging for Windows 98.


Page Types
Page (Color) Types

Also known as the data type, color model or image type, the page type specifies the number of colors image documents can have.

The factor that determines the color content of image documents is the number of data bits each picture element (pixel) is composed of.  The formula for determining the color content of image documents is 2 to the power of the number of pixel bits.

Imaging ActiveX controls support the following page types:

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

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

Gray4 [image] 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 [image] 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 [image] There are two types of palettized images:  Palettized4 and Palettized8.

Palettized4 [image] 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 [image] 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.

True Color-BGR24 [image] This type of image uses 24 bits of data per pixel (eight bits-per-pixel for each of the three primary colors [image] 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 page type is typically encountered in BMP files.

True Color-RGB24 [image] An RGB24 image is the same as a BGR24 image, but with the colors (Red, Green, and Blue) in a different order.

Importance of Page Type Selection

Aesthetics aside, the most important consideration when selecting a page type is file size.  The greater the number of composite bits in an image document's picture elements, the greater the memory and storage requirements.  For example, image documents whose picture elements are composed of 24 bits require much more memory and storage space than do those whose picture elements are composed of one bit.


What Is a Palette
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.


Dithering

Dithering is a process that creates new colors or shades from a pattern of other colors or shades.  It is typically used to create gray-scale images from black and white images, or to expand the number of colors in a color palette.


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.


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 ActiveX controls support TWAIN-compatible devices.


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 32-bit TWAIN DLLs.  The required TWAIN DLLs are provided with Imaging.


Enhancement Functions

Enhancement functions improve the appearance of image documents.

If implemented in your program, end users can apply the following types of image enhancement:

Despeckling [image] Cleans black-and-white image documents by removing small specks from them.  These small specks are typically left by copiers and fax machines.

Deskewing [image] Straightens crooked image documents.  It is particularly useful for straightening image documents that were improperly aligned when scanned.

Cropping [image] Removes unwanted borders from image documents.

Inverting [image] Changes the pixels in the image document to their complimentary color, making the image look like a photographic negative.

Note:  The despecking, deskewing, and cropping functions are available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5 only.  The inverting function is available with Imaging for Windows Professional Edition V2.0 and V2.5.


Flipping and Rotating

Flipping and rotating are operations that change the orientation of image documents.  Flipping means to rotate an image document 180 degress.  Rotating means to turn an image document to the left or to the right, to the degree specified either programmatically or by the user.


Magnifying

Magnifying is an operation that makes a portion of an image document page appear larger on the screen, so that greater detail may be viewed.  It differs from zooming in, which makes the entire image document page appear larger.

A special magnifier window appears on the image page when magnification is invoked.  Only the part of the image directly beneath the magnifier window is enlarged.

The magnifier window can be moved and resized by the user at run time.  It is ideal for examining portions of an image close up.


Scrolling

Scrolling is the act of moving images vertically and/or horizontally within an Image Edit or Image Thumbnail control.


Zooming In and Out

Zooming in is an operation that makes an image document page appear larger on the screen, so that greater detail may be viewed.  Zooming out is an operation that makes an image document page appear smaller on the screen, so that it may be viewed in its entirety.


Summary Properties

Also known as File properties, Summary properties contain information about TIFF image documents.

There are five property types:

Author

Keyword

Comments

Title

Subject

The property types provide a way to organize information about TIFF image documents.  For example, the Author property could contain the name of the person who scanned the image document ("Dave Monroe"), while the Keyword property could describe the image document ("Purchase Order").

The Image Admin control has several properties and methods that enable you to add Summary property functions to your image-enabled applications.

If implemented in your program, end users can enter and maintain Summary property information.  They will also be able to search for image documents by property content using the Find Image Files dialog box, which can be invoked via the ShowFileDialog method of the Image Admin control.

Note:  Reading and writing of Summary properties is available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5. Summary properties are read-only with Imaging for Windows 98.


What is Optical Character Recognition?
What is OCR?

Optical Character Recognition (OCR) is a technology that recognizes binary images of character shapes as text characters, and then outputs them to a computer file as a fully editable document.

The Image OCR control enables you to add OCR functions to your image-enabled applications.  If implemented in your program, end users can output image documents in a variety of output types (formats).

Note:  OCR processing is available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5.


Input Quality
Input Quality Types

If implemented in your program, the OCR control lets end users indicate the quality of the original documents they are going to OCR.  Indicating the quality of the original documents in advance of performing OCR can improve document recognition and processing time.

Auto Detect [image] This setting is ideal for original documents whose pages vary in quality.  Imaging automatically detects the input quality of each page.  Note that this option requires additional processing time as Imaging performs its analysis.

Fax [image] This setting is appropriate for original documents that were faxed or scanned at a resolution of 200 dots per inch or lower.

Dot Matrix [image] This setting is appropriate for original documents that were printed on a dot-matrix printer.  It should not be used to process image documents having a different origin.

Normal [image] This setting is ideal for original documents of good quality.

Note:  OCR processing is available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5.


Layout Types

If implemented in your program, the OCR control lets end users indicate the column layout and picture content of the original documents they are going to OCR.  Indicating the layout type in advance of performing OCR can improve document recognition.

Auto detect [image] This setting is appropriate for original documents that contain pictures, tables, or spreadsheets.  Imaging automatically detects column layout and picture content.  Use of this setting is recommended in most cases

Single column with no pictures [image] This setting is appropriate for one-column original documents without pictures, tables, or spreadsheets.

Single column with pictures [image] This setting is appropriate for one-column original documents that contain straight text and pictures.  Imaging does not perform OCR on the pictures.

Multiple columns with no pictures [image] This setting is appropriate for multiple-column original documents without pictures, tables, or spreadsheets.

Multiple columns with pictures [image] This setting is appropriate for multiple-column original documents that contain straight text and pictures.  Imaging does not perform OCR on the pictures.

Note:  OCR processing is available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5.


Output Types

The Image OCR control enables end users to output image documents in the following types (formats):

Word for Windows/Rich Text Format (RTF) [image] Generates Rich Text Format (RTF) document files, which can be used by Microsoft Word.  Can retain the layout and pictures of the original documents for document recomposition. Document files created have the extension .DOC.

WordPerfect [image] Generates document files formatted for WordPerfect.  Can also retain the layout and pictures of the original documents for document recomposition. Document files created have the extension .WPD.

HTML [image] Generates HyperText Markup Language (HTML) document files, which are typically used on the World Wide Web. Can also retain the layout and pictures of the original documents for document recomposition, except that support for multiple columns is not provided. Document files created have the extension .HTM.

Text Document [image] Generates ASCII text files, but does not retain the layout and pictures of the original documents. Depending on the ASCII text option chosen, the file can retain either a little, or much of, the layout of the original document. The Standard ASCII text option adds only spaces and carriage returns to the text file produced. The Smart ASCII Text option preserves much of the appearance of the source file. It adds spaces and tabs, aligns numbers, creates headers, footers, and indents, and converts page breaks to form feeds. Files created have the extension .TXT.

Note:  OCR processing is available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5.


Document Recomposition

Document recomposition is a process that reconstructs OCR output documents so they retain the layout of their originals.  As part of the process, the OCR engine analyzes the image and identifies text, pictures, and layout.  It uses this information to then recompose the document so it looks like its original.

If implemented in your program, recomposition is available only when the output format is set to Word for Windows/RTF, WordPerfect, or HTML.

The following conditions exist:

When the output format is set to Word for Windows/RTF or WordPerfect, the OCR engine can be set to provide full document recomposition.

When the output format is set to HTML, the OCR engine does not provide full document recomposition.  The OCR engine can be set so that original documents containing pictures are recomposed, with the pictures appearing in their original positions; however, original multi-column documents are recomposed as single-column documents.

Note:  OCR processing is available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5.


OCR Zones

If implemented in your program, the Image Annotation Tool Button control and the Image Edit control let end users draw OCR zones on image documents to control OCR processing.

Depending on the type of zone drawn, OCR processing either occurs or doesn't occur.  Using OCR zones increases the efficiency of OCR processing.

There are two types of OCR zones:

Text [image] OCR Text zones define an area of an image containing text that should be processed by the OCR engine.  When the OCR engine encounters a text zone, it converts the underlying image to text.

Picture [image] OCR Picture zones define an area of an image containing one or more pictures that should not be processed by the OCR engine.  When the OCR engine encounters a picture zone, it does not convert the underlying image to text; rather, it retains the image as a graphic.

Actual OCR processing is managed via the Image OCR control.

Note:  OCR processing is available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5.


User-Defined Dictionaries

Also known as Custom dictionaries, user-defined dictionaries can be used to improve OCR efficiency.

If implemented in your program, end users can create, edit, and select (use) dictionaries that contain unusual terminology, such as:

Technical or scientific terms

Proper names

Any other words that are not likely to be found in a standard dictionary

The OCR engine uses the contents of these user-defined dictionaries to increase the chance that such words or terminology will be recognized.

Users should therefore select a dictionary that is specifically designed for the type of image document to be processed by the OCR engine.  Otherwise, recognition accuracy may actually be decreased.

Note:  OCR processing is available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5.


Original Document Language

If implemented in your program, end users can indicate the language of the original documents they are going to OCR.

When users specify a language, Imaging loads and uses a built-in system dictionary that contains up to 50,000 words that are common to the language specified.  As a result, Imaging conducts OCR processing with greater accuracy.

Note:  OCR processing is available with Imaging for Windows Professional Edition V1.0, V1.1, V 2.0, and V2.5.


Interactive Training

Interactive Training is a facility that can improve OCR performance.  If implemented in your program, end users can conduct an interactive training session as the program performs OCR on an image document.  Then it lets users apply the training results to future OCR processing.

When run, the Interactive Training facility highlights each questionable word in its OCR Training dialog box.  The dialog box gives the user the opportunity to ignore the word, change the word, and/or add the word to a special training file as well as to the first selected user-defined dictionary.

The training file literally trains the OCR engine to perform OCR with greater efficiency and accuracy when it processes image documents similar to the one processed during the training session.

After the interactive training session is completed, the user deselects interactive training.  When recognizing image documents similar to the one processed during the training session, the user selects the training file and user-defined dictionary for use so that their training data can be applied.

Note:  OCR processing is available with Imaging for Windows Professional Edition V1.0, V1.1, V 2.0, and V2.5.


Training Files

If implemented in your program, end users can select a training file when performing OCR processing.  Training files contain accepted or corrected words that the OCR engine highlighted as questionable during one or more interactive training sessions.  They improve the process of recognizing image documents similar to the one processed during the training sessions.

You should make sure that your users include a training file that is specifically designed for the type of image document they expect to OCR. Including an inappropriate training file can actually decrease recognition accuracy.

Note:  OCR processing is available with Imaging for Windows Professional Edition V1.0, V1.1, V 2.0, and V2.5.


Out of Memory

More memory was required than is available.

There are too many applications, documents, or source files open.
Close any unnecessary applications, documents, or source files that are open.

There is a module or procedure that is too large.
Break extremely large modules or procedures into smaller ones.

There are terminate-and-stay resident programs running.
Eliminate terminate-and-stay resident programs.

There are too many device drivers loaded.
Eliminate unnecessary device drivers.


File Not Found

This file cannot be found.

A statement refers to a file that does not exist.
Check the spelling of the filename, and the path specification.


File Already Exists

You tried to create a file with the same name as an existing file.

Specify a new name, or delete the old file.


Disk Full

There is not enough room on the disk to complete the requested operation.

Move some files to another disk, or delete some files on the current disk.

Check your Windows\Temp directory or your Recycle Bin for files that you can safely delete.


Bad Filename

An error occurred trying to access the specified file.

There is an invalid filename.
Filenames must conform to operating system conventions, as well as those of the programming language.  Filenames can be up to 255 characters.  Respecify the filename, and then retry your operation.


Path File Access Error

During a file or disk-access operation, the operating system could not make a connection between the path and the filename.

The file specification is not correctly formatted.
A filename can contain a fully-qualified (absolute) or relative path.  A fully-qualified path starts with the drive name (if the path is on another drive) and then lists the explicit path from the root to the file.  Any path that is not fully-qualified is relative to the current drive and directory.

You attempted to save a file that would replace an existing read-only file.
From Windows Explorer, right-mouse click on the file, and select Properties from the pop-up menu.  From the Properties window, change the properties to enable read/write capability.


Path Not Found

The path to a file comprises the drive specification plus the directories and subdirectories used to locate the file.  A path can be relative or absolute.

During the file or disk-access operation, the operating system was unable to find the specified path.  Check the pathname and its syntax and retry your operation.


Invalid File Format

The file format you have specified is invalid.  The supported file types include:

At Work Document (AWD):  The Imaging ActiveX controls support read/write access (Windows 95 and 98 only).

Bitmap Image (BMP):  The Imaging ActiveX controls support read/write access.

Tag Image File Format (TIF):  The Imaging ActiveX controls support read/write access.

Multi-Page Paintbrush Format (DCX):  The Imaging ActiveX controls support read access.

Graphics Interchange Format (GIF):  The Imaging ActiveX controls support read access.

Joint Photographic Experts Group (JPG):  The Imaging ActiveX controls support read access.

PC Paintbrush Format (PCX):  The Imaging ActiveX controls support read access.

Wang Integrated Image Systems (WIFF):  The Imaging ActiveX controls support read access.

Xerox Format (XIF):  The Imaging ActiveX controls support read access.

If the file format you specified is a supported file type, then the data in the file may be corrupted.

Restore the file from a backup copy of the file, if it is available.


Set Not Supported at Run Time

You can only set this property at design time.


Set Not Supported

You tried to assign a value to a property that is read only at design time and run time.


Get Not Supported at Run Time
 #Get Not Supported at Run Time

You can only get a value for this property at design time.


Get Not Supported

You tried to get a value for a property that is write only.


Invalid Clipboard Format

The specified Clipboard format is incompatible with the method that is being executed.

The two supported Clipboard formats include:
CF_DIB - image data
Wang Annotation - annotation data


Invalid Picture

Only an icon, bitmap, or Windows metafile can be assigned to the Picture property or Picture object.

You attempted to assign a file to a Picture property or a Picture object that is not recognized as an icon, bitmap, or Microsoft Windows metafile.  For the MouseIcon property, the valid pictures are .ICO and .CUR file types.


Printer Error

There is a problem that prevents printing.

You do not have a printer installed.
Open My Computer and double-click on the printer icon to install your printer.  The Printers window opens, and then you can double-click on the Add Printer icon to install your printer.

The printer is not online.
Switch the printer online.

The printer is jammed, or out of paper.
Correct the paper jam, or add paper.

You tried to print a form to a printer that can accept only text.
Switch to an installed printer that can print graphics.


Invalid Property Array Index

The index number is out of bounds for the specified property.

Ensure that your index number is within the range for the property you are using.


Invalid Icon

You have set the MouseIcon property to an invalid file type.

Valid Icon file types are .ICO and .CUR.


Internal Error

An internal error has occurred.


Cancel Pressed

The CancelError property in the Admin control has been set to True.  During run time, the Cancel Pressed error will be returned when the user chooses Cancel.  If you do not want this error message to be returned, set the CancelError property to False during design time.  If you are using the Scan control, the Cancel Pressed error is returned from a method to inform you that a cancel occurred.


Scanner Already Open

The scanner is already open.

If the scanner is in use by another application, close the scanner in the other application, and retry your operation.  Otherwise, close the scanner in the current application, via the CloseScanner method, and retry your operation.


Scanner Error

An error has occurred with either the scanner or the scanner handler.  This error may be related to your scanner hardware or software.

Check your scanner hardware to ensure that it is properly powered on, and then retry the scan operation.

Save your work-in-progress, reboot your PC, and then retry the scan operation.


Bad Size

You selected an invalid image size.

Select a different image size from the TWAIN setup.


Start Scanner Failure

The start scanner operation failed.

Close the scanner driver software, and then retry the scanner operation.


Scanner Timeout

The scanner timed out.

Close the scanner, and then retry the operation.


Scanner Not Open

The scanner is closed.  The scanner must be opened prior to initiating a scan operation.

Open the scanner using the OpenScanner method, and then retry your operation.


Invalid Registration Information

The Scan registration information is incorrect.

Edit the registration information or reinstall the scanner and its software.


No Paper Feeder is Available

No paper feeder is available to the scanner.

Install a paper feeder on your scanner if there is not one already installed.

If a paper feeder is installed, then check the cable connections between the scanner and the paper feeder.


No Paper

There is no paper in the scanner’s paper feeder.

Check the paper supply and add paper to the feeder.


File Limit

Unable to generate new filenames in the current directory.

Check the path to ensure that it is valid and retry the template scan.

Check if all the file numbers have been used.  Valid file numbers range from img00000 through img99999.  If all the file numbers have been used, create a new directory and continue scanning.


Scanner Powered Off

The scanner is powered off.

Check that the scanner is plugged in and that the power is turned on.


Scanner Cover Open

The scanner cover is open.

Close the scanner cover and retry your operation.


Scan Aborted

The scan operation was cancelled while the scanner was still operating.

This error message is informational.  No action is necessary.


Scanner Jammed

The scanner is jammed.

Clear the paper path and retry the scan operation.


Invalid Compression Type

The compression type is invalid.

Select a valid compression type from the Page Options dialog box.

Specify a valid compression type for the specified image file type.

Setting	Description
0	Unknown
1	No compression
2	Group3(1D)
3	Group3(Modified Huffman)
4	PackBits
5	Group4(2D)
6	JPEG
AWD and BMP files must be saved using a Compression Type setting of 1.


Invalid File Type

The requested operation received an invalid or unknown file type that it cannot process. Valid file types are:

TIF

AWD (Windows 95 and 98 only)

BMP

You must also use one of these files types when you save a file.


Invalid Page Type

The page type is invalid.

Select a different page type from the Page Options dialog box or Scanner Setup dialog box.

Specify a valid page type based on the specified image file type.

File Types	Valid Page Type
TIF	All except BGR24
AWD	Black and White
BMP	All except RGB24


Invalid Compression Information

The compression information is invalid.

Select valid compression information from the Page Options dialog box.  You can access the Page Options dialog box from the Image property page of the Scan control.


No Image in Window

The method or property used requires that an image is displayed in the Image Edit control window.

Verify that an image is displayed in the window prior to calling this method or setting this property.


No Image Specified

The Image property for the specified image window has not been set correctly or it is blank.

Check the Image property to ensure that a valid path and image filename have been set.


Invalid Annotation Selected

The specified method cannot be completed using the selected annotation.

Verify that the selected annotation supports the attribute(s) that the method is trying to alter.  For example, if the selected annotation mark is an embedded image, then the SetSelectedAnnotationLineWidth method cannot be used.


Parameters Exceed the Maximum Limit

The argument(s) for the specified method exceed the maximum number of characters.

Respecify the argument(s) using shorter string lengths; for example, the maxiumum length for the DestImageControl property is 50 characters.  A valid string length for this property must be 50 characters or less.


Set Not Supported at Design Time

You cannot set this property at design time.  You can only set this property at run time.


No Selection Rectangle Drawn

The specified method or property requires that a selection rectangle must be drawn on the displayed image.

Before you call the method or before you set the specified property, ensure that a selection rectangle is drawn.

Ensure that the SelectRectangle property of the Image Edit control is set to True to enable the drawing of selection rectangles.


Unable to Create Tool Palette

Unable to create the Image Annotation Tool Palette window.

Save your work, terminate the application, and then retry this operation.


Additional Parameters Required

The method requires that you specify additional parameter values.

Ensure that you specified valid values for all of the parameters required by the method you are using.  For example, the ClipboardCopy method allows you to optionally specify the coordinates of the rectangle that you want to copy.  If you choose to provide any of the recrtangle coordinate values for this method, then you must provide all of the coordinate values.


Could Not Get Font Attributes

Could not retrieve the font attributes for the selected annotation.

Verify that the selected annotation supports the font attribute properties.  Save your work, exit from the application, and then retry the operation.


Invalid Annotation Type

The AnnotationType property contains an invalid value.

Set the AnnotationType property to a valid value.


Tool Palette Already Displayed

You can only have one annotation tool palette open per application.

Ensure that you have only one annotation tool palette open or close the existing annotation tool palette.


Tool Palette Not Displayed

To use the Hide method to hide the annotation tool palette, the tool palette must first be displayed.

Use the ShowAnnotationToolPalette method to display the standard annotation tool palette prior to executing the Hide method.


Scanner is Busy

The scanner is in use by another application.

Close the application that has the scanner in use, and then retry your operation.


Permission Denied

You do not have access rights to read or write to this file.

From Windows Explorer, right-mouse click on the file, and select Properties from the pop-up menu.  From the Properties dialog box, select the appropriate access rights.


Illegal Function Call

The method has terminated due to invalid parameters or property values.

Check the input parameters of the function you have called.


Invalid Property Value

A property has been set to an invalid value.

Set the property to a valid value and then retry your operation.


Page in Use

This error is returned by the DeletePages method from the Image Admin control.  You cannot delete a page because it is being displayed by either the Thumbnail control or the Image Edit control.

Close all images that are being displayed by either the Thumbnail control or the Image Edit control and then retry your operation.


Invalid Display Scale

The display scale may be valid, but not for the currently displayed image

Respecify the value of the Zoom property in the Image Edit control.  You may have to adjust the scale value several times before you find a valid value.


Invalid Rectangle

Either no rectangle was drawn, or the specified rectangle coordinates were invalid or out of range for the displayed image.

Ensure that you are in the image selection mode and then drag the image within range or use the DrawSelectionRectangle method to draw the rectangle.  All X coordinates must be between 0 and the width of the image.  All Y coordinates must be between 0 and the height of the image.


Invalid Display Options

You have requested an operation on an image that cannot be currently performed.

Review the parameters that you last used to display the image.  Operations might include editing operations such as cut, copy, or paste, or modifications such as a rotation.  Ensure that the parameters are valid values.

You may have specified valid parameters for the methods being used individually; however, if you combined any editing operations, you may have created invalid display parameters.


Invalid Page

Either the page number is beyond the range of pages in the file or the page number is 0.

Ensure that the Page Number property is set to a value that is valid for the currently displayed image.


No Annotation Selected

The method requires that an annotation is selected before it is executed.

Before you execute the method, select the annotation mark.  You can select the annotation mark via the Selection Annotation Tool palette with your mouse.  You can also use the SelectAnnotationGroup method to select all of the marks for the selected annotation group, or you can bundle a group of annotations by drawing a selection rectangle around them.


Cannot Delete File

An error occured during the delete operation.

Ensure that the file exists and that you have provided the correct filename.  If you are on a network, the file may be in use by another user or you may not have the appropriate access rights to perform the delete operation.


Fax Software Not Installed

Your fax software is not installed.


Hyperlink Reference Invalid

The item that this hyperlink refers to cannot be opened. It has been changed, moved or deleted.


Cannot Despeckle

You cannot remove speckles from the document.

Check the available memory and disk space.


Cannot Crop

You cannot crop the image.

Check the available memory and disk space.


Image Edit Control

See Also	Properties	Methods	Events
What the Image Edit control lets you do

The Image Edit control lets you [image] the application developer [image] add image display, annotation, manipulation, and management functions to applications that support 32-bit ActiveX/OCX controls.

Note:  The Image Edit control is an ActiveX control in:

Imaging for Windows Professional (V1.0, V1.1, V2.0, and V2.5)

Imaging for Windows 98

And an OCX control in:

Imaging for Windows 95

Imaging for Windows NT 4.0

What the Image Edit control lets your users do

Depending on how you design and code your application, the Image Edit control lets your users display, annotate, and manipulate image document files and managed image documents.

Image Display

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

AWD

BMP

DCX

GIF

JPG

PCX

TIFF

WIFF

XIF

Note:  AWD is not available with Imaging for Windows NT 4.0. GIF and WIFF are available with Imaging for Windows Professional Edition (V1.0, V1.1, V2.0 and V2.5); and Imaging for Windows 98.

Image Annotation

The control includes several properties, methods, and events that enable you to add annotation functions to application programs.  The annotation functions permit your end users to annotate displayed images.

You can set the annotation types you want to include in your application programmatically, or you can invoke the standard Annotation Tool Palette to include a complete set of annotation tools.  Invoking the Annotation Tool Palette frees you from writing several lines of code.

Image Manipulation

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

Convert to text (when used in conjunction with the Image OCR control)

Copy, cut, and paste to the Clipboard

Crop

Deskew

Despeckle

Flip

Invert

Rotate

Scale

Scroll

Zoom

Image Document Retrieval and Storage

The Image Edit control also includes methods that enable you to add image document retrieval and storage functions to application programs.  These functions permit end users to retrieve, save, print, and delete image and annotation data.

Linking Other Imaging Controls to the Image Edit Control

The Image Edit control is the main Imaging control.  The Image Annotation Tool Button and Image Scan controls link to the 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.

If your program has only one Image Annotation Tool Button or Image Scan control and one Image Edit control, VB 5.0 sets these properties automatically.


Compiling and Distributing Your Image-Enabled Application

You need to make sure that you compile your image-enabled application with the appropriate version of Imaging for Windows.

You also need to make sure that your end users acquire and set up the appropriate version of Imaging for Windows prior to installing your software.

The version of Imaging for Windows you need when compiling your application [image] and the version your end users need to install [image] largely depends on the features you have included in your software.

You Included Imaging for Windows Professional Edition Features

If you used a control, property, method, event, or parameter provided exclusively by a particular version of Imaging for Windows Professional Edition (as identified in this on-line document), you must compile your application with that version of Imaging for Windows Professional Edition.

In addition, you must make sure that your end users purchase and set up that version of Imaging for Windows Professional Edition before using your software.

Your users can obtain Imaging for Windows Professional Edition from the Eastman Software Web site, at:

http://www.eastmansoftware.com/

You Did Not Include Imaging for Windows Professional Edition Features

If you did not use a control, property, method, event, or parameter provided exclusively by Imaging for Windows Professional Edition [image] and you want your application to be used by Imaging for Windows 95, 98, or NT users [image] you must compile your application with the appropriate version of Imaging for Windows (95, 98, or NT).

The Imaging for Windows 95, 98, and NT controls are free; as such, there are no royalties or licensing fees required.  Your end users must simply set up the appropriate version of Imaging for Windows as a prerequisite to using your program (if they haven't already).

Notes

Do not distribute the Imaging OCX files with your application, because doing so will not install Imaging for Windows correctly.  Instead, have your users set up the entire Imaging for Windows application to ensure that all of the required software is installed and registered properly.

This document assumes that users of Imaging for Windows 95 are using the OSR2 release, available free of charge from the Eastman Software Web site, at:

 http://www.eastmansoftware.com/

Imaging for Windows NT 4.0 ships as a component of Windows NT Workstation 4.0.

Imaging for Windows 98 ships as a component of Windows 98.


Important Notice Concerning the Use of LZW Compression

All versions of Imaging for Windows Professional Edition utilize LZW, a compression/decompression technology that is covered by U.S. Patent 4,558,302 (plus its foreign counterparts, issued or pending).  All patents are held by Unisys Corporation.

Eastman Software, Inc.'s grant of license from Unisys does not permit you to use LZW compression or decompression capabilities from any version of Imaging for Windows for development purposes, or to use or derive the LZW capabilities from an Eastman Software third-party application or other derivative software.

Contact Unisys for licensing information at:

Unisys Corporation
Welch Licensing Dept.  MSC1SW19
Township Line and Union Meeting Roads
P.O. Box 500
Blue Bell, PA 19424-0001
Fax: (215) 986-3090
Web:www.unisys.com


Documentation Conventions (Imaging ActiveX controls)
Documentation Conventions

This on-line help system uses the following conventions.

Conventions	Description
Image, Display, PasteCompleted	Words in bold with initial capitalization indicate names of properties, methods, and events.
Object, arglist	In the syntax section, words in lowercase italics indicate placeholders for information you must provide.
[expressionlist]	In the syntax section, items appearing inside square brackets are optional.
{True | False}	In the syntax section, braces and a vertical bar indicate a mandatory choice between two or more items.
Dim x As IFontDisp	This font is used for code examples.
	This character indicates that a line of code was too long to fit on one line in the Example window. You should keep the code on one line in your program, or use the line continuation character provided by your programming environment.  Refer to the documentation that came with your programming environment for more information on the line continuation character and its proper placement in your code. Note that the [image] character does not necessarily indicate the proper place for a line continuation character in your code.


AnnotationGroupCount Property

See Also	Example-VB	Example-VC++
Returns the number of annotation groups that are on an image page.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


AnnotationGroupCount Example - VB
AnnotationGroupCount Example [image] VB

This example uses the AnnotationGroupCount property to determine the number of groups on an image.  Then it uses the GetAnnotationGroup method to get the group names.

Private Sub cmdListGroups_Click()

    Dim intNumGroups As Integer

    Dim strGroupName As String

    Dim intCount As Integer

    'find out how many groups are on the page

    intNumGroups = ImgEdit1.AnnotationGroupCount

    Load frmGroupList

    'Since index values of GetAnnotationGroup start with

    '0 have to loop one less than the number of groups

    For intCount = 0 To intNumGroups - 1

        strGroupName = ImgEdit1.GetAnnotationGroup(intCount)

        'write names of groups to a listbox

        frmGroupList.AnnoGroups.AddItem (strGroupName)

    Next intCount

    frmGroupList.Show

End Sub


AnnotationGroupCount Example - VC++
AnnotationGroupCount Example [image] VC++

This example uses the AnnotationGroupCount property to determine the number of groups on an image.  Then it uses the GetAnnotationGroup method to get the group names.

BOOL CFrmGroup::OnInitDialog()

{

    CDialog::OnInitDialog();

    // This routine uses AnnotationGroupCount to determine

    // the number of groups on an image and then gets the

    // group names using the GetAnnotationGroup method.

    int iNumGroups;

    CString szGroupName;

    int iCount;

    // find out how many groups are on the page

    iNumGroups = pParentDlg->ImgEdit1.GetAnnotationGroupCount();

    // Since index values of GetAnnotationGroup start with

    // 0 have to loop one less than the number of groups

    for (iCount = 0;iCount < iNumGroups ; iCount++)

    {

        szGroupName = pParentDlg->ImgEdit1.GetAnnotationGroup(iCount);

        // write names of groups to a listbox

        m_GroupList.AddString (szGroupName);

    }

    return TRUE;  // return TRUE unless you set the focus to a control

                  // EXCEPTION: OCX Property Pages should return FALSE

}


AnnotationOcrType Property

See Also	Example-VB	Example-VC++
Returns or sets the type of OCR zone to be drawn on an image page.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Annotation Tool Button control, Image Edit control

Syntax

object.AnnotationOcrType[=value]

Data Type

Integer (enumerated)

Constant	Setting	Description
wiOcrTypeText	0 (default)	OCR Text zone [image] Defines an area of an image containing text to be processed by the OCR engine.  When the OCR engine encounters a text zone, it converts the underlying image to text.  When drawn, an OCR Text zone is dark green in color.
wiOcrTypePicture	1	OCR Picture zone [image] Defines an area of an image containing one or more pictures that should not be processed by the OCR engine.  When the OCR engine encounters a picture zone, it does not convert the underlying image to text, it retains the image as a graphic instead.  When drawn, an OCR Picture zone is dark magenta in color.
Remarks

Applies to the OCR Zones annotation type only.

While users can draw OCR Zone annotations on any type of image, OCR processing functions only with zones drawn on read/write TIFF images.


AnnotationOCRType Example - VB
AnnotationOcrType Example [image] VB

This example lets the user draw OCR text regions on an image for zoned recognition.  The AnnotationType property is set to the OCR Zone annotation type, and the AnnotationOcrType property is set so a Text OCR zone can be drawn.

Private Sub cmdDrawOcrZone_Click()

    ImgEdit1.AnnotationType = wiOcrRegion

    ImgEdit1.AnnotationOcrType = wiOcrTypeText

End Sub


AnnotationOCRType Example - VC++
AnnotationOcrType Example [image] VC++

This example lets the user draw OCR text regions on an image for zoned recognition.  The AnnotationType property is set to the OCR Zone annotation type, and the AnnotationOcrType property is set so a Text OCR zone can be drawn.

void CImgEdit1Dlg::OnDrawOcrZone()

{

    // This would enable the user to draw OCR text regions

    // on an image for zone recognition.

    ImgEdit1.SetAnnotationType(13);    // wiOcrRegion

    ImgEdit1.SetAnnotationOcrType(0);  // wiOcrTypeText

}


AutoRefresh Property

See Also	Example-VB	Example-VC++
Returns or sets whether a displayed image is refreshed immediately after changes are made to properties that can affect its visual appearance.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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

ImagePalette

ImageResolutionX

ImageResolutionY

ScrollBars

ScrollPositionX

ScrollPositionY

Zoom


AutoRefresh Example - VB
AutoRefresh Example [image] VB

This example shows several ways to orient an image, and redisplay it automatically.

Private Sub cmdRotate_Click()

   'This method displays a dialog box which allows

   'user to specify rotation by degrees.  Repaints

   'the screen automatically.  Rotate all writes the

   'file to disk.

   ImgEdit1.Rotate True 'rotate all pages

   ImgEdit1.Rotate False 'rotate current page

   'Autorefresh must be set to true or must call

   'Refresh after these methods.

   ImgEdit1.AutoRefresh = True

   ImgEdit1.RotateLeft 'defaults to 90 degrees

   ImgEdit1.RotateRight 45 'optionally can specify degrees

   ImgEdit1.Flip '180 degrees

   'You must save the image to maintain orientation.

End Sub


AutoRefresh Example - VC++
AutoRefresh Example [image] VC++

This example shows several ways to orient an image, and redisplay it automatically.

void CImgEdit1Dlg::OnRotate()

{

    // An example of some of the different ways an image could

    // be oriented.

    // This method displays a dialog box which allows

    // user to specify rotation by degrees.  Repaints

    // the screen automatically.  Rotate all writes the

    // file to disk.

    ImgEdit1.Rotate(TRUE); // rotate all pages

    ImgEdit1.Rotate(FALSE); // rotate current page

    // Autorefresh must be set to true or must call

    // Refresh after these methods.

    ImgEdit1.SetAutoRefresh(TRUE);

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.RotateLeft(evt); // defaults to 90 degrees

    VARIANT vRotateAmt; V_VT(&vRotateAmt) = VT_I4; V_I4(&vRotateAmt) = 45;

    ImgEdit1.RotateRight(vRotateAmt); // optionally can specify degrees

    ImgEdit1.Flip(); // 180 degrees

    // You must save the image to maintain orientation.

}


BorderStyle Property

See Also	Example-VB
Returns or sets whether the control is displayed with a border.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


BorderStyle Example [image] VB

This example.

End Sub


CompressionInfo Property

See Also	Example-VB	Example-VC++
Returns compression option information for the image specified in the Image property, and the page specified in the Page property.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 [image] Include/expect End Of Line.  Each line is terminated with a standard end-of-line bit.	Not used for JPEG compression
2	Packed Lines [image] Byte-align new lines.	Not used for JPEG compression
4	Prefixed EOL [image] 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 [image] 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 [image] 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 [image] Invert black and white on expansion.  Indicates the setting of the Photometric Interpretation field of a TIFF file.	Not used for JPEG compression
64	Low Resolution/High Quality	Used for JPEG compression only
128	Low Resolution/Medium Quality	Used for JPEG compression only
256	Low Resolution/Low Quality	Used for JPEG compression only
512	Medium Resolution/High Quality	Used for JPEG compression only
1024	Medium Resolution/Medium Quality	Used for JPEG compression only
2048	Medium Resolution/Low Quality	Used for JPEG compression only
4096	High Resolution/High Quality	Used for JPEG compression only
8192	High Resolution/Medium Quality	Used for JPEG compression only
16384	High Resolution/Low Quality	Used for JPEG compression only
Remarks

Image files with compression types other than JPEG and LZW can have CompressionInfo values between 1 and 63, in any combination.  Image files with the LZW compression type can have a CompressionInfo value of 8.  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.


CompressionInfo Example - VB
CompressionInfo Example [image] VB

This example interprets the bitwise value returned by the CompressionInfo property.  It is limited to black-and-white compression types only.

Private Sub cmdCompInfo_Click()

    'This routine interprets the bitwise value returned in the

    'CompressionInfo property.  This example is limited to black

    'and white compression types only.

    Dim lngCompInfo As Long

    lngCompInfo = ImgEdit1.CompressionInfo

    'Load form which has check boxes for various compression

    'options and check the options which are applicable to the

    'file.

    Load frmCompInfo

    If lngCompInfo And 1 Then     'file has EOL's

      frmCompInfo.chkEOL.Value = 1

    Else

      frmCompInfo.chkEOL.Value = 0

    End If

    If lngCompInfo And 2 Then   'file has packed lines

      frmCompInfo.chkPackedLines.Value = 1

    Else

      frmCompInfo.chkPackedLines.Value = 0

    End If

    If lngCompInfo And 4 Then   'file has prefix EOL's

      frmCompInfo.chkPreEOL.Value = 1

    Else

      frmCompInfo.chkPreEOL.Value = 0

    End If

    If lngCompInfo And 8 Then   'Compressed bit order, Left-To-Right

      frmCompInfo.chkCompRBO.Value = 1

    Else

      frmCompInfo.chkCompRBO.Value = 0

    End If

    If lngCompInfo And 16 Then  'Expanded bit order, Left-To-Right

      frmCompInfo.chkExpRBO.Value = 1

    Else

      frmCompInfo.chkExpRBO.Value = 0

    End If

    If lngCompInfo And 32 Then

      frmCompInfo.chkNegate.Value = 1  'Black and white are inverted on expansion

    Else

      frmCompInfo.chkNegate.Value = 0

    End If

    frmCompInfo.Show

End Sub


CompressionInfo Example - VC++
CompressionInfo Example [image] VC++

This example interprets the bitwise value returned by the CompressionInfo property.  It is limited to black-and-white compression types only.

void CImgEdit2Dlg::OnCompressioninfo()

{

    CCompresionInfo CompInfo;

    long lCompInfo;

    lCompInfo = ImgEdit1.GetCompressionInfo();

    // file has EOL's

    if(lCompInfo & 1)

      CompInfo.m_EOL = TRUE;

    else

      CompInfo.m_EOL = FALSE;

    // file has packed lines

    if(lCompInfo & 2)

      CompInfo.m_PackedLines = TRUE;

    else

      CompInfo.m_PackedLines = FALSE;

    // file has prefix EOL's

    if(lCompInfo & 4)

      CompInfo.m_PrefixEOL = TRUE;

    else

      CompInfo.m_PrefixEOL = FALSE;

    // Compressed bit order, Left-To-Right

    if(lCompInfo & 8)

      CompInfo.m_RBO = TRUE;

    else

      CompInfo.m_RBO = FALSE;

    // Expanded bit order, Left-To-Right

    if(lCompInfo & 16)

      CompInfo.m_LTR = TRUE;

    else

      CompInfo.m_LTR = FALSE;

    // Black and white are inverted on expansion

    if(lCompInfo & 32)

      CompInfo.m_Negate = TRUE;

    else

      CompInfo.m_Negate = FALSE;

    CompInfo.DoModal();

}


CompressionType Property

See Also	Example-VB
Returns the compression type of the image specified in the Image property, and the page specified in the Page property.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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	Reserved
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.


CompressionType Example - VB
CompressionType Example [image] VB

This example uses the CompressionType property to determine the compression type of the image specified in the Image property.

Private Sub cmdCompType_Click()

    'Reads the CompressionType property to determine the

    'compression type of the image specified in the Image

    'property.

    Dim strImgCompType As String

    'Read the CompressionType and translate the value to a

    'corresponding string.

    Select Case ImgEdit1.CompressionType

      Case 0

        strImgCompType = "Unknown"

      Case 1

        strImgCompType = "No Compression"

      Case 2

        strImgCompType = "Group3(1D)"

      Case 3

        strImgCompType = "Group3(Modified Huffman)"

      Case 4

        strImgCompType = "PackBits"

      Case 5

        strImgCompType = "Group4(2D)"

      Case 6

        strImgCompType = "JPEG"

      Case 7

        strImgCompType = "RBA"

      Case 8

        strImgCompType = "Group3(2D)"

      Case 9

        strImgCompType = "LZW"

    End Select

    'Display the compression type on a form for

    'informational purposes, or to

    'allow modifications.

     frmInfo.lblImgInfo(0).Caption = strImgCompType

End Sub


ContinuePrinting Property

See Also	Example-VB
Sets whether to cancel or continue printing.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

object.ContinuePrinting[={True|False}]

Data Type

Boolean

Setting	Description
True (default)	Continue printing
False	Cancel printing
Remarks

Before you can use the ContinuePrinting property, the UseCheckContinuePrinting property must be set to True.

When you use the ContinuePrinting property, you must set it within the CheckContinuePrinting event.  This action is required because the ContinuePrinting property is initialized to True upon entry into the event.

The ContinuePrinting property indicates whether to cancel or continue printing when the CheckContinuePrinting event fires.  The CheckContinuePrinting event fires whenever a print operation requests whether it should cancel or continue printing (typically, whenever a page is printed).  The ContinuePrinting property provides the event with the desired response.

Available at run-time as write-only.


CountinuePrinting Example [image] VB

This example shows how to set the Annotation BackColor Property.

End Sub


ContinueWithoutUndo Property

See Also	Example-VB
Sets whether to cancel an undo operation, or continue it without the undo information.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

object.ContinueWithoutUndo[={True|False}]

Data Type

Boolean

Setting	Description
True (default)	Continue the undo operation without the undo information
False	Cancel the undo operation
Remarks

When you use the ContinueWithoutUndo property, you must set it within the ErrorSavingUndoInformation event.  This action is required because the ContinueWithoutUndo property is initialized to True upon entry into the event.

The ContinueWithoutUndo property indicates whether an undo operation should be canceled or continued without the undo information.  The ErrorSavingUndoInformation event fires whenever an operation cannot save the information required to undo it.  The ContinueWithoutUndo property provides the desired processing alternative.

Available at run-time as write-only.


ContinueWithoutUndo Example [image] VB

This example.

End Sub


DisplayICMEnabled Property

See Also	Example-VB
Sets whether Image Color Matching (ICM) support is enabled.  When enabled, Imaging uses color management profiles when displaying or printing an image so the output devices display the colors of the original image as accurately as possible.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

object.DisplayICMEnabled[={True|False}]

Data Type

Boolean

Setting	Description
True	ICM support is enabled
False (default)	ICM support is not enabled
Remarks

If Image Color Matching is enabled, but the input device, image file, or output device does not support ICM, Imaging performs no color matching.

The image file types that support ICM are BMP Versions 4 and 5, and TIFF Version 7.


DisplayICMEnabled Example [image] VB

This example sets the

End Sub


DisplayScaleAlgorithm Property

See Also	Example-VB	Example-VC++
Returns or sets the scaling algorithm used when displaying images.  It is particularly useful for implementing scale-to-gray functionality.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.DisplayScaleAlgorithm[=value]

Data Type

Integer (enumerated)

Property settings are expressed using the following values:

Constant	Setting	Description	Notes
wiScaleNormal	0 (default)	Normal	Normal decimation.  All page types remain unchanged.
WiScaleGray4	1	Gray4	4-bit gray-scale, 16 shades of gray.  All page types are scaled to gray.
WiScaleGray8	2	Gray8	8-bit gray-scale, 256 shades of gray.  All page types are scaled to gray.
WiScaleStamp	3	Stamp	Used for thumbnail representation of images
wiScaleOptimize	4	Optimize	Changes the display algorithm based on the page type of the displayed image: Black-and-white images [image] Are scaled to gray. Palettized 4- and 8-bit, RGB, and BGR images [image] Remain color images.
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.  Note that when scaling from normal decimation to another setting, the displayed image remains unchanged.

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.


DisplayScaleAlgorithm Example - VB
DisplayScaleAlgorithm Example [image] VB

This example shows some property settings you might want to make prior to displaying an image.

Private Sub ImgEdit1_Load(ByVal Zoom As Double)

    'Here are some examples of default settings you might

    'want to specify prior to displaying an image.

    'Repaint any changes immediately (ex. zoom or resolution

    'changes, etc.)

    ImgEdit1.AutoRefresh = True

    'ScrollBars already default to true, but this is

    'modifiable if desired

    ImgEdit1.ScrollBars = True

    'Scale black and white images to grayscale.  Keep color image

    'displayed as color images.

    ImgEdit1.DisplayScaleAlgorithm = wiScaleOptimize

    'Allow user to scroll image using keyboard shortcuts

    ImgEdit1.ScrollShortcutsEnabled = True

    'Display all OCR zones

    ImgEdit1.OcrZoneVisibility = wiOcrShowAllZones  '3

End Sub


DisplayScaleAlgorithm Example - VC++
DisplayScaleAlgorithm Example [image] VC++

This example shows some property settings you might want to make prior to displaying an image.

void CImgEdit1Dlg::OnLoadEditctrl1(double Zoom)

{

    // Here are some examples of default settings you might

    // want to specify prior to displaying an image.

    // Repaint any changes immediately (ex. zoom or resolution

    // changes, etc.)

    ImgEdit1.SetAutoRefresh(TRUE);

    // ScrollBars already default to true, but this is

    // modifiable if desired

    ImgEdit1.SetScrollBars(TRUE);

    // Scale black and white images to grayscale.  Keep color image

    // displayed as color images.

    ImgEdit1.SetDisplayScaleAlgorithm(4);   // wiScaleOptimize

    // Allow user to scroll image using keyboard shortcuts

    ImgEdit1.SetScrollShortcutsEnabled(TRUE);

    // Display all OCR zones

    ImgEdit1.SetOcrZoneVisibility(3);  // wiOcrShowAllZones  // 3

}


FileType Property

See Also	Example-VB
Returns the file type of the image file specified in the Image property, and the page specified in the Page property.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Note:  AWD is not available with Imaging for Windows NT 4.0.  GIF and WIFF are available with Imaging for Windows Professional Edition (V1.0, V1.1, V2.0, and V2.5), and Imaging for Windows 98.

Applies To

Image Edit control

Syntax

object.FileType

Data Type

Integer (enumerated)

Property settings are expressed using the following values:

Constant	Setting	Description
wiFileTypeTIFF	1	TIFF
wiFileTypeAWD	2	AWD
wiFileTypeBMP	3	BMP
wiFileTypePCX	4	PCX
wiFileTypeDCX	5	DCX
wiFileTypeJPG	6	JPG
wiFileTypeXIF	7	XIF
wiFileTypeGIF	8	GIF
wiFileTypeWIFF	9	WIFF
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.

A file with a .JFX extension is also a TIFF file type.

Available at run-time as read-only.


FileType Example - VB
FileType Example [image] VB

This example uses the FileType property to determine the file type of the image specified in the Image property.

Private Sub cmdFileType_Click()

    'Reads the FileType property to determine the FileType of

    'the image specified in the Image property

    Dim strImgFileType As String

    'Read the Filetype and translate the value to a

    'corresponding string.

    Select Case ImgEdit1.FileType

      Case 0

        strImgFileType = "Unknown"

      Case 1

        strImgFileType = "TIF"

      Case 2

        strImgFileType = "AWD"

      Case 3

        strImgFileType = "BMP"

      Case 4

        strImgFileType = "PCX"

      Case 5

        strImgFileType = "DCX"

      Case 6

        strImgFileType = "JPG"

      Case 7

        strImgFileType = "XIF"

      Case 8

        strImgFileType = "GIF"

      Case 9

        strImgFileType = "WIF"

    End Select

    'Display the file type on a form

    'for informational purposes.

    frmInfo.lblImgInfo(0).Caption = strImgFileType

End Sub


ForceTiffJpeg6 Property

See Also	Example-VB
Sets or returns whether the TIFF JPEG output is written following the TIFF 6.0 specification, or the TIFF 6.0 Technical Note #2 specification.

Available With

√	Imaging for Windows Professional V2.6
Applies To

Image Edit control

Syntax

object.ForceTiffJpeg6[={True|False}]

Data Type

Boolean

Setting	Description
True (default)	Creates TIFF JPEG output following the TIFF 6.0 specification
False	Creates TIFF JPEG output following the TIFF 6.0 Technical Note #2 specification


ForceTiffSingleStrip Property

See Also	Example-VB
Returns or sets whether TIFF image file pages are written with a single strip or multiple strips.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Image Edit control

Syntax

object.ForceTiffSingleStrip[={True|False}]

Data Type

Boolean

Setting	Description
True	The image page being created in a TIFF file is written with a single strip.
False	(default) The image page being created in a TIFF file is generated using multiple strips.
Remarks

TIFF image content is contained in adjacent rows of bitmapped data called strips. An image’s data can be divided into multiple strips or can reside entirely in a single strip. The strips created when this property is set to False will contain up to 32K of uncompressed image data per strip.

This property is provided for imaging applications that do not handle multiple-strip TIFF images. Because processing a large, single-strip can require a large amount of memory, it is recommended that you do not override the default setting (False) except when necessary.

Very small images that do not contain enough data for multiple strips will be written as a single strip, regardless of the setting of this property.

The behaviors of a number of methods in the Eastman Software controls are affected by the value of the ForceTiffSingleStrip property. These are described as follows.

Image Admin control

Append, Insert, and Replace methods [image] When ForceTiffSingleStrip is set to True, the appended, inserted, or replaced pages are written to disk as single-strip image pages. When ForceTiffSingleStrip is set to False, the appended, inserted, or replaced pages are written as multi-strip image pages. The other pages in the image file are not affected.

Image Edit control

RotateAll method (with the Option parameter set to True) [image] first rotates, and then saves the image document to disk. If ForceTiffSingleStrip is set to True, all the pages in the image file are written as a single strip. If ForceTiffSingleStrip is set to False, all the pages in the image file are written as multiple strips.

Rotate method (with the Option parameter set to True) [image] first rotates, and then saves the image page to disk. If ForceTiffSingleStrip is set to True, the image page is written as a single strip. If ForceTiffSingleStrip is set to False, the image page is written as multiple strips.

Save method [image] the modified image page is saved as single-strip when ForceTiffSingleStrip is set to True, and as multiple strips if it is set to False.

Note: An image is marked as modified by any operation that that sets the ImageModified property to True. This affects the Save, SaveAs, and SavePage methods.

SaveAs method [image] if ForceTiffSingleStrip is set to True before you call SaveAs, all the pages in the image document are written to the new document, on disk, as a single strip. If ForceTiffSingleStrip is set to False before you call SaveAs, all image pages are saved as multiple strips.

SavePage method [image] the specified image page is saved as single-strip when ForceTiffSingleStrip is set to True, and as multiple strips if it is set to False.

SaveAnnotations [image] stores an image’s annotations in a separate file. When this method is invoked with the KEEP_ANNOTATIONS flag set, only the annotation file is written to disk. Because the original image file is not written to disk, the value of the ForceTiffSingleStrip property is irrelevant.

However, if the REMOVE_ANNOTATIONS flag is set when invoking the SaveAnnotations method, the original image document is written to disk (provided it contains at least one annotation) along with the annotation file.

When the ForceTiffSingleStrip property is set to True, the image document is saved to disk as follows:

The currently displayed image page is not written, but if it contains an annotation, it is marked as modified so it can be saved later.

Other images in the document with annotations are written single-strip.

Pages without annotations are not written to disk.

If the ForceTiffSingleStrip property is set to False, the original image file is written as follows:

The currently displayed image page is not written, but if it contains an annotation, it is marked as modified so it can be saved later.

Other images in the document with annotations are written as multiple-strip images.

Pages without annotations are not written to disk.

If there are no annotations in the original image document, it is not saved, so the ForceTiffSingleStrip property is irrelevant.

Image Scan control

StartScan method [image] in order for ForceTiffSingleStrip to function as designed, the ScanTo property must be set to any value other than “DisplayOnly.” In this case, setting ForceTiffSingleStrip to True causes all the pages in the image file to be written as a single strip, and setting ForceTiffSingleStrip to False causes all the pages in the image file to be written as multiple strips.

This behavior applies to all the pages scanned after StartScan is invoked, whether the image is scanned to a newly created file or to an existing file (to rescan or overwrite, append or insert image pages).


Image Property

See Also	Example-VB	Example-VC++
Returns the fully-qualified name of an image document file or managed image document being displayed.

Sets the fully-qualified name of an image document file or managed image document to be displayed or otherwise operated on by the Image Edit control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.Image[=filename]

Data Type

String

Remarks

If a URL is specified, the image is initially downloaded as a temporary file.  The temporary file is deleted when a new image name is specified, or the Image Edit control goes out of scope.

1.x Documents

When you specify the path to 1.x documents, use 4 nodes, separated by slashes. Refer to the following example:

Image://server\volume:\cabinet\drawer\folder\document

If there is no drawer, the string should contain another slash to signify the missing node. Refer to the following example:

Image://server\volume:\\cabinet\folder\document

Note the two slashes before "cabinet", which means there is no drawer node.


Image Example - VB
Image Example [image] VB

This example shows how to set the Image property using a variety of path and file name formats.

Private Sub cmdSetImage_Click()

    'Windows filename

    ImgEdit1.Image = "c:\insurance\claims\claim234.tif"

    'Showing syntax for 1.x Server document

    'Note: prefix Image:// denotes service name for 1.x server

    ImgEdit1.Image = "Image://srvrname\volname:\CABNAME\DRAWERNAME\FOLDERNAME\YOUR DOC"

    'Showing syntax for 1.x Server filename with a volume name mapped.

    ImgEdit1.Image = "Image://srvrname/volname:/dirname/temp.tif"

    'Showing syntax for Enterprise Imaging document

    'Note: prefix Imagex:// denotes service name for Enterprise
    'Imaging server

    ImgEdit1.Image = "Imagex://docid1234"

    'URL syntax

    ImgEdit1.Image = "http://www.eastmansoftware.com/sbu/sampimg.tif"

    'UNC filename

    ImgEdit1.Image = "\\srvrname\shared3\images\bw\thisisa.tif"

End Sub


Image Example - VC++
Image Example [image] VC++

This example shows how to set the Image property using a variety of path and file name formats.

void CImgEdit1Dlg::OnImage()

{

    // Examples of syntax for the Image property

    // The single slashes in the name can be forward or back.

    // Windows filename

    ImgEdit1.SetImage("c:\\insurance\\claims\\claim234.tif");

    // Showing syntax for 1.x Server document

    // Note: prefix Image:// denotes service name for 1.x server

    ImgEdit1.SetImage("Image://srvrname\\volname:\\CABNAME\\DRAWERNAME\\

     FOLDERNAME\\YOUR DOC");

    // Showing syntax for 1.x Server filename with a volume name mapped.

    ImgEdit1.SetImage("Image://srvrname/volname:/dirname/temp.tif");

    // Showing syntax for Enterprise Imaging document

    // Note: prefix Imagex:// denotes service name for Enterprise
    // Imaging server

    ImgEdit1.SetImage("Imagex://docid1234");

    // URL syntax

    ImgEdit1.SetImage("http://www.eastmansoftware.com/sbu/sampimg.tif");

    // UNC filename

    ImgEdit1.SetImage("\\\\srvrname\\shared3\\images\\bw\\thisisa.tif");

}


ImageControl Property

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

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


ImageControl Example [image] VB

This exampleedit01.vbp.

End Sub


ImageDisplayed Property

See Also	Example-VB
Indicates whether an image is currently being displayed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


ImageDisplayed Example [image] VB

This example edit02.vbp.

End Sub


ImageHeight Property

See Also	Example-VB	Example-VC++
Returns the height in full-size coordinates of the image being displayed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 name of an image, the ImageHeight property generates an error.

Available at run-time as read-only.


ImageHeight Example - VB
ImageHeight Example [image] VB

This example displays an image and scales it so it fits into the window.  Then it displays the height, width, resolution, scaled height, and scaled width of the image to illustrate the difference between ImageHeight/Width and ImageScaleHeight/Width.

Private Sub cmdWidthHeight_Click()

    ImgEdit1.Image = "D:\image2\ocr.tif"

    ImgEdit1.FitTo BEST_FIT

    ImgEdit1.Display

    Load frmInfo

    'Display the dimensions of the image page.

    frmInfo.lblImgHeight.Caption = ImgEdit1.ImageHeight

    frmInfo.lblImgWidth.Caption = ImgEdit1.ImageWidth

   'Display the X and Y resolution of the image page.

    frmInfo.lblImgResX.Caption = ImgEdit1.ImageResolutionX

    frmInfo.lblImgResY.Caption = ImgEdit1.ImageResolutionY

    'Display Image Scale Height

    frmInfo.lblImgScaleHeight.Caption = ImgEdit1.ImageScaleHeight

    frmInfo.lblImgScaleWidth.Caption = ImgEdit1.ImageScaleWidth

    frmInfo.Show 1

End Sub


ImageHeight Example - VC++
ImageHeight Example [image] VC++

This example displays an image and scales it so it fits into the window.  Then it displays the height, width, resolution, scaled height, and scaled width of the image to illustrate the difference between ImageHeight/Width and ImageScaleHeight/Width.

void CImgEdit1Dlg::OnWidthHeight()

{

    // Displays an image that is fit to window and then displays

    // height, width, resolution, scaled height and scaled width.

    // This illustrates the difference between ImageHeight/Width

    // and ImageScaleHeight/Width.

    VARIANT evt; V_VT(&evt) = VT_ERROR;  // set to default

    ImgEdit1.FitTo(0,evt); //BEST_FIT

    ImgEdit1.Display();

    CFrmInfo frmInfo;

    // Display the dimensions of the image page.

    CString szWindowText;

    long lInfo;

    lInfo = ImgEdit1.GetImageHeight();

    frmInfo.lblImgHeight.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageWidth();

    frmInfo.lblImgWidth.Format("%i",lInfo);

    // Display the X and Y resolution of the image page.

    lInfo = ImgEdit1.GetImageResolutionX();

    frmInfo.lblImgResX.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageResolutionY();

    frmInfo.lblImgResY.Format("%i",lInfo);

    // Display Image Scale Height

    lInfo = ImgEdit1.GetImageScaleHeight();

    frmInfo.lblImgScaleHeight.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageScaleWidth();

    frmInfo.lblImgScaleWidth.Format("%i",lInfo);

    frmInfo.DoModal();

}


ImageModified Property

See Also	Example-VB	Example-VC++
Indicates whether an image has been modified.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 users to save the image file.

Available at run-time as read-only.

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

ImageResolutionX

ImageResolutionY

Invoking the following methods sets the ImageModified property to True:

AddAnnotationGroup

AutoCrop

AutoDeskew

BurnInAnnotations

ClipboardCut

ClipboardPaste

ConvertPageType

Crop

DeleteAnnotationGroup

DeleteImageData

DeleteSelectedAnnotations

Despeckle

Draw method

EditSelectedAnnotationText

Flip

HideAnnotationGroup

Invert

LoadAnnotations

ManualDeSkew

Redo

RemoveAllOCRMarks

Rotate

RotateAll

RotateLeft

RotateRight

SetSelectedAnnotationBackColor

SetSelectedAnnotationFillColor

SetSelectedAnnotationFillStyle

SetSelectedAnnotationFont

SetSelectedAnnotationFontColor

SetSelectedAnnotationLineColor

SetSelectedAnnotationLineStyle

SetSelectedAnnotationLineWidth

SetSelectedAnnotationOcrType

ShowAnnotationGroup

Undo

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

Invoking the following methods sets the ImageModified property to False (effectively, resetting the property):

Save

SaveAs

SavePage


ImageModified Example - VB
ImageModified Example [image] VB

This example uses the ImageModified property to see if changes were made to an existing image before permitting the user to open another.  If the value of the ImageModified property is True, the code prompts the user to save the image before opening the next one.

Private Sub ImgEdit1_Close()

    'This code could be used at the time a user attempts to open

    'a new file or clear a previously displayed image in order

    'to prompt for changes to be saved if the image has been modified.

    Dim intSaveImg As Integer

    If ImgEdit1.ImageModified = True Then

      intSaveImg = MsgBox("Do you want to save changes?", vbYesNoCancel,

       "Image has been modified")

      Select Case intSaveImg

        Case vbYes

          'Save the changes

          ImgEdit1.Save

          'Drop down to the Open file code

        Case vbNo

          'Don't save file, just drop down to the Open

          'file code

        Case vbCancel

          'User pressed cancel

          'Don't open a file, don't save changes

          Exit Sub

      End Select

    End If

    'Open a new file at this point

End Sub


ImageModified Example - VC++
ImageModified Example [image] VC++

This example uses the ImageModified property to see if changes were made to an existing image before permitting the user to open another.  If the value of the ImageModified property is True, the code prompts the user to save the image before opening the next one.

void CImgEdit1Dlg::OnCloseEditctrl1()

{

    // This code could be used at the time a user attempts to open

    // a new file or clear a previously displayed image in order

    // to prompt for changes to be saved if the image has been modified.

    int iSaveImg;

    if(ImgEdit1.GetImageModified())

    {

      iSaveImg = AfxMessageBox("Do you want to save changes?", MB_YESNOCANCEL);

      switch (iSaveImg)

      {

        case IDYES:

          // Save the changes

          VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default for save at zoom

          ImgEdit1.Save(evt);

          break;

          // Drop down to the Open file code

        case IDNO:

          // Don't save file, just drop down to the Open

          // file code

          break;

        case IDCANCEL:

          // User pressed cancel

          // Don't open a file, don't save changes

          return;

        }

    }

    // Open a new file at this point

}


ImagePalette Property

See Also	Example-VB
Returns or sets the palette to use when displaying an image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.ImagePalette[=value]

Data Type

Integer (enumerated)

Property settings are expressed using the following values:

Constant	Setting	Description	Notes
wiPaletteCustom	0 (default)	Custom	Selects a custom palette
wiPaletteCommon	1	Common	Selects the common palette
wiPaletteGray8	2	Gray8	Selects the 8-bit gray-scale, 256 shades-of-gray palette
wiPaletteRGB24	3	RGB24	Selects the 24-bit, millions-of-colors palette
wiPaletteBlackWhite	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.

When the Image Edit and Image Thumbnail controls are used together, the ImagePalette property must be set to the Common palette (wiPaletteCommon) when the PageType of the image being displayed in the Image Edit control is not RGB.

When the PageType of the image being displayed in the Image Edit control is RGB, the ImagePalette property must be set to the RGB24 palette (wiPaletteRGB24).


ImagePalette Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


ImageResolutionX Property

See Also	Example-VB	Example-VC++
Returns or sets the horizontal resolution of the image being displayed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.ImageResolutionX[=value]

Data Type

Long

Remarks

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

Changing the setting of the ImageResolutionX property sets the ImageModified property to True.

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 name of an image, the ImageResolutionX property generates an error.

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


ImageResolutionX Example - VB
ImageResolutionX Example [image] VB

This example displays an image and scales it so it fits into the window.  Then it displays the height, width, resolution, scaled height, and scaled width of the image to illustrate the difference between ImageHeight/Width and ImageScaleHeight/Width.

Private Sub cmdWidthHeight_Click()

    ImgEdit1.Image = "D:\image2\ocr.tif"

    ImgEdit1.FitTo BEST_FIT

    ImgEdit1.Display

    Load frmInfo

    'Display the dimensions of the image page.

    frmInfo.lblImgHeight.Caption = ImgEdit1.ImageHeight

    frmInfo.lblImgWidth.Caption = ImgEdit1.ImageWidth

   'Display the X and Y resolution of the image page.

    frmInfo.lblImgResX.Caption = ImgEdit1.ImageResolutionX

    frmInfo.lblImgResY.Caption = ImgEdit1.ImageResolutionY

    'Display Image Scale Height

    frmInfo.lblImgScaleHeight.Caption = ImgEdit1.ImageScaleHeight

    frmInfo.lblImgScaleWidth.Caption = ImgEdit1.ImageScaleWidth

    frmInfo.Show 1

End Sub


ImageResolutionX Example - VC++
ImageResolutionX Example [image] VC++

This example displays an image and scales it so it fits into the window.  Then it displays the height, width, resolution, scaled height, and scaled width of the image to illustrate the difference between ImageHeight/Width and ImageScaleHeight/Width.

void CImgEdit1Dlg::OnWidthHeight()

{

    // Displays an image that is fit to window and then displays

    // height, width, resolution, scaled height and scaled width.

    // This illustrates the difference between ImageHeight/Width

    // and ImageScaleHeight/Width.

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.FitTo(0,evt); //BEST_FIT

    ImgEdit1.Display();

    CFrmInfo frmInfo;

    // Display the dimensions of the image page.

    CString szWindowText;

    long lInfo;

    lInfo = ImgEdit1.GetImageHeight();

    frmInfo.lblImgHeight.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageWidth();

    frmInfo.lblImgWidth.Format("%i",lInfo);

    // Display the X and Y resolution of the image page.

    lInfo = ImgEdit1.GetImageResolutionX();

    frmInfo.lblImgResX.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageResolutionY();

    frmInfo.lblImgResY.Format("%i",lInfo);

    // Display Image Scale Height

    lInfo = ImgEdit1.GetImageScaleHeight();

    frmInfo.lblImgScaleHeight.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageScaleWidth();

    frmInfo.lblImgScaleWidth.Format("%i",lInfo);

    frmInfo.DoModal();

}


ImageResolutionY Property

See Also	Example-VB	Example-VC++
Returns or sets the vertical resolution of the image being displayed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.ImageResolutionY[=value]

Data Type

Long

Remarks

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

Changing the setting of the ImageResolutionY property sets the ImageModified property to True.

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 name of an image, the ImageResolutionY property generates an error.

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


ImageResolutionY Example - VB
ImageResolutionY Example [image] VB

This example displays an image and scales it so it fits into the window.  Then it displays the height, width, resolution, scaled height, and scaled width of the image to illustrate the difference between ImageHeight/Width and ImageScaleHeight/Width.

Private Sub cmdWidthHeight_Click()

    ImgEdit1.Image = "D:\image2\ocr.tif"

    ImgEdit1.FitTo BEST_FIT

    ImgEdit1.Display

    Load frmInfo

    'Display the dimensions of the image page.

    frmInfo.lblImgHeight.Caption = ImgEdit1.ImageHeight

    frmInfo.lblImgWidth.Caption = ImgEdit1.ImageWidth

   'Display the X and Y resolution of the image page.

    frmInfo.lblImgResX.Caption = ImgEdit1.ImageResolutionX

    frmInfo.lblImgResY.Caption = ImgEdit1.ImageResolutionY

    'Display Image Scale Height

    frmInfo.lblImgScaleHeight.Caption = ImgEdit1.ImageScaleHeight

    frmInfo.lblImgScaleWidth.Caption = ImgEdit1.ImageScaleWidth

    frmInfo.Show 1

End Sub


ImageResolutionY Example - VC++
ImageResolutionY Example [image] VC++

This example displays an image and scales it so it fits into the window.  Then it displays the height, width, resolution, scaled height, and scaled width of the image to illustrate the difference between ImageHeight/Width and ImageScaleHeight/Width.

void CImgEdit1Dlg::OnWidthHeight()

{

    // Displays an image that is fit to window and then displays

    // height, width, resolution, scaled height and scaled width.

    // This illustrates the difference between ImageHeight/Width

    // and ImageScaleHeight/Width.

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.FitTo(0,evt); //BEST_FIT

    ImgEdit1.Display();

    CFrmInfo frmInfo;

    // Display the dimensions of the image page.

    CString szWindowText;

    long lInfo;

    lInfo = ImgEdit1.GetImageHeight();

    frmInfo.lblImgHeight.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageWidth();

    frmInfo.lblImgWidth.Format("%i",lInfo);

    // Display the X and Y resolution of the image page.

    lInfo = ImgEdit1.GetImageResolutionX();

    frmInfo.lblImgResX.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageResolutionY();

    frmInfo.lblImgResY.Format("%i",lInfo);

    // Display Image Scale Height

    lInfo = ImgEdit1.GetImageScaleHeight();

    frmInfo.lblImgScaleHeight.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageScaleWidth();

    frmInfo.lblImgScaleWidth.Format("%i",lInfo);

    frmInfo.DoModal();

}


ImageScaleHeight Property

See Also	Example-VB	Example-VC++
Returns the height in pixels of the image as it is displayed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


ImageScaleHeight Example - VB
ImageScaleHeight Example [image] VB

This example displays an image and scales it so it fits into the window.  Then it displays the height, width, resolution, scaled height, and scaled width of the image to illustrate the difference between ImageHeight/Width and ImageScaleHeight/Width.

Private Sub cmdWidthHeight_Click()

    ImgEdit1.Image = "D:\image2\ocr.tif"

    ImgEdit1.FitTo BEST_FIT

    ImgEdit1.Display

    Load frmInfo

    'Display the dimensions of the image page.

    frmInfo.lblImgHeight.Caption = ImgEdit1.ImageHeight

    frmInfo.lblImgWidth.Caption = ImgEdit1.ImageWidth

   'Display the X and Y resolution of the image page.

    frmInfo.lblImgResX.Caption = ImgEdit1.ImageResolutionX

    frmInfo.lblImgResY.Caption = ImgEdit1.ImageResolutionY

    'Display Image Scale Height

    frmInfo.lblImgScaleHeight.Caption = ImgEdit1.ImageScaleHeight

    frmInfo.lblImgScaleWidth.Caption = ImgEdit1.ImageScaleWidth

    frmInfo.Show 1

End Sub


ImageScaleHeight Example - VC++
ImageScaleHeight Example [image] VC++

This example displays an image and scales it so it fits into the window.  Then it displays the height, width, resolution, scaled height, and scaled width of the image to illustrate the difference between ImageHeight/Width and ImageScaleHeight/Width.

void CImgEdit1Dlg::OnWidthHeight()

{

    // Displays an image that is fit to window and then displays

    // height, width, resolution, scaled height and scaled width.

    // This illustrates the difference between ImageHeight/Width

    // and ImageScaleHeight/Width.

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.FitTo(0,evt); //BEST_FIT

    ImgEdit1.Display();

    CFrmInfo frmInfo;

    // Display the dimensions of the image page.

    CString szWindowText;

    long lInfo;

    lInfo = ImgEdit1.GetImageHeight();

    frmInfo.lblImgHeight.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageWidth();

    frmInfo.lblImgWidth.Format("%i",lInfo);

   // Display the X and Y resolution of the image page.

    lInfo = ImgEdit1.GetImageResolutionX();

    frmInfo.lblImgResX.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageResolutionY();

    frmInfo.lblImgResY.Format("%i",lInfo);

    // Display Image Scale Height

    lInfo = ImgEdit1.GetImageScaleHeight();

    frmInfo.lblImgScaleHeight.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageScaleWidth();

    frmInfo.lblImgScaleWidth.Format("%i",lInfo);

    frmInfo.DoModal();

}


ImageScaleWidth Property

See Also	Example-VB	Example-VC++
Returns the width in pixels of the image as it is displayed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


ImageScaleWidth Example - VB
ImageScaleWidth Example [image] VB

This example displays an image and scales it so it fits into the window.  Then it displays the height, width, resolution, scaled height, and scaled width of the image to illustrate the difference between ImageHeight/Width and ImageScaleHeight/Width.

Private Sub cmdWidthHeight_Click()

    ImgEdit1.Image = "D:\image2\ocr.tif"

    ImgEdit1.FitTo BEST_FIT

    ImgEdit1.Display

    Load frmInfo

    'Display the dimensions of the image page.

    frmInfo.lblImgHeight.Caption = ImgEdit1.ImageHeight

    frmInfo.lblImgWidth.Caption = ImgEdit1.ImageWidth

   'Display the X and Y resolution of the image page.

    frmInfo.lblImgResX.Caption = ImgEdit1.ImageResolutionX

    frmInfo.lblImgResY.Caption = ImgEdit1.ImageResolutionY

    'Display Image Scale Height

    frmInfo.lblImgScaleHeight.Caption = ImgEdit1.ImageScaleHeight

    frmInfo.lblImgScaleWidth.Caption = ImgEdit1.ImageScaleWidth

    frmInfo.Show 1

End Sub


ImageScaleWidth Example - VC++
ImageScaleWidth Example [image] VC++

This example displays an image and scales it so it fits into the window.  Then it displays the height, width, resolution, scaled height, and scaled width of the image to illustrate the difference between ImageHeight/Width and ImageScaleHeight/Width.

void CImgEdit1Dlg::OnWidthHeight()

{

    // Displays an image that is fit to window and then displays

    // height, width, resolution, scaled height and scaled width.

    // This illustrates the difference between ImageHeight/Width

    // and ImageScaleHeight/Width.

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.FitTo(0,evt); //BEST_FIT

    ImgEdit1.Display();

    CFrmInfo frmInfo;

    // Display the dimensions of the image page.

    CString szWindowText;

    long lInfo;

    lInfo = ImgEdit1.GetImageHeight();

    frmInfo.lblImgHeight.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageWidth();

    frmInfo.lblImgWidth.Format("%i",lInfo);

    // Display the X and Y resolution of the image page.

    lInfo = ImgEdit1.GetImageResolutionX();

    frmInfo.lblImgResX.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageResolutionY();

    frmInfo.lblImgResY.Format("%i",lInfo);

    // Display Image Scale Height

    lInfo = ImgEdit1.GetImageScaleHeight();

    frmInfo.lblImgScaleHeight.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageScaleWidth();

    frmInfo.lblImgScaleWidth.Format("%i",lInfo);

    frmInfo.DoModal();

}


ImageWidth Property

See Also	Example-VB	Example-VC++
Returns the width in full-size coordinates of the image being displayed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 name of an image, the ImageWidth property generates an error.

Available at run-time as read-only.


ImageWidth Example - VB
ImageWidth Example [image] VB

This example displays an image and scales it so it fits into the window.  Then it displays the height, width, resolution, scaled height, and scaled width of the image to illustrate the difference between ImageHeight/Width and ImageScaleHeight/Width.

Private Sub cmdWidthHeight_Click()

    ImgEdit1.Image = "D:\image2\ocr.tif"

    ImgEdit1.FitTo BEST_FIT

    ImgEdit1.Display

    Load frmInfo

    'Display the dimensions of the image page.

    frmInfo.lblImgHeight.Caption = ImgEdit1.ImageHeight

    frmInfo.lblImgWidth.Caption = ImgEdit1.ImageWidth

   'Display the X and Y resolution of the image page.

    frmInfo.lblImgResX.Caption = ImgEdit1.ImageResolutionX

    frmInfo.lblImgResY.Caption = ImgEdit1.ImageResolutionY

    'Display Image Scale Height

    frmInfo.lblImgScaleHeight.Caption = ImgEdit1.ImageScaleHeight

    frmInfo.lblImgScaleWidth.Caption = ImgEdit1.ImageScaleWidth

    frmInfo.Show 1

End Sub


ImageWidth Example - VC++
ImageWidth Example [image] VC++

This example displays an image and scales it so it fits into the window.  Then it displays the height, width, resolution, scaled height, and scaled width of the image to illustrate the difference between ImageHeight/Width and ImageScaleHeight/Width.

void CImgEdit1Dlg::OnWidthHeight()

{

    // Displays an image that is fit to window and then displays

    // height, width, resolution, scaled height and scaled width.

    // This illustrates the difference between ImageHeight/Width

    // and ImageScaleHeight/Width.

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.FitTo(0,evt); //BEST_FIT

    ImgEdit1.Display();

    CFrmInfo frmInfo;

    // Display the dimensions of the image page.

    CString szWindowText;

    long lInfo;

    lInfo = ImgEdit1.GetImageHeight();

    frmInfo.lblImgHeight.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageWidth();

    frmInfo.lblImgWidth.Format("%i",lInfo);

    // Display the X and Y resolution of the image page.

    lInfo = ImgEdit1.GetImageResolutionX();

    frmInfo.lblImgResX.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageResolutionY();

    frmInfo.lblImgResY.Format("%i",lInfo);

    // Display Image Scale Height

    lInfo = ImgEdit1.GetImageScaleHeight();

    frmInfo.lblImgScaleHeight.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageScaleWidth();

    frmInfo.lblImgScaleWidth.Format("%i",lInfo);

    frmInfo.DoModal();

}


IsIBK Property

See Also	Example-VB
Queries the Image Edit control to see if a bookmark file is displayed.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Edit control

Syntax

object.IsIBK[={True|False}]

Data Type

Boolean

Setting	Description
True (default)	The image displayed is a bookmark file
False	The image displayed is not a bookmark file


MagnifierZoom Property

See Also	Example-VB	Example-VC++
Returns or sets the zoom factor used by the magnifier window.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Edit control

Syntax

object.MagnifierZoom[=value]

Data Type

Integer

Property settings are expressed using the following values:

Constant	Setting	Description
wiLockMagnifier	-1	Locks the displayed image in the magnifier window at the current Zoom factor until the MagnifierZoom property is set to 0, 1, or 2
wi2Xmagnifier	0 (default)	2 times the current Zoom factor
wi4Xmagnifier	1	4 times the current Zoom factor
wi8Xmagnifier	2	8 times the current Zoom factor
Remarks

Magnification is limited to 6500%.


MagnifierZoom Example - VB
MagnifierZoom Example [image] VB

This example scrolls the image to a specified location, sets the Magnifier zoom factor, and then displays the Magnifier window.

Private Sub cmdMagnifier_Click()

    'Scroll the image to a specific horizontal/vertical pixel

    'location.

    ImgEdit1.ScrollPositionX = 800

    ImgEdit1.ScrollPositionY = 1000

    'Magnifier window will zoom underlying image data to 4 times

    'its size.

    ImgEdit1.MagnifierZoom = wi4XMagnifier  '1

    ImgEdit1.ShowMagnifier True

End Sub


MagnifierZoom Example - VC++
MagnifierZoom Example [image] VC++

This example scrolls the image to a specified location, sets the Magnifier zoom factor, and then displays the Magnifier window.

void CImgEdit1Dlg::OnMagnifier()

{

    // This example would scroll the image to a specific location and

    // then display a magnifier window.

    // Scroll the image to a specific horizontal/vertical pixel

    // location.

    ImgEdit1.SetScrollPositionX(800);

    ImgEdit1.SetScrollPositionY(1000);

    // Magnifier window will zoom underlying image data to 4 times

    // its size.

    ImgEdit1.SetMagnifierZoom(1); // wi4XMagnifier  // 1

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.ShowMagnifier(TRUE,evt,evt,evt,evt);

}


MouseIcon Property

See Also	Example-VB	Example-VC++
Returns or sets the mouse icon to be displayed when the mouse pointer is moved over an Image Edit control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.MouseIcon=LoadPicture(pathname)

Data Type

String

The pathname is a string expression specifying the path and file name 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.


MouseIcon Example - VB
MouseIcon Example [image] VB

This example sets a custom mouse pointer. The pointer will change when it is placed over the ImageEdit control.

Private Sub cmdMousePointer_Click()

    Dim strMIcon As String

    strMIcon = "C:\Program Files\DevStudio\VB\samples\PGuide\Optimize\Litening.ico"

    ImgEdit1.MouseIcon = LoadPicture(strMIcon)

    ImgEdit1.MousePointer = wiMPCustom '99

End Sub


MouseIcon Example - VC++
MouseIcon Example [image] VC++

This example sets a custom mouse pointer. The pointer will change when it is placed over the ImageEdit control.

void CImgEdit1Dlg::OnMouseIcon()

{

    // Sets a custom mouse pointer -- pointer will change when

    // placed over the ImgEdit control

    //Sets the specific picture icon

    CPictureHolder pic1;

    //Create the icon

    pic1.CreateFromIcon(IDR_MAINFRAME);

    CPicture cpPicU(pic1.GetPictureDispatch());

    //Specifies the custom mouse pointer to be used

    //when the mouse moves over the control

    //The custom MousePointer must be set.

    ImgEdit1.SetMouseIcon(cpPicU);

    ImgEdit1.SetMousePointer(99);  // wiMPCustom // 99

}


MousePointer Property

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

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Note:  The Hyperlink and OCR Zone MousePointer icons are available with Imaging for Windows Professional Edition (V1.0, V1.1, V2.0, and V2.5) only.

Applies To

Image Edit control

Syntax

object.MousePointer[=value]

Data Type

Integer (enumerated)

Constant	Setting	Description
wiMPDefault	0 (Default)	As determined by the value of the AnnotationType property
wiMPArrow	1	Arrow
wiMPCross	2	Cross (cross-hair pointer)
wiMPIBeam	3	I-Beam
wiMPIcon	4	Arrow
wiMPSize	5	Size (four-pointed arrow pointing North, South, East, and West)
wiMPSizeNESW	6	Size NE SW (double arrow pointing NorthEast and SouthWest)
wiMPSizeNS	7	Size N S (double arrow pointing North and South)
wiMPSizeNWSE	8	Size NW SE (double arrow pointing NorthWest and SouthEast)
wiMPSizeWE	9	Size W E (double arrow pointing West and East)
wiMPUpArrow	10	Up Arrow
wiMPHourGlass	11	Hourglass (wait)
wiMPNoDrop	12	No Drop
wiMPArrowHourglass	13	Arrow and Hourglass
wiMPArrowQuestion	14	Arrow and Question mark
wiMPSizeAll	15	Size All
wiMPFreehandLine	16	Freehand Line
wiMPHollowRect	17	Hollow Rectangle
wiMPFilledRect	18	Filled Rectangle
wiMPRubberStamp	19	Text Stamp
wiMPText	20	Text
wiMPTextFromFile	21	Text From File
wiMPTextAttachment	22	Attach-a-Note
wiMPHand	23	Hand
wiMPSelect	24	Image Selection
wiMPHyperlink	25	Hyperlink
wiMPOcrRegion	26	OCR Zone
wiMPInitials	27	Initials
wiMPCustom	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 users should wait for a process or operation to finish.


MousePointer Example - VB
MousePointer Example [image] VB

This example sets a custom mouse pointer. The pointer will change when it is placed over the ImageEdit control.

Private Sub cmdMousePointer_Click()

    Dim strMIcon As String

    strMIcon = "C:\Program Files\DevStudio\VB\samples\PGuide\Optimize\Litening.ico"

    ImgEdit1.MouseIcon = LoadPicture(strMIcon)

    ImgEdit1.MousePointer = wiMPCustom '99

End Sub


MousePointer Example - VC++
MousePointer Example [image] VC++

This example sets a custom mouse pointer. The pointer will change when it is placed over the ImageEdit control.

void CImgEdit1Dlg::OnMouseIcon()

{

    // Sets a custom mouse pointer -- pointer will change when

    // placed over the ImgEdit control

    //Sets the specific picture icon

    CPictureHolder pic1;

    //Create the icon

    pic1.CreateFromIcon(IDR_MAINFRAME);

    CPicture cpPicU(pic1.GetPictureDispatch());

    //Specifies the custom mouse pointer to be used

    //when the mouse moves over the control

    //The custom MousePointer must be set.

    ImgEdit1.SetMouseIcon(cpPicU);

    ImgEdit1.SetMousePointer(99);  // wiMPCustom // 99

}


OcrZoneVisibility Property

See Also	Example-VB	Example-VC++
Returns or sets the OCR zones that are shown on the image page.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

object.OcrZoneVisibility[=value]

Data Type

Integer (enumerated)

Constant	Setting	Description
wiOcrHideZones	0 (default)	No OCR zones are shown
wiOcrShowTextZones	1	All OCR Text zones are shown
wiOcrShowPictureZones	2	All OCR Picture zones are shown
wiOcrShowAllZones	3	All OCR Text and Picture zones are shown
Remarks

This property does not affect the visibility of other annotations on the image page.  To hide and show other annotation types, use the HideAnnotationGroup and ShowAnnotationGroup methods.


OCRZoneVisibility Example - VB
OCRZoneVisibility Example [image] VB

This example shows some property settings you might want to make prior to displaying an image.

Private Sub ImgEdit1_Load(ByVal Zoom As Double)

    'Here are some examples of default settings you might

    'want to specify prior to displaying an image.

    'Repaint any changes immediately (ex. zoom or resolution

    'changes, etc.)

    ImgEdit1.AutoRefresh = True

    'ScrollBars already default to true, but this is

    'modifiable if desired

    ImgEdit1.ScrollBars = True

    'Scale black and white images to grayscale.  Keep color image

    'displayed as color images.

    ImgEdit1.DisplayScaleAlgorithm = wiScaleOptimize

    'Allow user to scroll image using keyboard shortcuts

    ImgEdit1.ScrollShortcutsEnabled = True

    'Display all OCR zones

    ImgEdit1.OcrZoneVisibility = wiOcrShowAllZones  '3

End Sub


OCRZoneVisibility Example - VC++
OCRZoneVisibility Example [image] VC++

This example shows some property settings you might want to make prior to displaying an image.

void CImgEdit1Dlg::OnLoadEditctrl1(double Zoom)

{

    // Here are some examples of default settings you might

    // want to specify prior to displaying an image.

    // Repaint any changes immediately (ex. zoom or resolution

    // changes, etc.)

    ImgEdit1.SetAutoRefresh(TRUE);

    // ScrollBars already default to true, but this is

    // modifiable if desired

    ImgEdit1.SetScrollBars(TRUE);

    // Scale black and white images to grayscale.  Keep color image

    // displayed as color images.

    ImgEdit1.SetDisplayScaleAlgorithm(4);   // wiScaleOptimize

    // Allow user to scroll image using keyboard shortcuts

    ImgEdit1.SetScrollShortcutsEnabled(TRUE);

    // Display all OCR zones

    ImgEdit1.SetOcrZoneVisibility(3);  // wiOcrShowAllZones  // 3

}


Page Property

See Also	Example-VB	Example-VC++
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.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.Page[=value]

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.


Page Example - VB
Page Example [image] VB

This example displays the next page in a multipage file, and determines whether there is another page to display.

Private Sub cmdNextPage_Click()

    Dim lngNewPg As Long

    lngNewPg = ImgEdit1.Page + 1

    'Determine if there is a next page to be displayed

    'by finding out the number of pages in the file

    If lngNewPg > ImgEdit1.PageCount Then

        MsgBox "Page Number is out of range"

        'Don't set page property

        Exit Sub

    End If

    ImgEdit1.Page = lngNewPg

    ImgEdit1.Display

End Sub


Page Example - VC++
Page Example [image] VC++

This example displays the next page in a multipage file, and determines whether there is another page to display.

void CImgEdit1Dlg::OnNextPage()

{

    // This would display next page in a multipage file

    long lngNewPg;

    lngNewPg = ImgEdit1.GetPage() + 1;

    // Determine if there is a next page to be displayed

    // by finding out the number of pages in the file

    if(lngNewPg > ImgEdit1.GetPageCount())

    {

        AfxMessageBox("Page Number is out of range");

        // Don't set page property

        return;

    }

    ImgEdit1.SetPage(lngNewPg);

    ImgEdit1.Display();

}


PageCount Property

See Also	Example-VB	Example-VC++
Returns the total number of pages in the image file that is currently being displayed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 name of an image, the PageCount property generates an error.

Available at run-time as read-only.


PageCount Example - VB
PageCount Example [image] VB

This example displays the next page in a multipage file, and determines whether there is another page to display.

Private Sub cmdNextPage_Click()

    Dim lngNewPg As Long

    lngNewPg = ImgEdit1.Page + 1

    'Determine if there is a next page to be displayed

    'by finding out the number of pages in the file

    If lngNewPg > ImgEdit1.PageCount Then

        MsgBox "Page Number is out of range"

        'Don't set page property

        Exit Sub

    End If

    ImgEdit1.Page = lngNewPg

    ImgEdit1.Display

End Sub


PageCount Example - VC++
PageCount Example [image] VC++

This example displays the next page in a multipage file, and determines whether there is another page to display.

void CImgEdit1Dlg::OnNextPage()

{

    // This would display next page in a multipage file

    long lngNewPg;

    lngNewPg = ImgEdit1.GetPage() + 1;

    // Determine if there is a next page to be displayed

    // by finding out the number of pages in the file

    if(lngNewPg > ImgEdit1.GetPageCount())

    {

        AfxMessageBox("Page Number is out of range");

        // Don't set page property

        return;

    }

    ImgEdit1.SetPage(lngNewPg);

    ImgEdit1.Display();

}


PageType Property

See Also	Example-VB
Returns the page type of the image specified in the Image property and the page specified in the Page property.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.PageType

Data Type

Integer (enumerated)

Property settings are expressed using the following values:

Constant	Setting	Description
wiPageTypeBW	1	Black-and-white
wiPageTypeGray4	2	Gray scale, 4-bit
wiPageTypeGray8	3	Gray scale, 8-bit
wiPageTypePal4	4	Palettized, 4-bit
wiPageTypePal8	5	Palettized, 8-bit
wiPageTypeRGB24	6	RGB, 24-bit
wiPageTypeBGR24	7	BGR, 24-bit
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 page type of the displayed image.  If the image page specified in the Image and Page properties is not being displayed, the value is the page type of the page specified in the Image and Page properties.

Available at run-time as read-only.


PageType Example - VB
PageType Example [image] VB

This example uses the PageType property to determine the page type of the image specified in the Image property.

Private Sub cmdPageType_Click()

    'Reads the PageType property to determine the page type of

    'the image specified in the Image property

    Dim strImgPageType As String

    'Read the PageType property and translate the value to a

    'corresponding string.

    Select Case ImgEdit1.PageType

      Case 1

        strImgPageType = "Black and White"

      Case 2

        strImgPageType = "4 bit grayscale"

      Case 3

        strImgPageType = "8 bit grayscale"

      Case 4

        strImgPageType = "4 bit palettized"

      Case 5

        strImgPageType = "8 bit palettized"

      Case 6

        strImgPageType = "24 bit RGB"

      Case 7

        strImgPageType = "24 bit BGR"

    End Select

    'Display the page type on a form for

    'informational purposes, or to allow it to be modified.

    frmInfo.lblImgInfo(1).Caption = strImgPageType

End Sub


ReadyState Property

See Also	Example-VB
Returns a value that indicates the readiness of the control to respond to methods.  The ReadyStateChange event fires when the readiness state of the control changes.

The ReadyState property and ReadyStateChange event are intended for use with HTML scripts only.  Use them to manage the asynchronous downloading of images from the World Wide Web.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
Applies To

Image Annotation Tool Button control, Image Edit control

Syntax

object.ReadyState[=value]

Data Type

Long

Property settings are expressed using the following values:

Setting	Description
0 (default)	The control is initializing and retrieving properties; cannot perform methods
2	The control has initialized and downloading has started; cannot perform methods
4	The control is ready for all requests; can perform methods
Remarks

This property is useful when the Image property is set to a URL pathname.

The control performs methods only when its ReadyState property is 4.

Available at run-time as read-only.


ReadyState Example - VB
ReadyState Example [image] VB

This example determines whether an image download operation from the Web is complete prior to displaying or manipulating the image data.


ReadyState Example - VC++
ReadyState Example [image] VC++

This example determines whether an image download operation from the Web is complete prior to displaying or manipulating the image data.


ScrollBars Property

See Also	Example-VB	Example-VC++
Returns or sets whether a displayed image contains horizontal and/or vertical scroll bars.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 users 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.


ScrollBars Example - VB
ScrollBars Example [image] VB

This example shows some property settings you might want to make prior to displaying an image.

Private Sub ImgEdit1_Load(ByVal Zoom As Double)

    'Here are some examples of default settings you might

    'want to specify prior to displaying an image.

    'Repaint any changes immediately (ex. zoom or resolution

    'changes, etc.)

    ImgEdit1.AutoRefresh = True

    'ScrollBars already default to true, but this is

    'modifiable if desired

    ImgEdit1.ScrollBars = True

    'Scale black and white images to grayscale.  Keep color image

    'displayed as color images.

    ImgEdit1.DisplayScaleAlgorithm = wiScaleOptimize

    'Allow user to scroll image using keyboard shortcuts

    ImgEdit1.ScrollShortcutsEnabled = True

    'Display all OCR zones

    ImgEdit1.OcrZoneVisibility = wiOcrShowAllZones  '3

End Sub


ScrollBars Example - VC++
ScrollBars Example [image] VC++

This example shows some property settings you might want to make prior to displaying an image.

void CImgEdit1Dlg::OnLoadEditctrl1(double Zoom)

{

    // Here are some examples of default settings you might

    // want to specify prior to displaying an image.

    // Repaint any changes immediately (ex. zoom or resolution

    // changes, etc.)

    ImgEdit1.SetAutoRefresh(TRUE);

    // ScrollBars already default to true, but this is

    // modifiable if desired

    ImgEdit1.SetScrollBars(TRUE);

    // Scale black and white images to grayscale.  Keep color image

    // displayed as color images.

    ImgEdit1.SetDisplayScaleAlgorithm(4);   // wiScaleOptimize

    // Allow user to scroll image using keyboard shortcuts

    ImgEdit1.SetScrollShortcutsEnabled(TRUE);

    // Display all OCR zones

    ImgEdit1.SetOcrZoneVisibility(3);  // wiOcrShowAllZones  // 3

}


ScrollPositionX Property

See Also	Example-VB	Example-VC++
Returns or sets the horizontal scroll position in pixels.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.ScrollPositionX[=value]

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.


ScrollPositionX Example - VB
ScrollPositionX Example [image] VB

This example scrolls the image to a specified location, sets the Magnifier zoom factor, and then displays the Magnifier window.

Private Sub cmdMagnifier_Click()

    ImgEdit1.ScrollPositionX = 800

    ImgEdit1.ScrollPositionY = 1000

    'Magnifier window will zoom underlying image data to 4 times

    'its size.

    ImgEdit1.MagnifierZoom = wi4XMagnifier  '1

    ImgEdit1.ShowMagnifier True

End Sub


ScrollPositionX Example - VC++
ScrollPositionX Example [image] VC++

This example scrolls the image to a specified location, sets the Magnifier zoom factor, and then displays the Magnifier window.

void CImgEdit1Dlg::OnMagnifier()

{

    // This example would scroll the image to a specific location and

    // then display a magnifier window.

    // Scroll the image to a specific horizontal/vertical pixel

    // location.

    ImgEdit1.SetScrollPositionX(800);

    ImgEdit1.SetScrollPositionY(1000);

    // Magnifier window will zoom underlying image data to 4 times

    // its size.

    ImgEdit1.SetMagnifierZoom(1); // wi4XMagnifier  // 1

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.ShowMagnifier(TRUE,evt,evt,evt,evt);

}


ScrollPositionY Property

See Also	Example-VB	Example-VC++
Returns or sets the vertical scroll position in pixels.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.ScrollPositionY[=value]

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.


ScrollPositionY Example - VB
ScrollPositionY Example [image] VB

This example scrolls the image to a specified location, sets the Magnifier zoom factor, and then displays the Magnifier window.

Private Sub cmdMagnifier_Click()

    ImgEdit1.ScrollPositionX = 800

    ImgEdit1.ScrollPositionY = 1000

    'Magnifier window will zoom underlying image data to 4 times

    'its size.

    ImgEdit1.MagnifierZoom = wi4XMagnifier  '1

    ImgEdit1.ShowMagnifier True

End Sub


ScrollPositionY Example - VC++
ScrollPositionY Example [image] VC++

This example scrolls the image to a specified location, sets the Magnifier zoom factor, and then displays the Magnifier window.

void CImgEdit1Dlg::OnMagnifier()

{

    // This example would scroll the image to a specific location and

    // then display a magnifier window.

    // Scroll the image to a specific horizontal/vertical pixel

    // location.

    ImgEdit1.SetScrollPositionX(800);

    ImgEdit1.SetScrollPositionY(1000);

    // Magnifier window will zoom underlying image data to 4 times

    // its size.

    ImgEdit1.SetMagnifierZoom(1); // wi4XMagnifier  // 1

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.ShowMagnifier(TRUE,evt,evt,evt,evt);

}


ScrollShortcutsEnabled Property

See Also	Example-VB	Example-VC++
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.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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, end users 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


ScrollShortcutsEnabled Example - VB
ScrollShortcutsEnabled Example [image] VB

This example shows some property settings you might want to make prior to displaying an image.

Private Sub ImgEdit1_Load(ByVal Zoom As Double)

    'Here are some examples of default settings you might

    'want to specify prior to displaying an image.

    'Repaint any changes immediately (ex. zoom or resolution

    'changes, etc.)

    ImgEdit1.AutoRefresh = True

    'ScrollBars already default to true, but this is

    'modifiable if desired

    ImgEdit1.ScrollBars = True

    'Scale black and white images to grayscale.  Keep color image

    'displayed as color images.

    ImgEdit1.DisplayScaleAlgorithm = wiScaleOptimize

    'Allow user to scroll image using keyboard shortcuts

    ImgEdit1.ScrollShortcutsEnabled = True

    'Display all OCR zones

    ImgEdit1.OcrZoneVisibility = wiOcrShowAllZones  '3

End Sub


ScrollShortcutsEnabled Example - VC++
ScrollShortcutsEnabled Example [image] VC++

This example shows some property settings you might want to make prior to displaying an image.

void CImgEdit1Dlg::OnLoadEditctrl1(double Zoom)

{

    // Here are some examples of default settings you might

    // want to specify prior to displaying an image.

    // Repaint any changes immediately (ex. zoom or resolution

    // changes, etc.)

    ImgEdit1.SetAutoRefresh(TRUE);

    // ScrollBars already default to true, but this is

    // modifiable if desired

    ImgEdit1.SetScrollBars(TRUE);

    // Scale black and white images to grayscale.  Keep color image

    // displayed as color images.

    ImgEdit1.SetDisplayScaleAlgorithm(4);   // wiScaleOptimize

    // Allow user to scroll image using keyboard shortcuts

    ImgEdit1.SetScrollShortcutsEnabled(TRUE);

    // Display all OCR zones

    ImgEdit1.SetOcrZoneVisibility(3);  // wiOcrShowAllZones  // 3

}


SelectionRectangle Property

See Also	Example-VB	Example-VC++
Returns or sets whether a selection box will be drawn when end users click the left mouse button and drag the mouse pointer over a displayed image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.SelectionRectangle[={True|False}]

Data Type

Boolean

Setting	Description
True (default)	Selection box drawing is enabled
False	Selection box drawing is not enabled
Remarks

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


SelectionRectangle Example - VB
SelectionRectangle Example [image] VB

This example draws a selection rectangle on an image and zooms in on the area bound by the rectangle.

Private Sub cmdZoomSelect_Click()

    'Enable rectangle drawing

    ImgEdit1.SelectionRectangle = True

    'Draw rectangle

    ImgEdit1.DrawSelectionRect 150, 200, 400, 400

    ImgEdit1.ZoomToSelection

End Sub


SelectionRectangle Example - VC++
SelectionRectangle Example [image] VC++

This example draws a selection rectangle on an image and zooms in on the area bound by the rectangle.

void CImgEdit1Dlg::OnZoomto()

{

    // This would draw a rectangle on an image and would

    // zoom in on the area bound by the rectangle

    // Enable rectangle drawing

    ImgEdit1.SetSelectionRectangle(TRUE);

    // Draw rectangle

    ImgEdit1.DrawSelectionRect( 150, 200, 400, 400);

    ImgEdit1.ZoomToSelection();

}


ScrollToBottom Property

See Also	Example-VB
Specifies whether the image will be displayed scrolled to top, or to the bottom of the page.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Edit control

Syntax

object.ScrollToBottom[={True|False}]

Data Type

Boolean

Setting	Description
True	Display the image, scrolled to the bottom
False (default)	Display the image, scrolled to the top
Remarks

After setting this property to True, reset it to False after the image is displayed. Otherwise, the next page displayed will be scrolled to the bottom.

This property is hidden at design time.


SingleSelectionMode Property

See Also	Example-VB
Determines if the user can simultaneously delete, cut, or copy both image and annotation data from the area inside the selection rectangle.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Edit control

Syntax

object.SingleSelectionMode[={True|False}]

Data Type

Boolean

Setting	Description
True	Image data and annotation marks can be copied or deleted simultaneously.
False (default)	Image data and annotation marks must be copied or deleted in separate operations.
Remarks

With this property set to True, you can select single or multiple annotation marks. Click on the desired annotations, or draw a selection rectangle around them and hold down the Ctrl key while you click the left mouse button. This will deselect the image data, leaving only the annotations selected.

Also, with the SingleSelectionMode property set to True, the following methods, when invoked, behave in the manner indicated:

ClipboardCopy [image] the image data and the annotations completely enclosed by the selection rectangle are copied to the Clipboard simultaneously.

ClipboardCut [image] the image data and the annotations completely enclosed by the selection rectangle are cut, and copied to the Clipboard simultaneously.

DeleteImageData [image] the image data and the annotations completely enclosed by the selection rectangle are deleted simultaneously.

With this property set to False, use the Select Annotation and Zone tool to select the desired annotations. To select a section of the image data to cut or copy, you must first set the SelectionRectangle property to True, and then draw a rectangle around the area.

This property works independently of the SelectionRectangle property. For example, if the SingleSelectionMode property is set to True, you can draw selection rectangles regardless of the setting of the SelectionRectangle property, and vice versa.

If the SingleSelectionMode property and the SelectionRectangle property are both set to True, you can simultaneously select image data and annotations.

The DeleteSelectedAnnotations methods deletes only selected annotations, not image data.


StatusCode Property

See Also	Example-VB
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.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, 2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit, Image Scan, Image Admin (Win 98, Pro V2.0, and V2.5 only), Image Annotation, and Image Thumbnail (Win 98, Pro V2.0, and V2.5 only) controls

Syntax

object.StatusCode

Data Type

Long

Remarks

The default value for this property is 0.

Available at run-time as read-only.


StatusCode Example [image] VB

This example annota05.vbp.

End Sub


UndoLevels Property

See Also	Example-VB	Example-VC++
Returns or sets the number of permissible undo levels.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

object.UndoLevels[=value]

Data Type

Long

Setting	Description
0 (default)	No levels of undo
1	1 level of undo
Remarks

The Undo method is limited to the number of undo levels specified in this property


UndoLevels Example - VB
UndoLevels Example [image] VB

This example illustrates how to enable Undo functionality in an application.

Private Sub Form_Load()

    'UndoLevels must be set at form load to allocate undo buffers

    ImgEdit1.UndoLevels = 1

End Sub

Private Sub cmdUndo_Click()

    'The Undo method will undo the last imaging operation

    'performed.

    ImgEdit1.Undo

End Sub


UndoLevels Example - VC++
UndoLevels Example [image] VC++

This example illustrates how to set Undo levels on initialization.

BOOL CImgEdit1Dlg::OnInitDialog()

{

    CDialog::OnInitDialog();

    blnIsRectangle = FALSE;

    // UndoLevels must be set at form load to allocate undo buffers

    ImgEdit1.SetUndoLevels(1);

    return TRUE;  // return TRUE  unless you set the focus to a control

}

void CImgEdit1Dlg::OnUndo()

{

    // The Undo method will undo the last imaging operation

    // performed.

    VARIANT evt; V_VT(&evt) = VT_ERROR;	// set to default

    ImgEdit1.Undo(evt);

}


UseCheckContinuePrinting Property

See Also	Example-VB
Returns or sets how the control handles a print cancellation/continuation request.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

object.UseCheckContinuePrinting[={True|False}]

Data Type

Boolean

Setting	Description
True	Print cancellation/continuation is handled through the CheckContinuePrinting event
False (default)	Standard print cancellation/continuation handling
Remarks

Setting this property to True enables you to use the ContinuePrinting property and the CheckContinuePrinting event to handle a print cancellation/continuation request.

The CheckContinuePrinting event fires whenever a print operation requests whether it should cancel or continue printing.  The ContinuePrinting property provides the event with the desired response.


UseCheckContinuePrinting Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


Zoom Property (Image Edit control)
Zoom Property

See Also	Example-VB	Example-VC++
Returns or sets the zoom factor for an image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 scanning to the Image Edit control, the Zoom property of the Image Scan control should be set to the same value as the Zoom property of the Image Edit control.

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


Zoom Example - VB
Zoom Example [image] VB

The following example reduces the current zoom factor by one half, and then repaints the image display.

Private Sub cmdZoom_Click()

    ImgEdit1.Zoom = ImgEdit1.Zoom / 2

    ImgEdit1.Refresh

End Sub


Zoom Example - VC++
Zoom Example [image] VC++

The following example reduces the current zoom factor by one half, and then repaints the image display.

void CImgEdit1Dlg::OnZoom()

{

    // This would reduce the current zoom factor by one

    // half and then repaint the image display.

    ImgEdit1.SetZoom(ImgEdit1.GetZoom() / 2);

    ImgEdit1.Refresh();

}


ZoomMode Property

See Also	Example-VB
Sets the scale factor to either inch-to-inch, or pixel-to-pixel when zooming an image.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Edit control

Syntax

object.ZoomMode[=value]

Data Type

Integer

Setting	Description
0 (default)	Pixel-to-Pixel
1	Inch-to-Inch
Remarks

When you specify Inch-to-Inch, the zoom factor is calculated using the dots-per-inch reported by the display driver. The relative size of the original image is maintained, regardless of the resolution of the image or of the display driver.

When you specify Pixel-to-Pixel, the zoom factor is calculated using the display resolution set for the computer. The dots in the image correspond 1-to-1 to the dots on the display, so the size of the image changes if the resolution on the computer is changed.

If you switch between Inch-to-Inch and Pixel-to-Pixel while an image is displayed, the visual appearance does not change even if the AutoRefresh property is set to True.


AboutBox Method

See Also	Example-VB
Displays an About dialog box that contains the version number of the control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

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

Syntax

object.AboutBox

Arguments

None

Return Value

None


AboutBox Example [image] VB

This exampleannota05.vbp.

End Sub


AddAnnotationGroup Method

See Also	Example-VB	Example-VC++
Adds a new annotation group to an image page.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.

Invoking the AddAnnotationGroup method sets the ImageModified property to True.


AddAnnotationGroup Example - VB
AddAnnotationGroup Example [image] VB

This example adds an annotation group, sets the annotation type, sets the background color of the annotation, and then draws the mark. (Annotation groups are not actually created until a mark is drawn in the group.)

Private Sub cmdAddGroup_Click()

    ImgEdit1.AddAnnotationGroup "Accounting Dept"

    ImgEdit1.AnnotationType = wiTextAttachment  '10

    ImgEdit1.AnnotationBackColor = vbYellow

    ImgEdit1.Draw 10, 10, 150, 100

    'The user must manually enter the text on the attachment

End Sub


AddAnnotationGroup Example - VC++
AddAnnotationGroup Example [image] VC++

This example adds an annotation group, sets the annotation type, sets the background color of the annotation, and then draws the mark. (Annotation groups are not actually created until a mark is drawn in the group.)

void CFrmGroup::OnAddGroup()

{

    // Adds a group and draws a mark in the group. Annotation groups

    // are not actually created until a mark is drawn in the group.

    CString szCurGroup;

    szCurGroup.Format("Accounting Dept %i",rand());

    // Get the name of the group the user clicked on in the listbox

    m_GroupList.AddString(szCurGroup);

    if(pParentDlg)

    {

      pParentDlg->ImgEdit1.AddAnnotationGroup(szCurGroup);

      pParentDlg->ImgEdit1.SetAnnotationType(10);  // wiTextAttachment  // 10

      pParentDlg->ImgEdit1.SetAnnotationBackColor(0xFFFF); // vbYellow

      VARIANT vWidth; V_VT(&vWidth) = VT_I2; V_I2(&vWidth) = 150;

      VARIANT vHeight; V_VT(&vHeight) = VT_I2; V_I2(&vHeight) = 100;

      pParentDlg->ImgEdit1.Draw(10, 10, vWidth, vHeight);

    }

    // The user must manually enter the text on the attachment

}


AutoCrop Method

See Also	Example-VB	Example-VC++
Automatically crops the displayed image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

object.AutoCrop [Option]

Argument

Parameter	Data Type	Setting	Description
Option	Long (enumerated)	0 (default)	Crops all solid black-and-white image data from outside edges
		1	Crops all solid black image data from outside edges
		2	Crops all solid white image data from outside edges
Return Value

None

Remarks

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

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

Invoking the AutoCrop method sets the ImageModified property to True.


AutoCrop Example - VB
AutoCrop Example [image] VB

This example shows how to crop an image automatically.  (It also shows how to invoke other functions that can prepare an image for OCR processing.)

Private Sub cmdCleanup_Click()

    'Perform automatic straighten on the image

    ImgEdit1.AutoDeskew

    'Remove speckles on the image using the default

    'threshold value for dot size

    ImgEdit1.Despeckle

    'If there is a lot of extraneous space around image

    'borders, cropping might reduce processing time

    ImgEdit1.AutoCrop

    'Show the OCR dialog box

    ImgOCR1.ShowOCR

End Sub


AutoCrop Example - VC++
AutoCrop Example [image] VC++

This example shows how to crop an image automatically.  (It also shows how to invoke other functions that can prepare an image for OCR processing.)

void CImgEdit1Dlg::OnCleanup()

{

    // Here are some functions you might want to perform on

    // an image prior to OCR.

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    // Perform automatic straighten on the image

    ImgEdit1.AutoDeskew();

    // Remove speckles on the image using the default

    // threshold value for dot size

    ImgEdit1.Despeckle(evt);

    // If there is a lot of extraneous space around image

    // borders, cropping might reduce processing time

    ImgEdit1.AutoCrop(evt);

    // Show the OCR dialog box

    ImgOcr1.ShowOcr();

}


AutoDeskew Method

See Also	Example-VB	Example-VC++
Automatically deskews (straightens) the displayed image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

object.AutoDeskew

Argument

None

Return Value

None

Remarks

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

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

Invoking the AutoDeskew method sets the ImageModified property to True.


AutoDeskew Example - VB
AutoDeskew Example [image] VB

This example shows how to deskew an image automatically.  (It also shows how to invoke other functions that can prepare an image for OCR processing.)

Private Sub cmdCleanup_Click()

    'Perform automatic straighten on the image

    ImgEdit1.AutoDeskew

    'Remove speckles on the image using the default

    'threshold value for dot size

    ImgEdit1.Despeckle

    'If there is a lot of extraneous space around image

    'borders, cropping might reduce processing time

    ImgEdit1.AutoCrop

    'Show the OCR dialog box

    ImgOCR1.ShowOCR

End Sub


AutoDeskew Example - VC++
AutoDeskew Example [image] VB

This example shows how to deskew an image automatically.  (It also shows how to invoke other functions that can prepare an image for OCR processing.)

void CImgEdit1Dlg::OnCleanup()

{

    // Here are some functions you might want to perform on

    // an image prior to OCR.

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    // Perform automatic straighten on the image

    ImgEdit1.AutoDeskew();

    // Remove speckles on the image using the default

    // threshold value for dot size

    ImgEdit1.Despeckle(evt);

    // If there is a lot of extraneous space around image

    // borders, cropping might reduce processing time

    ImgEdit1.AutoCrop(evt);

    // Show the OCR dialog box

    ImgOcr1.ShowOcr();

}


BurnInAnnotations Method

See Also	Example-VB	Example-VC++
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.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 (See Notes)	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 [image] 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 page types, the BurnInAnnotations method with a MarkOption of 0 changes annotations to black.

MarkOption Set to 1

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

MarkOption Set to 2

For black-and-white page 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 Hyperlink	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. Linked annotations cease to function as hypertext jumps when they are burned in.
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.
OCR Zones	You cannot burn-in OCR Zone annotations.
For all other page 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 or Save Page method to save the 24-bit color images as 8-bit Palettized images (recommended).

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, SaveAs, or SavePage 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.

Keep in mind that if you burn-in a Hyperlink annotation, it ceases to function as a hypertext jump.

Invoking the BurnInAnnotations method sets the ImageModified property to True.

Note:  Hyperlink and OCR Zone annotations are available with Imaging for Windows Professional Edition (V1.0, V1.1, V2.0, and V2.5) only.


BurnInAnnotations Example - VB
BurnInAnnotations Example [image] VB

This example shows how to convert an image, burn in annotation marks, and save the image under a new file name.

Private Sub cmdBurnIn_Click()

    Const ALL_MARKS = 0

    Const WINDOWS_DEFAULT = 2

    'If you wish to save color annotations on a black

    'and white image you must first convert the

    'image to a non black and white type

    ImgEdit1.ConvertPageType wiPageTypePal8, True

    'Save all marks in their original colors

    ImgEdit1.BurnInAnnotations ALL_MARKS, WINDOWS_DEFAULT

    'Color Burn in always converts to RGB24.  To save disk space,

    'save the image as an 8 bit palettized image

    ImgEdit1.SaveAs "C:\imgsave\annotate.tif", wiFileTypeTIFF, wiPageTypePal8

End Sub


BurnInAnnotations Example - VC++
BurnInAnnotations Example [image] VC++

This example shows how to convert an image, burn in annotation marks, and save the image under a new file name.

void CImgEdit1Dlg::OnBurnin()

{

    // Converts an image, burns in annotation marks and saves

    // it under a new file name

    #define ALL_MARKS  0

    #define WINDOWS_DEFAULT  2

    // If you wish to save color annotations on a black

    // and white image you must first convert the

    // image to a non black and white type

    VARIANT vRepaint; V_VT(&vRepaint) = VT_BOOL; V_BOOL(&vRepaint) = TRUE;

    VARIANT evt; V_VT(&evt) = VT_ERROR;  // set to default

    ImgEdit1.ConvertPageType(5,vRepaint);  // wiPageTypePal8, True

    // Save all marks in their original colors

    ImgEdit1.BurnInAnnotations(ALL_MARKS, WINDOWS_DEFAULT,evt);

    // Color Burn in always converts to RGB24.  To save disk space,

    // save the image as an 8 bit palettized image

    VARIANT vFileType; V_VT(&vFileType) = VT_I2;  // set FileType for saveas

    VARIANT vPageType; V_VT(&vPageType) = VT_I2;  // set to PageType for saveas

    V_I2(&vFileType) = 1;

    V_I2(&vPageType) = 5;

    // wiFileTypeTIFF, wiPageTypePal8

    ImgEdit1.SaveAs("C:\\imgsave\\annotate.tif",vFileType,vPageType,evt,evt,evt);

}


ClearDisplay Method

See Also	Example-VB
Clears a displayed image in the control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


ClearDisplay Example [image] VB

This example: edit01.vbp.

End Sub


ClipboardCopy Method

See Also	Example-VB	Example-VC++
Copies the selected or specified portion of an image or annotation to the Clipboard.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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. Check the StatusCode property for the 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.


ClipboardCopy Example - VB
ClipboardCopy Example [image] VB

This example copies the area bound by a user-drawn selection rectangle to a new page.

Private Sub cmdClipCopy_Click()

    'Global blnIsRectangle As Boolean

    'The value of blnIsRectangle is set in the

    'SelectionRectDrawn event

    If blnIsRectangle = False Then

        MsgBox "No rectangle drawn", vbExclamation

        Exit Sub

    End If

    'If no parameters specified will copy area bounded

    'by rectangle

    ImgEdit1.ClipboardCopy

    'Create 8 1/2 X 11 black and white 300 dpi image

    ImgEdit1.DisplayBlankImage 2550, 3300, 300, 300, wiPageTypeBW

    'Reset blnIsRectangle

    blnIsRectangle = False

    'Paste data to new image, call CompletePaste to commit

    'the paste operation

    ImgEdit1.ClipboardPaste

    ImgEdit1.CompletePaste

End Sub


ClipboardCopy Example - VC++
ClipboardCopy Example [image] VC++

This example copies the area bound by a user-drawn selection rectangle to a new page.

void CImgEdit1Dlg::OnCopyPaste()

{

    // This would copy the area bounded by a user drawn

    // selection rectangle to a new page

    // Global blnIsRectangle As Boolean

    // The value of blnIsRectangle is set in the

    // SelectionRectDrawn event

    if(!blnIsRectangle)

    {

       AfxMessageBox ("No rectangle drawn", MB_ICONEXCLAMATION);

       return;

    }

    // If no parameters specified will copy area bounded

    // by rectangle

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.ClipboardCopy(evt,evt,evt,evt);

    // Create 8 1/2 X 11 black and white 300 dpi image

    VARIANT vRes; V_VT(&vRes) = VT_I4; V_I4(&vRes) = 300;

    VARIANT vPageType; V_VT(&vPageType) = VT_I2; // set to PageType for saveas

    V_I2(&vPageType) = 1; // wiPageTypeBW

    ImgEdit1.DisplayBlankImage(2550, 3300, vRes, vRes, vPageType);

    // Reset blnIsRectangle

    blnIsRectangle = FALSE;

    // Paste data to new image, call CompletePaste to commit

    // the paste operation

    ImgEdit1.ClipboardPaste(evt,evt);

    ImgEdit1.CompletePaste();

}


ClipboardCut Method

See Also	Example-VB
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.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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. Check the StatusCode property for the 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.

Invoking the ClipboardCut method sets the ImageModified property to True.


ClipboardCut Example [image] VB

This exampleedit02.vbp.

End Sub


ClipboardPaste Method

See Also	Example-VB	Example-VC++
Pastes image or annotation data from the Clipboard.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.

Invoking the ClipboardPaste method sets the ImageModified property to True.


ClipboardPaste Example - VB
ClipboardPaste Example [image] VB

This example copies the area bound by a user-drawn selection rectangle to a new page.

Private Sub cmdClipCopy_Click()

    'Global blnIsRectangle As Boolean

    'The value of blnIsRectangle is set in the

    'SelectionRectDrawn event

    If blnIsRectangle = False Then

        MsgBox "No rectangle drawn", vbExclamation

        Exit Sub

    End If

    'If no parameters specified will copy area bounded

    'by rectangle

    ImgEdit1.ClipboardCopy

    'Create 8 1/2 X 11 black and white 300 dpi image

    ImgEdit1.DisplayBlankImage 2550, 3300, 300, 300, wiPageTypeBW

    'Reset blnIsRectangle

    blnIsRectangle = False

    'Paste data to new image, call CompletePaste to commit

    'the paste operation

    ImgEdit1.ClipboardPaste

    ImgEdit1.CompletePaste

End Sub


ClipboardPaste Example - VC++
ClipboardPaste Example [image] VC++

This example copies the area bound by a user-drawn selection rectangle to a new page.

void CImgEdit1Dlg::OnCopyPaste()

{

    // This would copy the area bounded by a user drawn

    // selection rectangle to a new page

    // Global blnIsRectangle As Boolean

    // The value of blnIsRectangle is set in the

    // SelectionRectDrawn event

    if(!blnIsRectangle)

    {

      AfxMessageBox ("No rectangle drawn", MB_ICONEXCLAMATION);

      return;

    }

    // If no parameters specified will copy area bounded

    // by rectangle

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.ClipboardCopy(evt,evt,evt,evt);

    // Create 8 1/2 X 11 black and white 300 dpi image

    VARIANT vRes; V_VT(&vRes) = VT_I4; V_I4(&vRes) = 300;

    VARIANT vPageType; V_VT(&vPageType) = VT_I2; // set to PageType for saveas

    V_I2(&vPageType) = 1; // wiPageTypeBW

    ImgEdit1.DisplayBlankImage(2550, 3300, vRes, vRes, vPageType);

    // Reset blnIsRectangle

    blnIsRectangle = FALSE;

    // Paste data to new image, call CompletePaste to commit

    // the paste operation

    ImgEdit1.ClipboardPaste(evt,evt);

    ImgEdit1.CompletePaste();

}


CompletePaste Method

See Also	Example-VB	Example-VC++
Completes a Clipboard paste operation, making the pasted image or annotation data part of the original image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


CompletePaste Example - VB
CompletePaste Example [image] VB

This example copies the area bound by a user-drawn selection rectangle to a new page.

Private Sub cmdClipCopy_Click()

    'Global blnIsRectangle As Boolean

    'The value of blnIsRectangle is set in the

    'SelectionRectDrawn event

    If blnIsRectangle = False Then

        MsgBox "No rectangle drawn", vbExclamation

        Exit Sub

    End If

    'If no parameters specified will copy area bounded

    'by rectangle

    ImgEdit1.ClipboardCopy

    'Create 8 1/2 X 11 black and white 300 dpi image

    ImgEdit1.DisplayBlankImage 2550, 3300, 300, 300, wiPageTypeBW

    'Reset blnIsRectangle

    blnIsRectangle = False

    'Paste data to new image, call CompletePaste to commit

    'the paste operation

    ImgEdit1.ClipboardPaste

    ImgEdit1.CompletePaste

End Sub


CompletePaste Example - VC++
CompletePaste Example [image] VC++

This example copies the area bound by a user-drawn selection rectangle to a new page.

void CImgEdit1Dlg::OnCopyPaste()

{

    // This would copy the area bounded by a user drawn

    // selection rectangle to a new page

    // Global blnIsRectangle As Boolean

    // The value of blnIsRectangle is set in the

    // SelectionRectDrawn event

    if(!blnIsRectangle)

    {

      AfxMessageBox ("No rectangle drawn", MB_ICONEXCLAMATION);

      return;

    }

    // If no parameters specified will copy area bounded

    // by rectangle

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.ClipboardCopy(evt,evt,evt,evt);

    // Create 8 1/2 X 11 black and white 300 dpi image

    VARIANT vRes; V_VT(&vRes) = VT_I4; V_I4(&vRes) = 300;

    VARIANT vPageType; V_VT(&vPageType) = VT_I2; // set to PageType for saveas

    V_I2(&vPageType) = 1; // wiPageTypeBW

    ImgEdit1.DisplayBlankImage(2550, 3300, vRes, vRes, vPageType);

    // Reset blnIsRectangle

    blnIsRectangle = FALSE;

    // Paste data to new image, call CompletePaste to commit

    // the paste operation

    ImgEdit1.ClipboardPaste(evt,evt);

    ImgEdit1.CompletePaste();

}


ConvertPageType Method

See Also	Example-VB	Example-VC++
Converts a displayed image to the page type specified and optionally repaints the image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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] Image is repainted (default) False [image] Image is not repainted
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, SaveAs, or SavePage method must be invoked.

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

Invoking the ConvertPageType method sets the ImageModified property to True.


ConvertPageType Example - VB
ConvertPageType Example [image] VB

This example shows how to convert an image, burn in annotation marks, and save the image under a new file name.

Private Sub cmdBurnIn_Click()

    Const ALL_MARKS = 0

    Const WINDOWS_DEFAULT = 2

    'If you wish to save color annotations on a black

    'and white image you must first convert the

    'image to a non black and white type

    ImgEdit1.ConvertPageType wiPageTypePal8, True

    'Save all marks in their original colors

    ImgEdit1.BurnInAnnotations ALL_MARKS, WINDOWS_DEFAULT

    'Color Burn in always converts to RGB24.  To save disk space,

    'save the image as an 8 bit palettized image

    ImgEdit1.SaveAs "C:\imgsave\annotate.tif", wiFileTypeTIFF, wiPageTypePal8

End Sub


ConvertPageType Example - VC++
ConvertPageType Example [image] VC++

This example shows how to convert an image, burn in annotation marks, and save the image under a new file name.

void CImgEdit1Dlg::OnBurnin()

{

    // Converts an image, burns in annotation marks and saves

    // it under a new file name

    #define ALL_MARKS  0

    #define WINDOWS_DEFAULT  2

    // If you wish to save color annotations on a black

    // and white image you must first convert the

    // image to a non black and white type

    VARIANT vRepaint; V_VT(&vRepaint) = VT_BOOL; V_BOOL(&vRepaint) = TRUE;

    VARIANT evt; V_VT(&evt) = VT_ERROR;  // set to default

    ImgEdit1.ConvertPageType(5,vRepaint);  // wiPageTypePal8, True

    // Save all marks in their original colors

    ImgEdit1.BurnInAnnotations(ALL_MARKS, WINDOWS_DEFAULT,evt);

    // Color Burn in always converts to RGB24.  To save disk space,

    // save the image as an 8 bit palettized image

    VARIANT vFileType; V_VT(&vFileType) = VT_I2; // set FileType for saveas

    VARIANT vPageType; V_VT(&vPageType) = VT_I2; // set to PageType for saveas

    V_I2(&vFileType) = 1;

    V_I2(&vPageType) = 5;

    // wiFileTypeTIFF, wiPageTypePal8

    ImgEdit1.SaveAs("C:\\imgsave\\annotate.tif",vFileType,vPageType,evt,evt,evt);

}


CreateBookMark Method

See Also	Example-VB
Presents the Create Image Bookmark File dialog box from which you create a bookmark file for the file specified by the Image property. The source file can be a TIFF file, a 1.x document (located on a local drive, a redirected drive, or a 1.x server), or an Enterprise Imaging document located on an Enterprise Imaging server.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Edit control

Syntax

object.CreateBookMark szDestFilename, szSrcFileName [,bOverWriteFile, bDelayCompletion]

Arguments

Parameter	Data Type	Setting
szDestFilename	String	Destination file name
SzSrcFileName	String	Source file name
bOverWriteFile	Bool	Whether the destination file will be overwritten: True [image] overwrite the destination file. If the file does not exist, one is created. False [image] (default) do not overwrite the destination file. (If one exists, a error is returned.)
bDelayCompletion	Bool	Whether all pages of a bookmark file are filled in when the file is created: True [image] information for every page is not filled in, saving time. More information is filled in when the file is subsequently accessed. False [image] (default) information for all pages is filled in. This make subsequent access quicker because additional information is not added when the file is opened.
Remarks

An image does not have to be displayed to call this method.

The bookmark file is closed after it is created. If the source file is displayed when the bookmark file is created, the source file continues to be displayed after the operation is completed.


Crop Method

See Also	Example-VB
Crops the displayed image to the rectangle specified.  The current selection rectangle is used if no rectangle is specified.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

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

Arguments

Parameter	Data Type	Setting
Left	Long	The upper-left corner of the rectangle in pixel coordinates of the displayed image
Top	Long	The top of the rectangle in pixel coordinates of the displayed image
Width	Long	The width of the rectangle in pixels
Height	Long	The height of the rectangle in pixels
Return Value

None

Remarks

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

If the Crop method is invoked without parameters after an end user draws a selection rectangle, the image data outside of the selection rectangle is cropped.

The Crop method generates an error if it is invoked without parameters and without an end user drawing a selection rectangle. Check the StatusCode property for the error.

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

Invoking the Crop method sets the ImageModified property to True.


Crop Example [image] VB

Thisedit02.vbp.

End Sub


DeleteAnnotationGroup Method

See Also	Example-VB	Example-VC++
Deletes an annotation group and its annotation marks, and then redisplays the image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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, SaveAs, or SavePage method must be invoked.

Invoking the DeleteAnnotationGroup method sets the ImageModified property to True.


DeleteAnnotationGroup Example - VB
DeleteAnnotationGroup Example [image] VB

This example lets the user select an annotation group from a list and delete the group.  See the example for the GetAnnotationGroup method for instructions on how to list annotation groups.

Private Sub cmdDeleteGroup_Click()

    Dim strCurGroup As String

    'Get the name of the group the user clicked on in the listbox

    strCurGroup = AnnoGroups.List(AnnoGroups.ListIndex)

    Form1.ImgEdit1.DeleteAnnotationGroup (strCurGroup)

End Sub


DeleteAnnotationGroup Example - VC++
DeleteAnnotationGroup Example [image] VC++

This example lets the user select an annotation group from a list and delete the group.  See the example for the GetAnnotationGroup method for instructions on how to list annotation groups.

void CFrmGroup::OnDeleteGroup()

{

    // This would allow a user to select a Group from a list

    // and delete it. See example for GetAnnotationGroup method

    // for how to list annotation groups

    CString szCurGroup;

    // Get the name of the group the user clicked on in the listbox

    m_GroupList.GetText(m_GroupList.GetCurSel(),szCurGroup);

    // remove the group name

    m_GroupList.DeleteString(m_GroupList.GetCurSel());

    if(pParentDlg)

    {

      pParentDlg->ImgEdit1.DeleteAnnotationGroup (szCurGroup);

}

}


DeleteImageData Method

See Also	Example-VB
Deletes a selected or specified portion of an image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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. Check the StatusCode property for the error.

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

Invoking the DeleteImageData method sets the ImageModified property to True.


DeleteImageData Example [image] VB

This example.

End Sub


DeleteSelectedAnnotations Method

See Also	Example-VB
Deletes selected annotations.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 (SelectTool method), or the SelectAnnotationGroup method.  If no annotations are selected, the DeleteSelectedAnnotations method generates an error. Check the StatusCode property for the error.

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

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

Invoking the DeleteSelectedAnnotations method sets the ImageModified property to True.


DeleteSelectedAnnotations Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


Despeckle Method

See Also	Example-VB	Example-VC++
Despeckles (removes black pixels from) the displayed image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

object.Despeckle [Pattern]

Argument

Parameter	Data Type	Setting	Description
Pattern	Long (enumerated)	0 (default)	Removes dots using a single-pixel pattern
		1	Removes dots smaller than average
		2	Removes dots of average size, those typically encountered and safely removed
		3	Removes dots slightly larger than average
		4	Removes most dots
		5	Remove very large dots
Return Value

None

Remarks

This method despeckles black-and-white images only.  Use caution when setting the Pattern parameter so that the despeckling process does not negatively alter the image.

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

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

Invoking the Despeckle method sets the ImageModified property to True.


Despeckle Example - VB
Despeckle Example [image] VB

This example shows how to despeckle an image.  (It also shows how to invoke other functions that can prepare an image for OCR processing.)

Private Sub cmdCleanup_Click()

    'Perform automatic straighten on the image

    ImgEdit1.AutoDeskew

    'Remove speckles on the image using the default

    'threshold value for dot size

    ImgEdit1.Despeckle

    'If there is a lot of extraneous space around image

    'borders, cropping might reduce processing time

    ImgEdit1.AutoCrop

    'Show the OCR dialog box

    ImgOCR1.ShowOCR

End Sub


Despeckle Example - VC++
Despeckle Example [image] VC++

This example shows how to despeckle an image.  (It also shows how to invoke other functions that can prepare an image for OCR processing.)

void CImgEdit1Dlg::OnCleanup()

{

    // Here are some functions you might want to perform on

    // an image prior to OCR.

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    // Perform automatic straighten on the image

    ImgEdit1.AutoDeskew();

    // Remove speckles on the image using the default

    // threshold value for dot size

    ImgEdit1.Despeckle(evt);

    // If there is a lot of extraneous space around image

    // borders, cropping might reduce processing time

    ImgEdit1.AutoCrop(evt);

    // Show the OCR dialog box

    ImgOcr1.ShowOcr();

}


Display Method

See Also	Example-VB	Example-VC++
Displays the image specified in the Image property.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


Display Example - VB
Display Example [image] VB

This example displays a user-selected image file in an Image Edit control.

Private Sub cmdDisplayImage_Click()

    'Use the ImgAdmin Open dialog box to display a file in the

    'Image Edit and Thumbnail controls.

    ImgAdmin1.ShowFileDialog OpenDlg

    'See the sample code for handling the Cancel key in the

    'ShowFileDialog method

    'Set the image properties in the Image Edit and Thumbnail controls

    'to the name of the file selected in the dialog box.

    ImgEdit1.Image = ImgAdmin1.Image

    ImgThumbnail1.Image = ImgAdmin1.Image

    'Set the page to 1 in case a page other than 1 was shown

    'for an image displayed prior to this one

    ImgEdit1.Page = 1

    ImgEdit1.Display

    'Set the focus to the image window so that keystrokes such

    'as scroll keys are sent to the image window.

    ImgEdit1.SetFocus

End Sub


Display Example - VC++
Display Example [image] VC++

This example displays a user-selected image file in an Image Edit control.

void CImgEdit1Dlg::OnDisplay()

{

    // Use the ImgAdmin Open dialog box to display a file in the

    // Image Edit and Thumbnail controls.

     VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowFileDialog(0,vhWnd); // OpenDlg

    //See the sample code for handling the Cancel key in the

    //ShowFileDialog method

    // Set the image properties in the Image Edit and Thumbnail controls

    // to the name of the file selected in the dialog box.

    ImgEdit1.SetImage(ImgAdmin1.GetImage());

    ImgThumbnail1.SetImage(ImgAdmin1.GetImage());

    // Set the page to 1 in case a page other than 1 was shown

    // for an image displayed prior to this one

    ImgEdit1.SetPage(1);

    ImgEdit1.Display();

    // Set the focus to the image window so that keystrokes such

    // as scroll keys are sent to the image window.

    ImgEdit1.SetFocus();

}


DisplayBlankImage Method

See Also	Example-VB	Example-VC++
Displays a blank image according to the dimensions specified.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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
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.


DisplayBlankImage Example - VB
DisplayBlankImage Example [image] VB

This example creates a new blank image and then places a company logo at the top of the new page.

Private Sub cmdDrawLogo_Click()

    'Create a new 8 1/2 X 11" black and white image at 100 dpi

    ImgEdit1.DisplayBlankImage 850, 1100, 100, 100, wiPageTypeBW

    ImgEdit1.AnnotationImage = "D:\image2\corplogo.bmp"

    'Logo would obscure any text under it if Opaque

    ImgEdit1.AnnotationFillStyle = wiOpaque   '1

    'If image is embedded rather than referenced, the source

    'image need not be present when the image is displayed

    ImgEdit1.AnnotationType = wiImageEmbedded   '5

    'Image mark only requires left and top parameters to draw

    'Start not quite halfway across page, 25 pixels from top (1/4")

    ImgEdit1.Draw 350, 25

End Sub


DisplayBlankImage Example - VC++
DisplayBlankImage Example [image] VC++

This example creates a new blank image and then places a company logo at the top of the new page.

void CImgEdit1Dlg::OnImageStamp()

{

    // Create a new 8 1/2 X 11" black and white image at 100 dpi

    VARIANT vPageType; V_VT(&vPageType) = VT_I2; // set to PageType for saveas

    V_I2(&vPageType) = 1; // wiPageTypeBW

    VARIANT vRes; V_VT(&vRes) = VT_I4; V_I4(&vRes) = 100;

    ImgEdit1.DisplayBlankImage (850, 1100, vRes, vRes, vPageType);

    ImgEdit1.SetAnnotationImage("D:\\image2\\corplogo.bmp");

    // Logo would obscure any text under it if Opaque

    ImgEdit1.SetAnnotationFillStyle(1);  // wiOpaque   // 1

    // If image is embedded rather than referenced, the source

    // image need not be present when the image is displayed

    ImgEdit1.SetAnnotationType(5);  // wiImageEmbedded   // 5

    // Image mark only requires left and top parameters to draw

    // Start not quite halfway across page, 25 pixels from top (1/4")

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.Draw(350, 25, evt, evt);

}


DrawSelectionRect Method

See Also	Example-VB	Example-VC++
Draws a selection rectangle on an image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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


DrawSelectionRect Example - VB
DrawSelectionRect Example [image] VB

This example draws a selection rectangle on an image and zooms in on the area bound by the rectangle.

Private Sub cmdZoomSelect_Click()

    'Enable rectangle drawing

    ImgEdit1.SelectionRectangle = True

    'Draw rectangle

    ImgEdit1.DrawSelectionRect 150, 200, 400, 400

    ImgEdit1.ZoomToSelection

End Sub


DrawSelectionRect Example - VC++
DrawSelectionRect Example [image] VC++

This example draws a selection rectangle on an image and zooms in on the area bound by the rectangle.

void CImgEdit1Dlg::OnZoomto()

{

    // This would draw a rectangle on an image and would

    // zoom in on the area bound by the rectangle

    // Enable rectangle drawing

    ImgEdit1.SetSelectionRectangle(TRUE);

    // Draw rectangle

    ImgEdit1.DrawSelectionRect( 150, 200, 400, 400);

    ImgEdit1.ZoomToSelection();

}


EditSelectedAnnotationText Method

See Also	Example-VB	Example-VC++
Displays a dialog box containing the selected text annotation.  The dialog box enables end users to modify the text.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 annotation must be selected for this method to function.  Use the Select Annotations tool (SelectTool method) or the SelectAnnotationGroup method to select annotations.

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

The EditingTextAnnotation event fires whenever the Image Edit control enters or exits Text Edit mode.

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

Invoking the EditSelectedAnnotationText method sets the ImageModified property to True.

This method functions with Text and Hyperlink annotation types.

Note:  Hyperlink annotations are available with Imaging for Windows Professional Edition only.


EditSelectedAnnotationText Example - VB
EditSelectedAnnotationText Example [image] VB

This example uses the MarkSelect event and the EditSelectedAnnotationText method to allow the user to edit the text of an existing, selected annotation mark.

Private Sub ImgEdit1_MarkSelect(ByVal Button As Integer, ByVal Shift As Integer,

 ByVal Left As Long, ByVal Top As Long, ByVal Width As Long,

 ByVal Height As Long, ByVal MarkType As Integer,

 ByVal GroupName As String)

    'Dimension MarkLeft and MarkTop as global variables so these

    'values can be passed back to the EditSelectedAnnotationText method

    MarkLeft = Left

    MarkTop = Top

End Sub

Private Sub cmdEditText_Click()

    'This would allow the user to edit the text of an existing

    'selected annotation mark

    On Error GoTo HandleIt

    'Coordinates of the mark are obtained from the MarkSelect

    'event (see code above).

    ImgEdit1.EditSelectedAnnotationText MarkLeft, MarkTop

    Exit Sub

HandleIt:

     'Handle error if no mark is selected or the wrong type

     'of mark is selected

      MsgBox Err.Description

End Sub


EditSelectedAnnotationText Example - VC++
EditSelectedAnnotationText Example [image] VC++

This example uses the MarkSelect event and the EditSelectedAnnotationText method to allow the user to edit the text of an existing, selected annotation mark.

void CImgEdit2Dlg::OnAnnotext()

{

    // This would allow the user to edit the text of an existing

    // selected annotation mark

    TRY {

      // Coordinates of the mark are obtained from the MarkSelect

      // event (see code below).

      ImgEdit1.EditSelectedAnnotationText(m_MarkLeft, m_MarkTop);

    }

    CATCH (COleDispatchException, e)

    {

      // Handle error if no mark is selected or the wrong type

      // of mark is selected

       AfxMessageBox(e->m_strDescription);

      //Err.Description

    }

    END_CATCH

}

void CImgEdit2Dlg::OnMarkSelect(short Button, short Shift, long Left,

 long Top, long Width, long Height, short MarkType, LPCTSTR GroupName)

{

    m_MarkLeft = Left;

    m_MarkTop = Top;

}


ExecuteTextEditCommand Method

See Also	Example-VB
Executes commands on the Text Edit dialog box when the Image Edit control is in Text Edit mode, as indicated by the EditingTextAnnotation event.

When the Image Edit control is in Text Edit mode, it displays the Text Edit dialog box to let end users create or modify a Text, Attach-a-Note, or Hyperlink annotation.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

object.ExecuteTextEditCommand EditCommand

Arguments

Parameter	Data Type	Constant	Value	Command [image] Description
EditCommand	Integer	wiCutEditText	0	Cut [image] Cuts any selected text to the clipboard
		wiCopyEditText	1	Copy [image] Copies any selected text to the clipboard
		wiPasteEditText	2	Paste [image] Pastes text from the clipboard
		wiUndoEditText	3	Undo/Redo [image] Undoes or Redoes the last textual operation
		wiSelectAllEditText	4	Select All [image] Selects All text
		wiDeleteEditText	5	Delete/Clear [image] Deletes or Clears any selected text
		wiCanUndoEditText	6	Can Undo [image] Checks to see if there is anything to be undone
		wiIsEditTextSelected	7	Is Text Selected [image] Checks to see if there is any text selected
		wiFinishEditText	8	Finish [image] Saves any text changes and closes the text editing session
		wiCancelEditText	9	Cancel [image] Discards any text changes and closes the text editing session
		wiIsModifiedEditText	10	Is Modified [image] Checks to see if anything was changed
Return Value

Long

Command	Value	Description
Cut	0
Copy	0
Paste	0
Undo/Redo	0 Not 0	Failed Success
Select All	0
Delete/Clear	0
Can Undo	0 1	Cannot undo Can undo
Is Text Selected	0 1	No text selected Text selected
Finish	0
Cancel	0
Is Modified	0 Not 0	Not modified Modified
Remarks

An image must be displayed and the Image Edit control must be in Text Edit mode for the commands of this method to function.  The Image Edit control is in Text Edit mode when:

An end user double-clicks on a selected Text, Attach-a-Note, or Hyperlink annotation

The EditSelectedAnnotationText method is invoked with a Text, Attach-a-Note, or Hyperlink annotation selected

A new Text, Attach-a-Note, or Hyperlink annotation is created

Note:  Hyperlink annotations are available with Imaging for Windows Professional Edition only.


ExecuteTextEditCommand Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


FitTo Method

See Also	Example-VB	Example-VC++
Scales the image relative to the image window.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.FitTo Option[,Repaint]

Arguments

Parameter	Data Type	Constant	Setting	Description
Option	Integer	BEST_FIT	0	Best fit [image] Fits the image to the size of the window
		FIT_TO_WIDTH	1	Fit to width [image] Fits the image to the width of the window
		FIT_TO_HEIGHT	2	Fit to height [image] Fits the image to the height of the window
		INCH_TO_INCH	3	Inch to inch [image] Maintains the relative size of the original image regardless of the resolution of the image
		PIXEL_TO_PIXEL	4	Pixel to Pixel [image] The zoom factor is calculated using the display resolution set for the computer. The dots in the image correspond 1-to-1 to the dots on the display, so the size of the image changes if the resolution on the computer is changed
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.


FitTo Example - VB
FitTo Example [image] VB

This example displays an image and scales it so it fits into the window.  Then it displays the height, width, resolution, scaled height, and scaled width of the image to illustrate the difference between ImageHeight/Width and ImageScaleHeight/Width.

Private Sub cmdWidthHeight_Click()

    ImgEdit1.Image = "D:\image2\ocr.tif"

    ImgEdit1.FitTo BEST_FIT

    ImgEdit1.Display

    Load frmInfo

    'Display the dimensions of the image page.

    frmInfo.lblImgHeight.Caption = ImgEdit1.ImageHeight

    frmInfo.lblImgWidth.Caption = ImgEdit1.ImageWidth

   'Display the X and Y resolution of the image page.

    frmInfo.lblImgResX.Caption = ImgEdit1.ImageResolutionX

    frmInfo.lblImgResY.Caption = ImgEdit1.ImageResolutionY

    'Display Image Scale Height

    frmInfo.lblImgScaleHeight.Caption = ImgEdit1.ImageScaleHeight

    frmInfo.lblImgScaleWidth.Caption = ImgEdit1.ImageScaleWidth

    frmInfo.Show 1

End Sub


FitTo Example - VC++
FitTo Example [image] VC++

This example displays an image and scales it so it fits into the window.  Then it displays the height, width, resolution, scaled height, and scaled width of the image to illustrate the difference between ImageHeight/Width and ImageScaleHeight/Width.

void CImgEdit1Dlg::OnWidthHeight()

{

    // Displays an image that is fit to window and then displays

    // height, width, resolution, scaled height and scaled width.

    // This illustrates the difference between ImageHeight/Width

    // and ImageScaleHeight/Width.

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.FitTo(0,evt); //BEST_FIT

    ImgEdit1.Display();

    CFrmInfo frmInfo;

    // Display the dimensions of the image page.

    CString szWindowText;

    long lInfo;

    lInfo = ImgEdit1.GetImageHeight();

    frmInfo.lblImgHeight.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageWidth();

    frmInfo.lblImgWidth.Format("%i",lInfo);

    // Display the X and Y resolution of the image page.

    lInfo = ImgEdit1.GetImageResolutionX();

    frmInfo.lblImgResX.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageResolutionY();

    frmInfo.lblImgResY.Format("%i",lInfo);

    // Display Image Scale Height

    lInfo = ImgEdit1.GetImageScaleHeight();

    frmInfo.lblImgScaleHeight.Format("%i",lInfo);

    lInfo = ImgEdit1.GetImageScaleWidth();

    frmInfo.lblImgScaleWidth.Format("%i",lInfo);

    frmInfo.DoModal();

}


Flip Method

See Also	Example-VB	Example-VC++
Rotates a displayed image by 180 degrees.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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, SaveAs, or SavePage method must be invoked to save the modified image.

Invoking the Flip method sets the ImageModified property to True.


Flip Example - VB
Flip Example [image] VB

This example shows several ways to orient an image, and then redisplay it.

Private Sub cmdRotate_Click()

    ImgEdit1.Rotate True 'rotate all pages

    ImgEdit1.Rotate False 'rotate current page

    'Autorefresh must be set to true or must call

    'Refresh after these methods.

    ImgEdit1.AutoRefresh = True

    ImgEdit1.RotateLeft 'defaults to 90 degrees

    ImgEdit1.RotateRight 45 'optionally can specify degrees

    ImgEdit1.Flip '180 degrees

    'You must save the image to maintain orientation.

End Sub


Flip Example - VC++
Flip Example [image] VC++

This example shows several ways to orient an image, and then redisplay it.

void CImgEdit1Dlg::OnRotate()

{

    // An example of some of the different ways an image could

    // be oriented.

    // This method displays a dialog box which allows

    // user to specify rotation by degrees.  Repaints

    // the screen automatically.  Rotate all writes the

    // file to disk.

    ImgEdit1.Rotate(TRUE); // rotate all pages

    ImgEdit1.Rotate(FALSE); // rotate current page

    // Autorefresh must be set to true or must call

    // Refresh after these methods.

   ImgEdit1.SetAutoRefresh(TRUE);

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.RotateLeft(evt); // defaults to 90 degrees

    VARIANT vRotateAmt; V_VT(&vRotateAmt) = VT_I4; V_I4(&vRotateAmt) = 45;

    ImgEdit1.RotateRight(vRotateAmt); // optionally can specify degrees

    ImgEdit1.Flip(); // 180 degrees

    // You must save the image to maintain orientation.

}


GetAnnotationGroup Method

See Also	Example-VB	Example-VC++
Returns the name of the annotation group based on the index specified.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


GetAnnotationGroupCount Example - VB
GetAnnotationGroup Example [image] VB

This example uses the AnnotationGroupCount property to determine the number of groups on an image.  Then it uses the GetAnnotationGroup method to get the group names.

Private Sub cmdListGroups_Click()

    Dim intNumGroups As Integer

    Dim strGroupName As String

    Dim intCount As Integer

    'find out how many groups are on the page

    intNumGroups = ImgEdit1.AnnotationGroupCount

    Load frmGroupList

    'Since index values of GetAnnotationGroup start with

    '0 have to loop one less than the number of groups

    For intCount = 0 To intNumGroups - 1

        strGroupName = ImgEdit1.GetAnnotationGroup(intCount)

        'write names of groups to a listbox

        frmGroupList.AnnoGroups.AddItem (strGroupName)

    Next intCount

    frmGroupList.Show

End Sub


GetAnnotationGroupCount Example - VC++
GetAnnotationGroup Example [image] VC++

This example uses the AnnotationGroupCount property to determine the number of groups on an image.  Then it uses the GetAnnotationGroup method to get the group names.

BOOL CFrmGroup::OnInitDialog()

{

    CDialog::OnInitDialog();

    // This routine uses AnnotationGroupCount to determine

    // the number of groups on an image and then gets the

    // group names using the GetAnnotationGroup method.

    int iNumGroups;

    CString szGroupName;

    int iCount;

    // find out how many groups are on the page

    iNumGroups = pParentDlg->ImgEdit1.GetAnnotationGroupCount();

    // Since index values of GetAnnotationGroup start with

    // 0 have to loop one less than the number of groups

    for (iCount = 0;iCount < iNumGroups ; iCount++)

    {

        szGroupName = pParentDlg->ImgEdit1.GetAnnotationGroup(iCount);

        // write names of groups to a listbox

        m_GroupList.AddString (szGroupName);

    }

    return TRUE;  // return TRUE unless you set the focus to a control

                  // EXCEPTION: OCX Property Pages should return FALSE

}


GetAnnotationMarkCount Method

See Also	Example-VB	Example-VC++
Returns the number of annotation marks on an image page or in an annotation group.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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
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.


GetAnnotationMarkCount Example - VB
GetAnnotationMarkCount Example [image] VB

This example shows some methods for determining the number and types of annotations on a page.

Private Sub cmdMarkCount_Click()

    Dim intMarkCount As Integer

    'Returns a count of all marks on the page displayed.

    intMarkCount = ImgEdit1.GetAnnotationMarkCount

    'Returns a count of all marks in the annotation group called

    'accounting.

    intMarkCount = ImgEdit1.GetAnnotationMarkCount("accounting")

    'Returns a count of all OCR regions.

    intMarkCount = ImgEdit1.GetAnnotationMarkCount(, wiOcrRegion)

    'Returns a count of all text annotation marks in the

    'annotation group called "accounting".

    intMarkCount = ImgEdit1.GetAnnotationMarkCount("accounting", wiText)

End Sub


GetAnnotationMarkCount Example - VC++
GetAnnotationMarkCount Example [image] VC++

This example shows some methods for determining the number and types of annotations on a page.

void CImgEdit1Dlg::OnGetCount()

{

    // Some methods for determining the number and types of

    // annotations on a page.

    int iMarkCount;

    CString szCurGroup("accounting");

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    VARIANT vCurGroup; V_VT(&vCurGroup) = VT_BSTR;V_BSTR(&vCurGroup) =

     szCurGroup.AllocSysString();

    VARIANT vCurType; V_VT(&vCurType) = VT_I2;

    // Returns a count of all marks on the page displayed.

    iMarkCount = ImgEdit1.GetAnnotationMarkCount(evt,evt);

    // Returns a count of all marks in the annotation group called

    // accounting.

    iMarkCount = ImgEdit1.GetAnnotationMarkCount(vCurGroup,evt);

    // Returns a count of all OCR regions.

    V_I2(&vCurType) = 12;  // wiOcrRegion

    iMarkCount = ImgEdit1.GetAnnotationMarkCount(evt, vCurType);

    // Returns a count of all text annotation marks in the

    // annotation group called "accounting".

    V_I2(&vCurType) = 7;   // wiText

    iMarkCount = ImgEdit1.GetAnnotationMarkCount(vCurGroup, vCurType);

}


GetCurrentAnnotationGroup Method

See Also	Example-VB
Returns the name of the annotation group to which subsequent annotations will belong.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.GetCurrentAnnotationGroup

Arguments

None

Return Value

String

Remarks

The GetCurrentAnnotationGroup method is valid only at run-time.


GetCurrentAnnotationGroup Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


GetIbkDefaultFile Method

See Also	Example-VB
Returns the name of the underlying file referenced by the bookmark file. The bookmark file is specified by the Image property.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Edit control

Syntax

object.GetIbkDefaultFile

Arguments

None

Return Value

String


GetICMOptions Method

See Also	Example-VB
Returns the current ICM options.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Image Edit control

Syntax

object.GetICMOptions

Arguments

None

Return Value

Long

Value	Description
0	No options
1	Save image data as sRGB
Remarks

Color correction is only applied with Windows 98 and Windows 2000.


GetRubberStampItem Method

See Also	Example-VB	Example-VC++
Returns the item number for the currently selected rubber stamp, according to its position on the Rubber Stamp Properties dialog box and drop-down menu.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

object.GetRubberStampItem

Arguments

None

Return Value

Integer

Remarks

The item number is zero based.  For example, if the Received stamp is selected, an ItemNumber of 2 is returned because it is the third item on the Rubber Stamp Properties dialog box and drop-down menu.

The Rubber Stamp Properties dialog box is accessible by right-clicking on the Rubber Stamp tool in the Annotation Tool Palette.  The drop-down menu is accessible by left-clicking on the tool.


GetRubberStampItem Example - VB
GetRubberStampItem Example [image] VB

This example uses the GetRubberStampMenuItems method to populate a list box with the names of the rubber stamps that are currently available.  It also uses the GetRubberStampItem method to obtain the item number of the stamp that is currently selected.

You can use these methods when designing a custom tool palette to let users select the type of rubber stamp they want to use.

Private Sub cmdStamps_Click()

    'Get the names of all available rubber stamps and

    'write them to a listbox.  This could be used when

    'designing a custom tool palette so that when the

    'user clicks on the stamp icon, they could then

    'select the desired stamp from a list.

    Dim strAllStamps As String

    Dim strStampName As String

    Dim intCurStamp As Integer

    Dim intStartPos As Integer

    Dim intEndPos As Integer

    'Get the stamp list.

    strAllStamps = frmMain.ImgEdit1.GetRubberStampMenuItems

    'Load the list box.

    Load frmStampList

    intStartPos = 0

    intEndPos = 1

    'Loop to parse stamps

    Do While intEndPos <> 0

      'Find location of line feed characters which separate

      'stamp names.

      intEndPos = InStr(intStartPos + 1, strAllStamps, vbLf)

      'If intEndPos is 0 we are at the end of the string

      If intEndPos = 0 Then Exit Do

      'Retrieve text up to the line feed character

      strStampName = Mid(strAllStamps, (intStartPos + 1), (intEndPos - intStartPos - 1))

      frmStampList.List1.AddItem strStampName

      intStartPos = intEndPos

    Loop

    'Highlight the stamp that is the currently selected stamp.  This

    'will be the first stamp in the list if none have been selected;

    'otherwise it will be the most recently selected stamp.

    intCurStamp = frmMain.ImgEdit1.GetRubberStampItem

    frmStampList.List1.ListIndex = intCurStamp

    frmStampList.Show

End Sub


GetRubberStampItem Example - VC++
GetRubberStampItem Example [image] VC++

This example uses the GetRubberStampMenuItems method to populate a list box with the names of the rubber stamps that are currently available.  It also uses the GetRubberStampItem method to obtain the item number of the stamp that is currently selected.

You can use these methods when designing a custom tool palette to let users select the type of rubber stamp they want to use.

BOOL CStampList::OnInitDialog()

{

    // Get the names of all available rubber stamps and

    // write them to a listbox.  This could be used when

    // designing a custom tool palette so that when the

    // user clicks on the stamp icon, they could then

    // select the desired stamp from a list.

    CDialog::OnInitDialog();

    CString strAllStamps;

    int intCurStamp;

    // Get the stamp list

    strAllStamps = m_pParent->ImgEdit1.GetRubberStampMenuItems();

    // Loop to parse stamps

    char sep[] = "\n";

    char *  token;

    /* Establish string and get the first token: */

    token = _tcstok( strAllStamps.GetBuffer(strAllStamps.GetLength()),sep);

    while( token != NULL )

    {

      m_StampList.AddString(token);

      token = _tcstok( NULL, sep );

    }

    // Highlight the stamp that is the currently selected stamp

    intCurStamp = m_pParent->ImgEdit1.GetRubberStampItem();

    m_StampList.SetCurSel(intCurStamp);

    return TRUE;  // return TRUE unless you set the focus to a control

                 // EXCEPTION: OCX Property Pages should return FALSE

}

void CStampList::OnOK()

{

    // Get the index number of the stamp that was selected

    // in the list box

    m_intNewStamp = m_StampList.GetCurSel();

    // Set the selected stamp as the current stamp to be used.

    CDialog::OnOK();

}


GetRubberStampMenuItems Method

See Also	Example-VB	Example-VC++
Returns the menu items for the Rubber Stamp tool on the Annotation Tool Palette.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

object.GetRubberStampMenuItems

Arguments

None

Return Value

String

Remarks

The returned strings are separated by a new line character (\n).

The Rubber Stamp drop-down menu is accessible by left-clicking the Rubber Stamp tool on the palette.


GetRubberStampMenuItems Example - VB
GetRubberStampMenuItems Example [image] VB

This example uses the GetRubberStampMenuItems method to populate a list box with the names of the rubber stamps that are currently available.  It also uses the GetRubberStampItem method to obtain the item number of the stamp that is currently selected.

You can use these methods when designing a custom tool palette to let users select the type of rubber stamp they want to use.

Private Sub cmdStamps_Click()

    'Get the names of all available rubber stamps and

    'write them to a listbox.  This could be used when

    'designing a custom tool palette so that when the

    'user clicks on the stamp icon, they could then

    'select the desired stamp from a list.

    Dim strAllStamps As String

    Dim strStampName As String

    Dim intCurStamp As Integer

    Dim intStartPos As Integer

    Dim intEndPos As Integer

    'Get the stamp list.

    strAllStamps = frmMain.ImgEdit1.GetRubberStampMenuItems

    'Load the list box.

    Load frmStampList

    intStartPos = 0

    intEndPos = 1

    'Loop to parse stamps

    Do While intEndPos <> 0

      'Find location of line feed characters which separate

      'stamp names.

      intEndPos = InStr(intStartPos + 1, strAllStamps, vbLf)

      'If intEndPos is 0 we are at the end of the string

      If intEndPos = 0 Then Exit Do

      'Retrieve text up to the line feed character

      strStampName = Mid(strAllStamps, (intStartPos + 1), (intEndPos - intStartPos - 1))

      frmStampList.List1.AddItem strStampName

      intStartPos = intEndPos

    Loop

    'Highlight the stamp that is the currently selected stamp.  This

    'will be the first stamp in the list if none have been selected;

    'otherwise it will be the most recently selected stamp.

    intCurStamp = frmMain.ImgEdit1.GetRubberStampItem

    frmStampList.List1.ListIndex = intCurStamp

    frmStampList.Show

End Sub


GetRubberStampMenuItems Example - VC++
GetRubberStampMenuItems Example [image] VC++

This example uses the GetRubberStampMenuItems method to populate a list box with the names of the rubber stamps that are currently available.  It also uses the GetRubberStampItem method to obtain the item number of the stamp that is currently selected.

You can use these methods when designing a custom tool palette to let users select the type of rubber stamp they want to use.

BOOL CStampList::OnInitDialog()

{

    // Get the names of all available rubber stamps and

    // write them to a listbox.  This could be used when

    // designing a custom tool palette so that when the

    // user clicks on the stamp icon, they could then

    // select the desired stamp from a list.

    CDialog::OnInitDialog();

    CString strAllStamps;

    int intCurStamp;

    // Get the stamp list

    strAllStamps = m_pParent->ImgEdit1.GetRubberStampMenuItems();

    // Loop to parse stamps

    char sep[] = "\n";

    char *  token;

    /* Establish string and get the first token: */

    token = _tcstok( strAllStamps.GetBuffer(strAllStamps.GetLength()),sep);

    while( token != NULL )

    {

      m_StampList.AddString(token);

      token = _tcstok( NULL, sep );

    }

    // Highlight the stamp that is the currently selected stamp

    intCurStamp = m_pParent->ImgEdit1.GetRubberStampItem();

    m_StampList.SetCurSel(intCurStamp);

    return TRUE;  // return TRUE unless you set the focus to a control

                 // EXCEPTION: OCX Property Pages should return FALSE

}

void CStampList::OnOK()

{

    // Get the index number of the stamp that was selected

    // in the list box

    m_intNewStamp = m_StampList.GetCurSel();

    // Set the selected stamp as the current stamp to be used.

    CDialog::OnOK();

}


GetSelectedAnnotationBackColor Method

See Also	Example-VB	Example-VC++
Returns the background color of a selected Attach-a-Note annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationBackColor

Arguments

None

Return Value

OLE_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 RGB format.


GetSelectedAnnotationBackColor Example - VB
GetSelectedAnnotationBackColor Example [image] VB

This example uses the GetSelectedAnnotationBackColor method, the SetSelectedAnnotationBackColor method, and the Microsoft common dialog box to change the background color of a selected text annotation.

Private Sub cmdBackColor_Click()

    'This example uses the Microsoft color dialog box to change

    'a selected text attachment annotation mark's background color.

    Dim BackColor As OLE_COLOR

    'Determine the current color of the selected annotation

    'mark and init the dialog box color property to that color.

    BackColor = ImgEdit1.GetSelectedAnnotationBackColor

    CommonDialog1.Color = BackColor

    CommonDialog1.Flags = cdlCCRGBInit

    'Display the dialog box, and set the annotation background color

    'to the color selected.

    CommonDialog1.ShowColor

    ImgEdit1.SetSelectedAnnotationBackColor CommonDialog1.Color

End Sub


GetSelectedAnnotationBackColor Example - VC++
GetSelectedAnnotationBackColor Example [image] VC++

This example uses the GetSelectedAnnotationBackColor method, the SetSelectedAnnotationBackColor method, and the Microsoft common dialog box to change the background color of a selected text annotation.

void CImgEdit2Dlg::OnBackcolor()

{

    // This example uses the Microsoft color dialog box to change

    // a selected text attachment annotation mark's background color.

    long BackColor;

    // Determine the current color of the selected annotation

    // mark and init the dialog box color property to that color.

    BackColor = ImgEdit1.GetSelectedAnnotationBackColor();

    CommonDialog1.SetColor(BackColor);

    CommonDialog1.SetFlags(1); // cdlCCRGBInit

    CommonDialog1.ShowColor();

    ImgEdit1.SetSelectedAnnotationBackColor(CommonDialog1.GetColor());

}


GetSelectedAnnotationFillColor Method

See Also	Example-VB	Example-VC++
Returns the color used to fill a selected Filled Rectangle annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationFillColor

Arguments

None

Return Value

OLE_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 RGB format.


GetSelectedAnnotationFillColor Example - VB
GetSelectedAnnotationFillColor Example [image] VB

This example uses the GetSelectedAnnotationFillColor method to determine the fill color of a selected annotation.  It then updates the Microsoft common dialog box to indicate the color obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationFillColor method to change the fill color of a selected annotation.

Private Sub cmdFillColor_Click()

    'This example uses the Microsoft color dialog box to

    'change a selected annotation mark's fill color.

    Dim FillColor As OLE_COLOR

    'Determine the current color of the selected annotation

    'mark and init the dialog box color property to that color.

    FillColor = ImgEdit1.GetSelectedAnnotationFillColor

    CommonDialog1.Color = FillColor

    CommonDialog1.Flags = cdlCCRGBInit

    CommonDialog1.ShowColor

    ImgEdit1.SetSelectedAnnotationFillColor CommonDialog1.Color

End Sub


GetSelectedAnnotationFillColor Example - VC++
GetSelectedAnnotationFillColor Example [image] VC++

This example uses the GetSelectedAnnotationFillColor method to determine the fill color of a selected annotation.  It then updates the Microsoft common dialog box to indicate the color obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationFillColor method to change the fill color of a selected annotation.

void CImgEdit2Dlg::OnFillcolor()

{

    // This example uses the Microsoft color dialog box to

    // change a selected annotation mark's fill color.

    long FillColor;

    // Determine the current color of the selected annotation

    // mark and init the dialog box color property to that color.

    FillColor = ImgEdit1.GetSelectedAnnotationFillColor();

    CommonDialog1.SetColor(FillColor);

    CommonDialog1.SetFlags(1); // cdlCCRGBInit

    CommonDialog1.ShowColor();

    ImgEdit1.SetSelectedAnnotationFillColor(CommonDialog1.GetColor());

}


GetSelectedAnnotationFillStyle Method

See Also	Example-VB	Example-VC++
Returns the style used to fill a selected image or Filled Rectangle annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationFillStyle

Arguments

None

Return Value

Integer (enumerated)

Constant	Value	Description
wiTransparent	0	Transparent
wiOpaque	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


GetSelectedAnnotationFillStyle Example - VB
GetSelectedAnnotationFillStyle Example [image] VB

This example uses the GetSelectedAnnotationFillStyle method to determine whether a selected image or filled rectangle annotation is opaque or transparent, and the SetSelectedAnnotationFillStyle method to change the fill style.

    'Private Sub Form_Load()

    'This example determines whether a selected annotation

    'image or filled rectangle is opaque or transparent and

    'allows that attribute to be changed.  The form used

    'has 2 option buttons -- one labeled "Opaque" and one

    'labeled "Transparent".

    Dim FillStyle As AnnotationStyleConstants

    'Determine if the selected image annotation is opaque or

    'transparent and set the corresponding option button on

    'the form.

    FillStyle = frmMain.ImgEdit1.GetSelectedAnnotationFillStyle

    If FillStyle = wiOpaque Then

      optOpaque.Value = True

    Else

      optTransparent.Value = True

    End If

    frmFillStyle.Show

End Sub

Private Sub optOpaque_Click()

     'If the user clicks on the Opaque option button the annotation

     'is changed to be opaque.

     frmMain.ImgEdit1.SetSelectedAnnotationFillStyle wiOpaque

End Sub


GetSelectedAnnotationFillStyle Example - VC++
GetSelectedAnnotationFillStyle Example [image] VC++

This example uses the GetSelectedAnnotationFillStyle method to determine whether a selected image or filled rectangle annotation is opaque or transparent, and the SetSelectedAnnotationFillStyle method to change the fill style.

void CLineStyles::OnOK()

{

    if(m_Transparent.GetCheck() && m_bLineStyle)

      m_pParent->ImgEdit1.SetSelectedAnnotationLineStyle(0);

    else

      m_pParent->ImgEdit1.SetSelectedAnnotationLineStyle(1);

    if(m_Transparent.GetCheck() && !m_bLineStyle)

      m_pParent->ImgEdit1.SetSelectedAnnotationFillStyle(0);

    else

      m_pParent->ImgEdit1.SetSelectedAnnotationFillStyle(1);

    CDialog::OnOK();

}

BOOL CLineStyles::OnInitDialog()

{

    CDialog::OnInitDialog();

    short LineStyle;

    // Determine if the selected line or fill annotation is opaque or

    // transparent and set the corresponding option button on

    // the form.

    if(m_bLineStyle)

      LineStyle = m_pParent->ImgEdit1.GetSelectedAnnotationLineStyle();

    else

     {

      LineStyle = m_pParent->ImgEdit1.GetSelectedAnnotationFillStyle();

      SetWindowText("Fill Styles");

     }

    if(LineStyle == 1)  //  wiOpaque

     {

      m_Opaque.SetCheck(1);

      m_Transparent.SetCheck(0);

     }

    else

     {

      m_Opaque.SetCheck(0);

      m_Transparent.SetCheck(1);

     }

    return TRUE;  // return TRUE unless you set the focus to a control

                  // EXCEPTION: OCX Property Pages should return FALSE

}


GetSelectedAnnotationFont Method

See Also	Example-VB	Example-VC++
Returns a font object’s properties.  Applies to selected text annotations.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationFont

Arguments

None

Return Value

IFontDisp

Remarks

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

Attach-a-Note

Text

Hyperlink

Text From File

Text Stamp

Note:  Hyperlink annotations are available with Imaging for Windows Professional Edition only.


GetSelectedAnnotationFont Example - VB
GetSelectedAnnotationFont Example [image] VB

This example uses the GetSelectedAnnotationFont method to determine the font attributes of a selected annotation.  It then updates the Microsoft common dialog box to indicate the attributes obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationFont method to change the font attributes of a selected annotation.

Private Sub cmdGetAnnoFont_Click()

    'This example uses the Microsoft font dialog box to

    'change a selected text annotation mark's font.

    Dim AnnoFont As IFontDisp

    Dim FontColor As OLE_COLOR

    'Determine the current font used in the selected annotation

    'mark and init the dialog box font property to that font.

    Set AnnoFont = ImgEdit1.GetSelectedAnnotationFont

    FontColor = ImgEdit1.GetSelectedAnnotationFontColor

    CommonDialog1.FontName = AnnoFont.Name

    CommonDialog1.FontBold = AnnoFont.Bold

    CommonDialog1.FontItalic = AnnoFont.Italic

    CommonDialog1.FontSize = AnnoFont.Size

    CommonDialog1.FontUnderline = AnnoFont.Underline

    CommonDialog1.FontStrikethru = AnnoFont.Strikethrough

    CommonDialog1.Color = FontColor

    CommonDialog1.Flags = cdlCFScreenFonts Or cdlCFEffects

    CommonDialog1.ShowFont

    'Take values set in the font dialog box and set these

    'attributes in the annotation font.

    AnnoFont.Name = CommonDialog1.FontName

    AnnoFont.Bold = CommonDialog1.FontBold

    AnnoFont.Italic = CommonDialog1.FontItalic

    AnnoFont.Size = CommonDialog1.FontSize

    AnnoFont.Underline = CommonDialog1.FontUnderline

    AnnoFont.Strikethrough = CommonDialog1.FontStrikethru

    'Apply the new font and font color to the selected

    'annotation.

    ImgEdit1.SetSelectedAnnotationFont AnnoFont

    ImgEdit1.SetSelectedAnnotationFontColor CommonDialog1.Color

End Sub


GetSelectedAnnotationFont Example - VC++
GetSelectedAnnotationFont Example [image] VC++

This example uses the GetSelectedAnnotationFont method to determine the font attributes of a selected annotation.  It then updates the Microsoft common dialog box to indicate the attributes obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationFont method to change the font attributes of a selected annotation.

void CImgEdit2Dlg::OnAnnofont()

{

    // This example uses the Microsoft font dialog box to

    // change a selected text annotation mark's font.

    COleFont AnnoFont;

    AnnoFont = ImgEdit1.GetSelectedAnnotationFont();

    CY cy;

    long FontColor;

    // Determine the current font used in the selected annotation

    // mark and init the dialog box font property to that font.

    AnnoFont = ImgEdit1.GetSelectedAnnotationFont();

    FontColor = ImgEdit1.GetSelectedAnnotationFontColor();

    CommonDialog1.SetFontName(AnnoFont.GetName());

    CommonDialog1.SetFontBold(AnnoFont.GetBold());

    CommonDialog1.SetFontItalic(AnnoFont.GetItalic());

    cy = AnnoFont.GetSize();

    CommonDialog1.SetFontSize((float)cy.Lo / 10000);

    CommonDialog1.SetFontUnderLine(AnnoFont.GetUnderline());

    CommonDialog1.SetFontStrikeThru(AnnoFont.GetStrikethrough());

    CommonDialog1.SetColor(FontColor);

    CommonDialog1.SetFlags(0x101); //cdlCFScreenFonts Or cdlCFEffects

    CommonDialog1.ShowFont();

    // Take values set in the font dialog box and set these

    // attributes in the annotation font.

    AnnoFont.SetName(CommonDialog1.GetFontName());

    AnnoFont.SetBold(CommonDialog1.GetFontBold());

    AnnoFont.SetItalic(CommonDialog1.GetFontItalic());

    cy.Lo = (unsigned long)CommonDialog1.GetFontSize() * 10000;

    AnnoFont.SetSize(cy);

    AnnoFont.SetUnderline(CommonDialog1.GetFontUnderLine());

    AnnoFont.SetStrikethrough(CommonDialog1.GetFontStrikeThru());

    // Apply the new font and font color to the selected

    // annotation.

    ImgEdit1.SetSelectedAnnotationFont(AnnoFont);

    ImgEdit1.SetSelectedAnnotationFontColor(CommonDialog1.GetColor());

}


GetSelectedAnnotationFontColor Method

See Also	Example-VB	Example-VC++
Returns the color used in a selected text annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationFontColor

Arguments

None

Return Value

OLE_COLOR

Remarks

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

Attach-a-Note

Hyperlink

Text

Text From File

Text Stamp

Color is expressed using the RGB format.

Note:  Hyperlink annotations are available with Imaging for Windows Professional Edition only.


GetSelectedAnnotationFontColor - VB
GetSelectedAnnotationFontColor Example [image] VB

This example uses the GetSelectedAnnotationFontColor method to determine the font color of a selected annotation.  It then updates the Microsoft common dialog box to indicate the color obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationFontColor method to change the font color of a selected annotation.

Private Sub cmdFontColor_Click()

    'This example uses the Microsoft color dialog box to

    'change a selected annotation mark's font color.

    Dim FontColor As OLE_COLOR

    'Determine the current color of the selected annotation

    'mark and init the dialog box color property to that color.

    FontColor = ImgEdit1.GetSelectedAnnotationFontColor

    CommonDialog1.Color = FontColor

    CommonDialog1.Flags = cdlCCRGBInit

    CommonDialog1.ShowColor

    ImgEdit1.SetSelectedAnnotationFontColor CommonDialog1.Color

End Sub


GetSelectedAnnotationFontColor - VC++
GetSelectedAnnotationFontColor Example [image] VC++

This example uses the GetSelectedAnnotationFontColor method to determine the font color of a selected annotation.  It then updates the Microsoft common dialog box to indicate the color obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationFontColor method to change the font color of a selected annotation.

void CImgEdit2Dlg::OnAnnofont()

{

    // This example uses the Microsoft font dialog box to

    // change a selected text annotation mark's font.

    COleFont AnnoFont;

    AnnoFont = ImgEdit1.GetSelectedAnnotationFont();

    CY cy;

    long FontColor;

    // Determine the current font used in the selected annotation

    // mark and init the dialog box font property to that font.

    AnnoFont = ImgEdit1.GetSelectedAnnotationFont();

    FontColor = ImgEdit1.GetSelectedAnnotationFontColor();

    CommonDialog1.SetFontName(AnnoFont.GetName());

    CommonDialog1.SetFontBold(AnnoFont.GetBold());

    CommonDialog1.SetFontItalic(AnnoFont.GetItalic());

    cy = AnnoFont.GetSize();

    CommonDialog1.SetFontSize((float)cy.Lo / 10000);

    CommonDialog1.SetFontUnderLine(AnnoFont.GetUnderline());

    CommonDialog1.SetFontStrikeThru(AnnoFont.GetStrikethrough());

    CommonDialog1.SetColor(FontColor);

    CommonDialog1.SetFlags(0x101); //cdlCFScreenFonts Or cdlCFEffects

    CommonDialog1.ShowFont();

    // Take values set in the font dialog box and set these

    // attributes in the annotation font.

    AnnoFont.SetName(CommonDialog1.GetFontName());

    AnnoFont.SetBold(CommonDialog1.GetFontBold());

    AnnoFont.SetItalic(CommonDialog1.GetFontItalic());

    cy.Lo = (unsigned long)CommonDialog1.GetFontSize() * 10000;

    AnnoFont.SetSize(cy);

    AnnoFont.SetUnderline(CommonDialog1.GetFontUnderLine());

    AnnoFont.SetStrikethrough(CommonDialog1.GetFontStrikeThru());

    // Apply the new font and font color to the selected

    // annotation.

    ImgEdit1.SetSelectedAnnotationFont(AnnoFont);

    ImgEdit1.SetSelectedAnnotationFontColor(CommonDialog1.GetColor());

}


GetSelectedAnnotationImage Method

See Also	Example-VB
Returns the fully-qualified name of the image that is being used in a selected image annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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


GetSelectedAnnotationImage Example - VB
GetSelectedAnnotationImage Example [image] VB

This example uses the GetSelectedAnnotationImage method to obtain the fully-qualified file name of the image being used in a selected image annotation.

Private Sub CmdGetAnnoImg_Click()

    'Displays a message box which shows the fully qualified

    'filename for a selected annotation image.

    Dim strAnnImg As String

    'The MarkSelect event could be used to determine if

    'the appropriate type of annotation mark is selected.

    strAnnImg = ImgEdit1.GetSelectedAnnotationImage

    MsgBox "The annotation image is " & strAnnImg

End Sub


GetSelectedAnnotationLineColor Method

See Also	Example-VB	Example-VC++
Returns the line color used in a selected line or Hollow Rectangle annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationLineColor

Arguments

None

Return Value

OLE_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 RGB format.


GetSelectedAnnotationLineColor Example - VB
GetSelectedAnnotationLineColor Example [image] VB

This example uses the GetSelectedAnnotationLineColor method to determine the color of a selected line annotation.  It then updates the Microsoft common dialog box to indicate the color obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationLineColor method to change the color of a selected line annotation.

Private Sub cmdLineColor_Click()

    'This example uses the Microsoft color dialog box to

    'change a selected annotation mark's line color.

    Dim LineColor As OLE_COLOR

    'Determine the current color of the selected annotation

    'mark and init the dialog box color property to that color.

    LineColor = ImgEdit1.GetSelectedAnnotationLineColor

    CommonDialog1.Color = LineColor

    CommonDialog1.Flags = cdlCCRGBInit

    CommonDialog1.ShowColor

    ImgEdit1.SetSelectedAnnotationLineColor CommonDialog1.Color

End Sub


GetSelectedAnnotationLineColor Example - VC++
GetSelectedAnnotationLineColor Example [image] VC++

This example uses the GetSelectedAnnotationLineColor method to determine the color of a selected line annotation.  It then updates the Microsoft common dialog box to indicate the color obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationLineColor method to change the color of a selected line annotation.

void CImgEdit2Dlg::OnLinecolor()

{

    // This example uses the Microsoft color dialog box to

    // change a selected annotation mark's line color.

    long LineColor;

    // Determine the current color of the selected annotation

    // mark and init the dialog box color property to that color.

    LineColor = ImgEdit1.GetSelectedAnnotationLineColor();

    CommonDialog1.SetColor(LineColor);

    CommonDialog1.SetFlags(1); // cdlCCRGBInit

    CommonDialog1.ShowColor();

    ImgEdit1.SetSelectedAnnotationLineColor(CommonDialog1.GetColor());

}


GetSelectedAnnotationLineStyle Method

See Also	Example-VB	Example-VC++
Returns the line style used in a selected line or Hollow Rectangle annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationLineStyle

Arguments

None

Return Value

Integer (enumerated)

Constant	Value	Description
wiTransparent	0	Transparent
wiOpaque	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


GetSelectedAnnotationLineStyle Example - VB
GetSelectedAnnotationLineStyle Example [image] VB

This example uses the GetSelectedAnnotationLineStyle method to determine whether a selected line or hollow rectangle annotation is opaque or transparent, and the SetSelectedAnnotationLineStyle method to change the line style.

Private Sub Form_Load()

    'This example determines whether a selected annotation

    'image or filled rectangle is opaque or transparent and

    'allows that attribute to be changed.  The form used

    'has 2 option buttons -- one labeled "Opaque" and one

    'labeled "Transparent".

    Dim LineStyle As AnnotationStyleConstants

    'Determine if the selected line annotation is opaque or

    'transparent and set the corresponding option button on

    'the form.

    LineStyle = frmMain.ImgEdit1.GetSelectedAnnotationLineStyle

    If LineStyle = wiOpaque Then

      optOpaque.Value = True

    Else

      optTransparent.Value = True

    End If

    frmLineStyle.Show

End Sub

Private Sub optOpaque_Click()

    'If the user clicks on the Opaque option button the annotation

    'is changed to be opaque.

    frmMain.ImgEdit1.SetSelectedAnnotationLineStyle wiOpaque

End Sub

Private Sub optTransparent_Click()

    'If the user clicks on the Transparent option button the annotation

    'is changed to be transparent.

    frmMain.ImgEdit1.SetSelectedAnnotationLineStyle wiTransparent

End Sub


GetSelectedAnnotationLineStyle Example - VC++
GetSelectedAnnotationLineStyle Example [image] VC++

This example uses the GetSelectedAnnotationLineStyle method to determine whether a selected line or hollow rectangle annotation is opaque or transparent, and the SetSelectedAnnotationLineStyle method to change the line style.

void CLineStyles::OnOK()

{

    if(m_Transparent.GetCheck() && m_bLineStyle)

      m_pParent->ImgEdit1.SetSelectedAnnotationLineStyle(0);

    else

      m_pParent->ImgEdit1.SetSelectedAnnotationLineStyle(1);

    if(m_Transparent.GetCheck() && !m_bLineStyle)

      m_pParent->ImgEdit1.SetSelectedAnnotationFillStyle(0);

    else

      m_pParent->ImgEdit1.SetSelectedAnnotationFillStyle(1);

    CDialog::OnOK();

}

BOOL CLineStyles::OnInitDialog()

{

    CDialog::OnInitDialog();

    short LineStyle;

    // Determine if the selected line or fill annotation is opaque or

    // transparent and set the corresponding option button on

    // the form.

    if(m_bLineStyle)

      LineStyle = m_pParent->ImgEdit1.GetSelectedAnnotationLineStyle();

    else

     {

      LineStyle = m_pParent->ImgEdit1.GetSelectedAnnotationFillStyle();

      SetWindowText("Fill Styles");

     }

    if(LineStyle == 1)  //  wiOpaque

     {

      m_Opaque.SetCheck(1);

      m_Transparent.SetCheck(0);

     }

    else

     {

      m_Opaque.SetCheck(0);

      m_Transparent.SetCheck(1);

     }

    return TRUE;  // return TRUE unless you set the focus to a control

                  // EXCEPTION: OCX Property Pages should return FALSE

}


GetSelectedAnnotationLineWidth Method

See Also	Example-VB	Example-VC++
Returns the line width in pixels used in a selected line or Hollow Rectangle annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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


GetSelectedAnnotationLineWidth Example - VB
GetSelectedAnnotationLineWidth Example [image] VB

This example uses the GetSelectedAnnotationLineWidth method to determine the width of a selected line annotation.  It then updates a text box and a Line control to illustrate the width.

Private Sub Form_Load()

    'First, determine an annotation line's width and color. This is

    'then used in a dialog box which contains a sample line with a text

    'box to indicate the line width (in pixels) and an updown control

    'which is linked to the text box to allow the width to be

    'scrolled up and down. The user can change the width of the line

    'in the dialog box in order to change the width of the annotation.

    Dim intLineWidth As Integer

    Dim LineColor As OLE_COLOR

    'Get the line width and color to initialize the dialog box

    intLineWidth = frmMain.ImgEdit1.GetSelectedAnnotationLineWidth

    LineColor = frmMain.ImgEdit1.GetSelectedAnnotationLineColor

    'Set the current line width in the text box to the width of

    'the pixel width of the annotation mark.

    txtWidth.Text = Str(intLineWidth)

    'Set the value of the UpDown control to the current line width.

    UpDown1.Value = intLineWidth

    'Set the width of the sample line in the dialog box.

    Line1.BorderWidth = intLineWidth

    'Set the color of the sample line.

    Line1.BorderColor = LineColor

    'Display the dialog box.

    frmLineWidth.Show

End Sub


GetSelectedAnnotationLineWidth Example - VC++
GetSelectedAnnotationLineWidth Example [image] VC++

This example uses the GetSelectedAnnotationLineWidth method to determine the width of a selected line annotation.  It then displays the line width in a text box control.

It also uses the SetSelectedAnnotationLineWidth method to set the width of a selected line annotation to the value entered in the text box control.

BOOL CLineWidth::OnInitDialog()

{

    CDialog::OnInitDialog();

    int intLineWidth;

    long LineColor;

    // Get the line width and color to initialize the dialog box

    intLineWidth = m_pParent->ImgEdit1.GetSelectedAnnotationLineWidth();

    LineColor = m_pParent->ImgEdit1.GetSelectedAnnotationLineColor();

    // Set the current line width in the text box

    char tLineWidth [5];

    _itoa(intLineWidth,tLineWidth,10);

    m_Edit.SetWindowText(tLineWidth);

    return TRUE;  // return TRUE unless you set the focus to a control

                  // EXCEPTION: OCX Property Pages should return FALSE

}

void CLineWidth::OnOK()

{

    CString tLineWidth;

    int iLineWidth;

    m_Edit.GetWindowText(tLineWidth);

    iLineWidth = atoi(tLineWidth);

    m_pParent->ImgEdit1.SetSelectedAnnotationLineWidth(iLineWidth);

    CDialog::OnOK();

}


GetSelectedAnnotationOcrType Method

See Also	Example-VB	Example-VC++
Returns the type of OCR zone drawn on an image page.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

object.GetSelectedAnnotationOcrType

Arguments

None

Return Value

Integer (enumerated)

Constant	Value	Description
wiOcrTypeText	0	OCR Text zone
wiOcrTypePicture	1	OCR Picture zone
Remarks

The GetSelectedAnnotationOcrType method is valid only at run-time.  An OCR zone must be selected prior to invoking this method.

Applies to the OCR Zones annotation type only.


GetSelectedAnnotationOCRType Example - VB
GetSelectedAnnotationOcrType Example [image] VB

This example uses the GetSelectedAnnotationOcrType method to determine whether a selected OCR Zone annotation is a Picture zone or a Text zone.  It then updates the appropriate option button on the form to indicate the OCR type.

This example also allows the user to change the OCR type of a selected OCR Zone annotation using the option buttons on the form.  It uses the SetSelectedAnnotationOcrType method to set the OCR type.

Private Sub Form_Load()

    'This example determines whether a selected OCR recognition

    'zone is defined as a Picture Zone or a Text Zone and

    'shows a dialog box to allow the user to change the OCR zone type.

    'Form used has 2 option buttons labeled Picture Zone and

    'Text Zone

    Dim OCRType As AnnotationOcrTypeConstants

    'Determine if the selected OCR annotation mark is a Text

    'Zone or a Picture Zone and set the corresponding option

    'button on the form.

    OCRType = frmMain.ImgEdit1.GetSelectedAnnotationOcrType

    If OCRType = wiOcrTypeText Then

      optTextZone.Value = True

    Else

      optPictureZone.Value = True

    End If

   frmOCRType.Show

End Sub

Private Sub optPictureZone_Click()

    'If the user clicks on the Picture Zone option button, the OCR

    'Zone type is changed to a Picture Zone.

    frmMain.ImgEdit1.SetSelectedAnnotationOcrType wiOcrTypePicture

End Sub

Private Sub optTextZone_Click()

    'If the user clicks on the Text Zone option button, the OCR

    'Zone type is changed to a Text Zone.

    frmMain.ImgEdit1.SetSelectedAnnotationOcrType wiOcrTypeText

End Sub


GetSelectedAnnotationOCRType Example - VC++
GetSelectedAnnotationOcrType Example [image] VC++

This example uses the GetSelectedAnnotationOcrType method to determine whether a selected OCR Zone annotation is a Picture zone or a Text zone.  It then updates the appropriate check box to indicate the OCR type.

This example also allows the user to change the OCR type of a selected OCR Zone annotation using a check box.  It uses the SetSelectedAnnotationOcrType method to set the OCR type.

void COCRZones::OnOK()

{

    if(m_TextZone.GetCheck())

      m_pParent->ImgEdit1.SetSelectedAnnotationOcrType(0);

    else

      m_pParent->ImgEdit1.SetSelectedAnnotationOcrType(1);

    CDialog::OnOK();

}

BOOL COCRZones::OnInitDialog()

{

    CDialog::OnInitDialog();

    short OCRType;

    // Determine if the selected OCR annotation mark is a Text

    // Zone or a Picture Zone and set the corresponding option

    // button on the form.

    OCRType = m_pParent->ImgEdit1.GetSelectedAnnotationOcrType();

    if(OCRType == 0)   // wiOcrTypeText

    {

      m_TextZone.SetCheck(1);

      m_PictureZone.SetCheck(0);

    }

    else

    {

      m_TextZone.SetCheck(0);

      m_PictureZone.SetCheck(1);

    }

    return TRUE;  // return TRUE unless you set the focus to a control

                  // EXCEPTION: OCX Property Pages should return FALSE

}


HideAnnotationGroup Method

See Also	Example-VB	Example-VC++
Hides an annotation group.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.

This method does not hide OCR Zone annotations.  To hide OCR Zone annotations, use the OcrZoneVisibility property.

Invoking the HideAnnotationGroup method sets the ImageModified property to True.

Note:  OCR Zone annotations are available with Imaging for Windows Professional Edition only.


HideAnnotationGroup Example - VB
HideAnnotationGroup Example [image] VB

This example lets a user select an annotation group from a list and hide it.  See the example for the GetAnnotationGroup method for instructions on how to list annotation groups.

Private Sub cmdHideGroup_Click()

    Dim strCurGroup As String

    'Determine which group the user selected from the listbox

    strCurGroup = AnnoGroups.List(AnnoGroups.ListIndex)

    Form1.ImgEdit1.HideAnnotationGroup (strCurGroup)

    'Call refresh to repaint with the group hidden

    Form1.ImgEdit1.Refresh

End Sub


HideAnnotationGroup Example - VC++
HideAnnotationGroup Example [image] VC++

This example lets a user select an annotation group from a list and hide it.  See the example for the GetAnnotationGroup method for instructions on how to list annotation groups.

void CFrmGroup::OnHideGroup()

{

    // This would allow a user to select a Group from a list

    // and hide it. See example for GetAnnotationGroup method

    // for how to list annotation groups.

    CString szCurGroup;

    // Get the name of the group the user clicked on in the listbox

    m_GroupList.GetText(m_GroupList.GetCurSel(),szCurGroup);

    if(pParentDlg)

    {

      VARIANT vCurGroup; V_VT(&vCurGroup) = VT_BSTR; V_BSTR(&vCurGroup) =

     szCurGroup.AllocSysString();

      pParentDlg->ImgEdit1.HideAnnotationGroup (vCurGroup);

      // Call refresh to repaint with the group hidden

      pParentDlg->ImgEdit1.Refresh();

    }

}


HideAnnotationToolPalette Method

See Also	Example-VB
Hides the Annotation Tool Palette.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


HideAnnotationToolPalette Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


Invert Method

See Also	Example-VB
Inverts the image, making it appear like a photographic negative.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

object.Invert

Argument

None

Return Value

None

Remarks

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

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

Invoking the Invert method sets the ImageModified property to True.


Invert Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


IsClipboardDataAvailable Method

See Also	Example-VB	Example-VC++
Determines whether image or annotation data is present on the Clipboard.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.IsClipboardDataAvailable

Arguments

None

Return Value

Boolean

Value	Description
True	Image or annotation data is on the clipboard
False	Image or annotation data is not on the clipboard
Remarks

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


IsClipboardDataAvailable Example - VB
IsClipboardDataAvailable Example [image] VB

This example uses the IsClipboardDataAvailable method to determine whether there is data on the Clipboard.  If True, it enables the Paste item on the Edit menu.

Private Sub mnuEdit_Click()

    'This example uses the IsClipboardDataAvailable method

    'to determine whether there is data on the clipboard, and if

    'so, will enable the Paste menu item on the Edit menu.

    Dim blnClipData As Boolean

    blnClipData = ImgEdit1.IsClipboardDataAvailable

    If blnClipData Then

      mnuEditPaste.Enabled = True

    Else

      mnuEditPaste.Enabled = False

    End If

End Sub


IsClipboardDataAvailable Example - VC++
IsClipboardDataAvailable Example [image] VC++

This example uses the IsClipboardDataAvailable method to determine whether there is data on the Clipboard.  If True, it enables the Paste item on the Edit menu.

void CImgEdit2Dlg::OnEnablepaste()

{

    // This example uses the IsClipboardDataAvailable method

    // to determine whether to enable the Paste menu item on

    // the Edit menu.

    int nlnClipData;

    nlnClipData = ImgEdit1.IsClipboardDataAvailable();

    if(nlnClipData)

      AfxMessageBox("Paste Enabled");

    else

      AfxMessageBox("Paste Disabled");

}


LoadAnnotations Method

See Also	Example-VB	Example-VC++
Loads annotations from a file and places them on the image currently being displayed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

object.LoadAnnotations FileName,StartPage,EndPage,Flags

Arguments

Parameter	Data Type	Setting
FileName	String	The Windows filename or UNC (Universal Naming Convention) of the file containing the annotations
StartPage	Long	The starting page in the currently displayed file where the first annotation will be placed
EndPage	Long	The ending page in the currently displayed file where the last annotation will be placed
Flags	Long	Not used currently
Return Value

Long

Value	Description
0	Failed
1	Success
Remarks

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

To support StartPage and EndPage parameter entries that span more than one page, the image file on display must be a multipage image file type (AWD or TIFF).

Notes Regarding the StartPage and EndPage Parameters

If the StartPage parameter is set to 5, the first annotation will be placed on page 5 of the image file currently on display.  If the EndPage parameter is set to 8, the first four groups of annotations will be placed on pages 5, 6, 7 and 8 of the image file currently on display.  If there are more annotations than pages, or more pages than annotations, the LoadAnnotations method will perform the best fit it can.

After invoking the LoadAnnotations method, the Save, SaveAs, or SavePage method must be invoked to save the altered image.  Unless the current image is a TIFF image, annotations must be burned-in to be saved.


LoadAnnotations Example - VB
LoadAnnotations Example [image] VB

This example uses the LoadAnnotations method to load annotations from a file that is separate from the image file.

Private Sub cmdLoadAnnos_Click()

    'Load annotations which were previously saved to a new

    'image file.  You could create a template for OCR recognition

    'zones using these methods.  Used in conjunction with the

    'SaveAnnotations method.

    'Load annotations from file ocrzones.ano onto page 1

    'of the currently displayed image.

    ImgEdit1.LoadAnnotations "D:\ocrzones.ano", 1, 1, 0

End Sub


LoadAnnotations Example - VC++
LoadAnnotations Example [image] VC++

This example uses the LoadAnnotations method to load annotations from a file that is separate from the image file.

void CImgEdit2Dlg::OnLoadannotations()

{

    // Load annotations which were previously saved on to a new

    // image file.  You could create a template for OCR recognition

    // zones using these methods.  Used in conjunction with the

    // SaveAnnotations method.

    // Load annotations from file ocrzones.ano onto page 1

    // of the the currently displayed image.

    ImgEdit1.LoadAnnotations ("c:\\savemark.ano", 1, 1, 0);

}


ManualDeSkew Method

See Also	Example-VB
Displays the Straighten Page dialog box, which permits end users to manually deskew (straighten) the displayed image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

object.ManualDeSkew

Arguments

None

Return Value

None

Remarks

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

The ManualDeSkew method causes the Image Edit control to capture all mouse events.  Therefore, you should not display any dialog boxes or other objects that expect to receive mouse events.

The ManualDeSkew method modifies the displayed image.  The Save, SaveAs, or SavePage method must be invoked to save the modified image.

Invoking the ManualDeSkew method sets the ImageModified property to True.


ManualDeSkew Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


PrintImage Method

See Also	Example-VB	Example-VC++
Prints the image specified in the Image property.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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	Long (enumerated)	The output format to be used: 0 [image] Pixel to pixel 1 [image] Inch to inch 2 [image] Fit to page 3 [image] Best fit
Annotations	Boolean	Whether annotations and OCR zones will be printed with the image: True [image] Annotations and OCR zones will be printed False [image] Annotations and OCR zones will not be printed
Printer	String or	The name of the printer
	Long	The Printer Device Context (HDC) value (C++ only [image] see "Binder Printing").
Driver	String	The name of the printer driver (applicable only when the Printer parameter is specified as a string)
PortNumber	String	The name of the output port (applicable only when the Printer parameter is specified as a string)
The OutputFormat parameter setting of 3 (Best fit) is available with Imaging for Windows Professional Edition V2.0 and V2.5 only.

The Printer Device Context (HDC) Printer parameter setting is available with Imaging for Windows Professional Edition and Imaging for Windows 98 only.

OutputFormat Default Settings By Product Version

Product Version	Default Setting
Imaging for Windows Professional Edition V1.0 and V1.1 Imaging for Windows 98	1 [image] Inch to inch
Imaging for Windows 95 and NT 4.0	2 [image] Fit to page
Imaging for Windows Professional Edition V2.0 and V2.5	3 [image] Best fit
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 name 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.

Binder Printing

This option is intended for use when printing images from Microsoft Binder.

If you use a hardware device context (HDC) value to specify the Printer parameter, you must call StartDoc and StartPage prior to passing the HDC value.  And you must call EndPage and EndDoc after passing the HDC value.

HDC is a C++ interface only; it is generated through C++ calls.  StartDoc and StartPage are C++ calls that must be executed prior to calling the PrintImage method.  EndPage and EndDoc are C++ calls that must be executed after calling the PrintImage method.  Note that if you specify an HDC value for the Printer parameter, you do not have to specify the Driver and PortNumber parameters.


PrintImage Example - VB
PrintImage Example [image] VB

This example prints the image that is currently displayed in the Image Edit control.  It uses the Print Dialog box in the Admin control to obtain parameters for the print-out.

Private Sub cmdPrint_Click()

    On Error GoTo PrintErr

    'Display an image

    ImgEdit1.Image = "D:\image2\4page.tif"

    ImgEdit1.Display

    'Set filename to be printed to the displayed file.

    'If this property is not set the dialog will not display

    ImgAdmin1.Image = ImgEdit1.Image

    ImgAdmin1.ShowPrintDialog

    ImgEdit1.PrintImage ImgAdmin1.PrintStartPage, ImgAdmin1.PrintEndPage,

     ImgAdmin1.PrintOutputFormat, ImgAdmin1.PrintAnnotations

PrintErr:

     'User pressed the cancel button

     Exit Sub

End Sub


PrintImage Example - VC++
PrintImage Example [image] VC++

This example prints the image that is currently displayed in the Image Edit control.  It uses the Print Dialog box in the Admin control to obtain parameters for the print-out.

void CImgEdit1Dlg::OnPrint()

{

    // This example will print the image that is displayed in ImageEdit

    // control. It uses the Print Dialog box in the Admin control to

    // obtain parameters for the print output.

    // Display an image

    ImgEdit1.SetImage("D:\\image2\\4page.tif");

    ImgEdit1.Display();

    // Set filename to be printed to the displayed file.

    // If this property is not set the dialog will not display

    ImgAdmin1.SetImage(ImgEdit1.GetImage());

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowPrintDialog (vhWnd);

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.PrintImage(evt, evt, evt, evt, evt, evt, evt);

}


Redo Method

See Also	Example-VB
Redoes the last imaging operation that was undone by the Undo method.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

object.Redo [Option]

Argument

Parameter	Data Type	Setting
Option	Long	0 (default)
Return Value

None

Remarks

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

The Redo method requires the successful completion of an undo operation (using the Undo method).  Imaging deletes the redo information when the next imaging operation is performed.  If Redo is called before anything is undone, an error is generated. Check the StatusCode property for the error.

The Redo method modifies the displayed image.  The Save, SaveAs, or SavePage method must be invoked to save the modified image.

Invoking the Redo method sets the ImageModified property to True.


Redo Example [image] VB

This example.

End Sub


RemoveAllOCRMarks Method

See Also	Example-VB
Removes all OCR zones from all image pages in the displayed image document.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

object.RemoveAllOCRMarks

Arguments

None

Return Value

None

Remarks

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

The RemoveAllOCRMarks method saves the displayed image to disk.  As such, you cannot use the Undo method to undo the operation performed.

Invoking the RemoveAllOCRMarks method sets the ImageModified property to True.


RemoveAllOCRMarks Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


Refresh Method

See Also	Example-VB	Example-VC++
Repaints the contents of the Image Edit control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


Refresh Example - VB
Refresh Example [image] VB

This example shows how to let a user select an annotation group from a list, hide it, and then refresh the Image Edit control.  See the example for the GetAnnotationGroup method for instructions on how to list annotation groups.

Private Sub cmdHideGroup_Click()

    Dim strCurGroup As String

    'Determine which group the user selected from the listbox

    strCurGroup = AnnoGroups.List(AnnoGroups.ListIndex)

    Form1.ImgEdit1.HideAnnotationGroup (strCurGroup)

    'Call refresh to repaint with the group hidden

    Form1.ImgEdit1.Refresh

End Sub


Refresh Example - VC++
Refresh Example [image] VC++

This example shows how to let a user select an annotation group from a list, hide it, and then refresh the Image Edit control.  See the example for the GetAnnotationGroup method for instructions on how to list annotation groups.

void CFrmGroup::OnHideGroup()

{

    // This would allow a user to select a Group from a list

    // and hide it. See example for GetAnnotationGroup method

    // for how to list annotation groups.

    CString szCurGroup;

    // Get the name of the group the user clicked on in the listbox

    m_GroupList.GetText(m_GroupList.GetCurSel(),szCurGroup);

    if(pParentDlg)

    {

      VARIANT vCurGroup; V_VT(&vCurGroup) = VT_BSTR; V_BSTR(&vCurGroup) =

       szCurGroup.AllocSysString();

      pParentDlg->ImgEdit1.HideAnnotationGroup (vCurGroup);

      // Call refresh to repaint with the group hidden

      pParentDlg->ImgEdit1.Refresh();

    }

}


RotateAll Method

See Also	Example-VB	Example-VC++
Rotates all pages within the displayed image document to the degree and in the direction specified.  Then saves the image document.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Edit control

Syntax

object.RotateAll [Degrees]

Argument

Parameter	Data Type	Setting
Degrees	Long	Amount to rotate the displayed image in tenths of a degree (for example, enter 450 to rotate the image 45 degrees) Enter positive values for counter-clockwise rotation, negative values for clockwise rotation
Return Value

None

Remarks

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

This method saves the image document to disk.  As such, you cannot use the Undo method to undo the rotation performed.

This method rotates annotations only when 900, 1800, or 2700 tenths of a degree (90, 180, or 270 degrees) is specified (positive or negative).


RotateAll Example - VB
RotateAll Example [image] VB

This example shows several ways to orient an image, and then redisplay it.

Private Sub cmdRotate_Click()

    ImgEdit1.Rotate True 'rotate all pages

    ImgEdit1.Rotate False 'rotate current page

    'Autorefresh must be set to true or must call

    'Refresh after these methods.

    ImgEdit1.AutoRefresh = True

    ImgEdit1.RotateLeft 'defaults to 90 degrees

    ImgEdit1.RotateRight 45 'optionally can specify degrees

    ImgEdit1.RotateAll 900  'rotate all pages 90 degrees left

    ImgEdit1.Flip '180 degrees

    'You must save the image to maintain orientation.

End Sub


RotateAll Example - VC++
RotateAll Example [image] VC++

This example shows several ways to orient an image, and then redisplay it.

void CImgEdit1Dlg::OnRotate()

{

    // An example of some of the different ways an image could

    // be oriented.

    // This method displays a dialog box which allows

    // user to specify rotation by degrees.  Repaints

    // the screen automatically.  Rotate all writes the

    // file to disk.

    ImgEdit1.Rotate(TRUE); // rotate all pages

    ImgEdit1.Rotate(FALSE); // rotate current page

    // Autorefresh must be set to true or must call

    // Refresh after these methods.

    ImgEdit1.SetAutoRefresh(TRUE);

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.RotateLeft(evt); // defaults to 90 degrees

    VARIANT vRotateAmt; V_VT(&vRotateAmt) = VT_I4; V_I4(&vRotateAmt) = 45;

    ImgEdit1.RotateRight(vRotateAmt); // optionally can specify degrees

    VARIANT vRotateAllAmt; V_VT(&vRotateAllAmt) = VT_I4; V_I4(&vRotateAllAmt) = 900;

    ImgEdit1.RotateAll(vRotateAllAmt); //rotate all pages 90 degrees left

    ImgEdit1.Flip(); // 180 degrees

    // You must save the image to maintain orientation.

}


Rotate Method

See Also	Example-VB	Example-VC++
Displays a dialog box that lets end users rotate one or all of the pages in a displayed image document.  End users can specify the degree of rotation applied as well as the direction.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

object.Rotate Option

Arguments

Parameter	Data Type	Setting
Option	Boolean	True [image] Displays the Rotate All Pages dialog box; rotates all pages in the displayed image document as directed by the user False [image] Displays the Rotate Page dialog box; rotates the displayed image page as directed by the user
Return Value

None

Remarks

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

This method rotates annotations only when 90, 180, or 270 degrees is specified.

When set to True, the Rotate method saves the image document to disk.  As such, you cannot use the Undo method to undo the rotation performed.

When set to False, the Rotate method modifies the displayed image, but does not save it. In this case, you can use the Undo method to undo the rotation performed. The Save, SaveAs, or SavePage method must be invoked to save the modified image.

Invoking the Rotate method sets the ImageModified property to True.


Rotate Example - VB
Rotate Example [image] VB

This example shows several ways to orient an image, and then redisplay it.

Private Sub cmdRotate_Click()

    ImgEdit1.Rotate True 'rotate all pages

    ImgEdit1.Rotate False 'rotate current page

    'Autorefresh must be set to true or must call

    'Refresh after these methods.

    ImgEdit1.AutoRefresh = True

    ImgEdit1.RotateLeft 'defaults to 90 degrees

    ImgEdit1.RotateRight 45 'optionally can specify degrees

    ImgEdit1.Flip '180 degrees

    'You must save the image to maintain orientation.

End Sub


Rotate Example - VC++
Rotate Example [image] VC++

This example shows several ways to orient an image, and then redisplay it.

void CImgEdit1Dlg::OnRotate()

{

    // An example of some of the different ways an image could

    // be oriented.

    // This method displays a dialog box which allows

    // user to specify rotation by degrees.  Repaints

    // the screen automatically.  Rotate all writes the

    // file to disk.

    ImgEdit1.Rotate(TRUE); // rotate all pages

    ImgEdit1.Rotate(FALSE); // rotate current page

    // Autorefresh must be set to true or must call

    // Refresh after these methods.

    ImgEdit1.SetAutoRefresh(TRUE);

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.RotateLeft(evt); // defaults to 90 degrees

    VARIANT vRotateAmt; V_VT(&vRotateAmt) = VT_I4; V_I4(&vRotateAmt) = 45;

    ImgEdit1.RotateRight(vRotateAmt); // optionally can specify degrees

    ImgEdit1.Flip(); // 180 degrees

    // You must save the image to maintain orientation.

}


RotateLeft Method

See Also	Example-VB	Example-VC++
Rotates the displayed image 90 degrees to the left, or to the degree specified.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.RotateLeft [Degrees]

Argument

Parameter	Data Type	Setting
Degrees	Long	Amount to rotate the displayed image in tenths of a degree (for example, enter 450 to rotate the image 45 degrees)
Notes:  The Degrees argument is available with Imaging for Windows Professional Edition (V1.0, V1.1, V2.0, and V2.5).

It is also available with Imaging for Windows 98, but accepts only the following values:  900, 1800, and 2700 tenths of a degree.

Return Value

None

Remarks

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

This method rotates annotations only when 900, 1800, or 2700 tenths of a degree (90, 180, or 270 degrees) is specified.

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

Invoking the RotateLeft method sets the ImageModified property to True.


RotateLeft Example - VB
RotateLeft Example [image] VB

This example shows several ways to orient an image, and then redisplay it.

Private Sub cmdRotate_Click()

    ImgEdit1.Rotate True 'rotate all pages

    ImgEdit1.Rotate False 'rotate current page

    'Autorefresh must be set to true or must call

    'Refresh after these methods.

    ImgEdit1.AutoRefresh = True

    ImgEdit1.RotateLeft 'defaults to 90 degrees

    ImgEdit1.RotateRight 45 'optionally can specify degrees

    ImgEdit1.Flip '180 degrees

    'You must save the image to maintain orientation.

End Sub


RotateLeft Example - VC++
RotateLeft Example [image] VC++

This example shows several ways to orient an image, and then redisplay it.

void CImgEdit1Dlg::OnRotate()

{

    // An example of some of the different ways an image could

    // be oriented.

    // This method displays a dialog box which allows

    // user to specify rotation by degrees.  Repaints

    // the screen automatically.  Rotate all writes the

    // file to disk.

    ImgEdit1.Rotate(TRUE); // rotate all pages

    ImgEdit1.Rotate(FALSE); // rotate current page

    // Autorefresh must be set to true or must call

    // Refresh after these methods.

    ImgEdit1.SetAutoRefresh(TRUE);

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.RotateLeft(evt); // defaults to 90 degrees

    VARIANT vRotateAmt; V_VT(&vRotateAmt) = VT_I4; V_I4(&vRotateAmt) = 45;

    ImgEdit1.RotateRight(vRotateAmt); // optionally can specify degrees

    ImgEdit1.Flip(); // 180 degrees

    // You must save the image to maintain orientation.

}


RotateRight Method

See Also	Example-VB	Example-VC++
Rotates the displayed image 90 degrees to the right, or to the degree specified.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.RotateRight [Degrees]

Argument

Parameter	Data Type	Setting
Degrees	Long	Amount to rotate the displayed image in tenths of a degree (for example, enter 450 to rotate the image 45 degrees)
Notes:  The Degrees argument is available with Imaging for Windows Professional Edition (V1.0, V1.1, V2.0, and V2.5).

It is also available with Imaging for Windows 98, but accepts only the following values:  900, 1800, and 2700 tenths of a degree.

Return Value

None

Remarks

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

This method rotates annotations only when 900, 1800, or 2700 tenths of a degree (90, 180, or 270 degrees) is specified.

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

Invoking the RotateRight method sets the ImageModified property to True.


RotateRight Example - VB
RotateRight Example [image] VB

This example shows several ways to orient an image, and then redisplay it.

Private Sub cmdRotate_Click()

    ImgEdit1.Rotate True 'rotate all pages

    ImgEdit1.Rotate False 'rotate current page

    'Autorefresh must be set to true or must call

    'Refresh after these methods.

    ImgEdit1.AutoRefresh = True

    ImgEdit1.RotateLeft 'defaults to 90 degrees

    ImgEdit1.RotateRight 45 'optionally can specify degrees

    ImgEdit1.Flip '180 degrees

    'You must save the image to maintain orientation.

End Sub


RotateRight Example - VC++
RotateRight Example [image] VC++

This example shows several ways to orient an image, and then redisplay it.

void CImgEdit1Dlg::OnRotate()

{

    // An example of some of the different ways an image could

    // be oriented.

    // This method displays a dialog box which allows

    // user to specify rotation by degrees.  Repaints

    // the screen automatically.  Rotate all writes the

    // file to disk.

    ImgEdit1.Rotate(TRUE); // rotate all pages

    ImgEdit1.Rotate(FALSE); // rotate current page

    // Autorefresh must be set to true or must call

    // Refresh after these methods.

    ImgEdit1.SetAutoRefresh(TRUE);

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.RotateLeft(evt); // defaults to 90 degrees

    VARIANT vRotateAmt; V_VT(&vRotateAmt) = VT_I4; V_I4(&vRotateAmt) = 45;

    ImgEdit1.RotateRight(vRotateAmt); // optionally can specify degrees

    ImgEdit1.Flip(); // 180 degrees

    // You must save the image to maintain orientation.

}


Save Method

See Also	Example-VB	Example-VC++
Saves the displayed image (page) to the original path and file.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 [image] The image is saved using the current scale percentage value, as specified in the Zoom property False [image] 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 is 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.

Invoking the Save method sets the ImageModified property to False.

Note:  The Save method does not function when a URL has been entered into the Image property.


Save Example - VB
Save Example [image] VB

This example uses the ImageModified property to see if changes were made to an existing image before permitting the user to open another.  If the value of the ImageModified property is True, the code prompts the user to save the image before opening the next one.

If the user answers the prompt with Yes, this example uses the Save method to save the existing image.

Private Sub ImgEdit1_Close()

    'This code could be used at the time a user attempts to open

    'a new file or clear a previously displayed image in order

    'to prompt for changes to be saved if the image has been modified.

    Dim intSaveImg As Integer

    If ImgEdit1.ImageModified = True Then

      intSaveImg = MsgBox("Do you want to save changes?", vbYesNoCancel,

       "Image has been modified")

      Select Case intSaveImg

        Case vbYes

          'Save the changes

          ImgEdit1.Save

          'Drop down to the Open file code

        Case vbNo

          'Don't save file, just drop down to the Open

          'file code

        Case vbCancel

          'User pressed cancel

          'Don't open a file, don't save changes

          Exit Sub

      End Select

    End If

    'Open a new file at this point

End Sub


Save Example - VC++
Save Example [image] VC++

This example uses the ImageModified property to see if changes were made to an existing image before permitting the user to open another.  If the value of the ImageModified property is True, the code prompts the user to save the image before opening the next one.

If the user answers the prompt with Yes, this example uses the Save method to save the existing image.

void CImgEdit1Dlg::OnCloseEditctrl1()

{

    // This code could be used at the time a user attempts to open

    // a new file or clear a previously displayed image in order

    // to prompt for changes to be saved if the image has been modified.

    int iSaveImg;

    if(ImgEdit1.GetImageModified())

    {

      iSaveImg = AfxMessageBox("Do you want to save changes?", MB_YESNOCANCEL);

      switch (iSaveImg)

      {

        case IDYES:

          // Save the changes

          VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default for save at zoom

          ImgEdit1.Save(evt);

          break;

          // Drop down to the Open file code

        case IDNO:

          // Don't save file, just drop down to the Open

          // file code

          break;

        case IDCANCEL:

          // User pressed cancel

          // Don't open a file, don't save changes

          return;

        }

    }

    // Open a new file at this point

}


SaveAnnotations Method

See Also	Example-VB	Example-VC++
Saves the annotations on the image currently being displayed to a file.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

object.SaveAnnotations FileName,StartPage,EndPage,Flags

Arguments

Parameter	Data Type	Setting
FileName	String	The fully-qualified name of the file the annotations will be saved to
StartPage	Long	The starting page in the currently displayed file containing the annotations to be saved
EndPage	Long	The ending page in the currently displayed file containing the annotations to be saved
Flags	Long	KEEP_ANNOTATIONS [image] Retain the annotations in the currently displayed file REMOVE_ANNOTATIONS [image] Remove the annotations from the currently displayed file that have been saved to the file specified in the FileName parameter
Return Value

Long

Value	Description
0	Failed
1	Success
Remarks

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

To support StartPage and EndPage parameter entries that span more than one page, the image file on display must be a multipage image file type (AWD or TIFF).

Note:  The SaveAnnotations method does not function when a URL has been entered into the Image property.

Notes Regarding the StartPage and EndPage Parameters

If the StartPage and EndPage parameters are set to the first and last pages of the source image file (currently on display), the annotations in the source file will be saved to the same page numbers in the destination file (as specified in the FileName parameter). For example, if annotations exist on pages 1, 2, 4, and 7 in the source file, they appear on pages 1, 2, 4, and 7 in the destination file.

If the StartPage parameter is set to 5 and the EndPage parameter is set to 8, the annotations on pages 5, 6, 7 and 8 of the source image file will be saved to the destination file specified in the FileName parameter.

The SaveAnnotations method does not retain the page numbers in the source image file.  Annotations are saved to the destination file corresponding to page numbers that begin with 1.  Continuing the previous example, annotations that appear on pages 5, 6, 7, and 8 in the source file are saved to pages 1, 2, 3, and 4 in the destination file.  If there are no annotations on a page in the source file, a blank page is retained in the destination file.

If there are more annotations than pages, or more pages than annotations, the SaveAnnotations method will perform the best fit it can.


SaveAnnotations Example - VB
SaveAnnotations Example [image] VB

This example uses the SaveAnnotations method to save annotations to a file that is separate from the image file.

Private Sub cmdSaveAnnos_Click()

    'This example enables annotations to be saved to

    'a file and stored separately from the image file.

    'It is useful if you want to annotate images but not modify

    'the original file (for legal purposes, or if the image

    'is on optical disk). Use in conjunction with the LoadAnnotations method.

    'Save the annotation marks on page 1 of the displayed

    'file to a new file and remove them from the existing file.

    ImgEdit1.SaveAnnotations "D:\template\savemark.ano", 1, 1, REMOVE_ANNOTATIONS

End Sub


SaveAnnotations Example - VC++
SaveAnnotations Example [image] VC++

This example uses the SaveAnnotations method to save annotations to a file that is separate from the image file.

void CImgEdit2Dlg::OnSaveanotation()

{

    // This example would enable annotations to be saved to

    // a file and stored separately from the image file.

    // Useful if you want to annotate images but not modify

    // the original file (ex. for legal purposes, or if the image

    // is on optical disk). Use in conjunction with LoadAnnotations.

    // Save the annotation marks on page 1 of the displayed

    // file to a new file and remove them from the existing file.

    // annotation stored separately defines

    #define         KEEP_ANNOTATIONS     0

    #define         REMOVE_ANNOTATIONS   1

    ImgEdit1.SaveAnnotations ("c:\\savemark.ano", 1, 1,  REMOVE_ANNOTATIONS);

}


SaveAs Method

See Also	Example-VB	Example-VC++
Saves the displayed image document file or managed image document using the fully-qualified name specified.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

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

Arguments

Parameter	Data Type	Setting
Image	String	The fully-qualified name of the image document 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 [image] The image is being saved using the current scale percentage value False [image] The image is being saved using the original scale percentage value
Return Value

None

Remarks

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

The SaveAs method saves the image using the name specified in the Image parameter.  If the image document 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 payroll98.tif, the image is saved as payroll98.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, WIFF, 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.  Note that this restriction does not apply to Imaging 1x documents.  The entire document is saved in the original file type [image] except for the displayed image, which is converted.

For the TIFF file type, annotations are saved as annotation data separate from the image 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.

In addition, document properties are saved within TIFF images only.

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, and the SaveAs method is saving to a local drive or file server, the method throws an Invalid File Format error.  If the SaveAs method is saving to a document server, it saves the image 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 [image] TIFF	PageType setting of the displayed image
2 [image] AWD	1 [image] Black-and-white
3 [image] 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
2 [image] AWD	1 [image] Black-and-white	1 [image] No compression
3 [image] BMP	1,5,7 [image] All supported PageTypes	1 [image] No compression
1 [image] TIFF	1 [image] Black-and-white	2 [image] Group3(1D)
1 [image] TIFF	2 [image] Gray4	1 [image] No compression
1 [image] TIFF	3 [image] Gray8	1 [image] No compression
1 [image] TIFF	4 [image] Palettized4	1 [image] No compression
1 [image] TIFF	5 [image] Palettized8	1 [image] No compression
1 [image] TIFF	6 [image] RGB24	1 [image] No compression
Note:  AWD is not available with Imaging for Windows NT 4.0.

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 [image] No compression	0 [image] No compression
2 [image] Group3(1D)	8 [image] Compressed LTR, 16 [image] Expand LTR, 1 [image] EOL, and 4 [image] Prefixed EOL
3 [image] Group3(Modified Huffman)	8 [image] Compressed LTR and 16 [image] Expand LTR
4 [image] PackBits	16 [image] Expand LTR
5 [image] Group4(2D)	2 [image] Packed Lines, 8 [image] Compressed LTR, and 16 [image] Expand LTR
6 [image] JPEG	1024 [image] Medium Resolution/Medium Quality
9 [image] LZW	0 [image] No compression
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 [image] Compressed LTR,
16 [image] Expand LTR,
1 [image] EOL, and
4 [image] Prefixed EOL

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

Invoking the SaveAs method sets the ImageModified property to False.

Special Note Regarding Imaging 1.x/Enterprise Imaging Documents and Files

If you want your program to process Imaging 1.x managed documents or files, you must include an Image Admin control in your project and set its FileStgLoc1x property to the appropriate value.

When saving existing Imaging 1.x managed documents as new Imaging 1.x managed documents, you can use the ForceFileLinking1x property of the Image Admin control to determine whether the SaveAs method creates copies of the individual image files in the file repository, or creates links to them.  When creating copies of the individual image files, you can use the FileStgLoc1x property of the Image Admin control to determine the location of the file repository.

You cannot save image documents to Enterprise Imaging servers.

Imaging 1.x and Enterprise Imaging server access is available with Imaging for Windows Professional Edition V1.1, V2.0, and V2.5 only.

Special Note Regarding URLs

The SaveAs method does not function when a URL has been entered into the Image property.


SaveAs Example - VB
SaveAs Example [image] VB

Example 1

This example shows how to convert an image, burn in annotation marks, and save the image under a new file name.

Private Sub cmdBurnIn_Click()

    Const ALL_MARKS = 0

    Const WINDOWS_DEFAULT = 2

    'If you wish to save color annotations on a black

    'and white image you must first convert the

    'image to a non black and white type

    ImgEdit1.ConvertPageType wiPageTypePal8, True

    'Save all marks in their original colors

    ImgEdit1.BurnInAnnotations ALL_MARKS, WINDOWS_DEFAULT

    'Color Burn in always converts to RGB24.  To save disk space,

    'save the image as an 8 bit palettized image

    ImgEdit1.SaveAs "C:\imgsave\annotate.tif", wiFileTypeTIFF, wiPageTypePal8

End Sub

Example 2

This example shows the options that are available for file linking/copying when performing a SaveAs of an Imaging 1x server document.

Private Sub cmdLink_Click()

    'An example of the options available for file linking/

    'copying when performing a SaveAs of a 1x server document.

    'These functions require both ImgEdit and Admin controls

    'to be utilized.

'Option 1

    'Request files associated with the document being

    'saved be copied to new files in a location to be

    'specified.  This is the default and in most cases

    'the preferred method to use.

    ImgAdmin1.ForceFileLinking1x = False

    'To specify location of the new files, use the Admin

    'control FileStgLoc1x property.

     ImgAdmin1.FileStgLoc1x = "Image://srvrname\new_images:"

    'Displayed 1x document is saved to a new document name

    'Associated image files will be copied to new randomly

    'generated file names in directory specified.

     ImgEdit1.SaveAs "Image://srvrname\doc_db:\CABNAME\DRAWER\FOLDER\NEW DOC"

'Option 2

    'Request files associated with the document being

    'saved reference the original files.  This results in

    'multiple documents accessing the same files -- could

    'be useful to prevent rewrites of optical disk files.

    ImgAdmin1.ForceFileLinking1x = True

    'Displayed 1x document is saved to a new document name

    'but original image files are linked to the new document.

    ImgEdit1.SaveAs "Image://srvrname\doc_db:\CABNAME\DRAWER\FOLDER\NEW DOC"

End Sub


SaveAs Example -  VC++
SaveAs Example [image] VC++

Example 1

This example shows how to convert an image, burn in annotation marks, and save the image under a new file name.

void CImgEdit1Dlg::OnBurnin()

{

    // Converts an image, burns in annotation marks and saves

    // it under a new file name

    #define ALL_MARKS  0

    #define WINDOWS_DEFAULT  2

    // If you wish to save color annotations on a black

    // and white image you must first convert the

    // image to a non black and white type

    VARIANT vRepaint; V_VT(&vRepaint) = VT_BOOL; V_BOOL(&vRepaint) = TRUE;

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.ConvertPageType(5,vRepaint);  // wiPageTypePal8, True

    // Save all marks in their original colors

    ImgEdit1.BurnInAnnotations(ALL_MARKS, WINDOWS_DEFAULT,evt);

    // Color Burn in always converts to RGB24.  To save disk space,

    // save the image as an 8 bit palettized image

    VARIANT vFileType; V_VT(&vFileType) = VT_I2; // set FileType for saveas

    VARIANT vPageType; V_VT(&vPageType) = VT_I2; // set to PageType for saveas

    V_I2(&vFileType) = 1;

    V_I2(&vPageType) = 5;

    // wiFileTypeTIFF, wiPageTypePal8

    ImgEdit1.SaveAs("C:\\imgsave\\annotate.tif",vFileType,vPageType,evt,evt,evt);

}

Example 2

This example shows the options that are available for file linking/copying when performing a SaveAs of an Imaging 1x server document.

void CImgEdit2Dlg::OnFilelinking()

{

    // An example of the options available for file linking/

    // copying when performing a SaveAs of a 1x server document.

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default for saveas

// Option 1

    // Request files associated with the document being

    // saved be copied to new files in a location to be

    // specified.  This is the default and in most cases

    // the preferred method to use.

    ImgAdmin1.SetForceFileLinking1x(FALSE);

    // To specify location of the new files, use the Admin

    // control FileStgLoc1x property

     ImgAdmin1.SetFileStgLoc1x("Image://servername\\new_images:");

    // Displayed 1x document is saved to a new document name

    // Associated image files will be copied to new randomly

    // generated file names in directory specified

    ImgEdit1.SaveAs ("Image://servername\\doc_db:\\CABNAME\\DRAWER\\FOLDER\\NEW DOC",

     evt,evt,evt,evt,evt);

// Option 2

    // Request files associated with the document being

    // saved reference the original files.  This results in

    // multiple documents accessing the same files -- could

    // be useful to prevent rewrites of optical disk files.

    ImgAdmin1.SetForceFileLinking1x(TRUE);

    // Displayed 1x document is saved to a new document name

    // but original image files are linked to the new document.

    ImgEdit1.SaveAs ("Image://servername\\doc_db:\\CABNAME\\DRAWER\\FOLDER\\NEW DOC",

     evt,evt,evt,evt,evt);

}


SavePage Method

See Also	Example-VB	Example-VC++
Saves the displayed image page or the entire image document using the fully-qualified name specified.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

object.SavePage Image[,FileType,PageType,CompressionType,CompressionInfo,SaveAtZoom,PageNumber]

Arguments

Parameter	Data Type	Setting
Image	String	The fully-qualified name of the image document 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 [image] The image is being saved using the current scale percentage value False [image] The image is being saved using the original scale percentage value
PageNumber	Long	1 or greater [image] Saves the displayed image page to the name and PageNumber specified -1 [image] Saves all pages in the displayed image document to the name specified.  The default is -1. See "Special Note Regarding the PageNumber Parameter" for more information.
Return Value

None

Special Note Regarding the PageNumber Parameter

The following table describes what occurs when the SavePage method is used to save image page(s) to an existing image document.

PageNumber Value Entered	Image Page(s) to be Saved by the SavePage Method	Action Performed by the SavePage Method on the Existing Image Document
1 or greater	Image page currently being displayed	Overwrites the image page that corresponds to the value entered in the PageNumber parameter [image] provided the image page exists.  If the image page does not exist, appends the displayed image page to the end of the existing image document
-1	All image pages in the image document currently being displayed	Overwrites the entire image document; no existing image pages are retained
Remarks

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

You see an error message if you enter a PageNumber value of 0, or a PageNumber value less than -1.  You also see an error message if you enter a PageNumber value greater than one when saving to a new image document.

Upon successful completion of the SavePage 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 SavePage method is invoked with its Image parameter set to payroll98.tif, the image is saved as payroll98.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, WIFF, 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.  Note that this restriction does not apply to Imaging 1x documents.  The entire document is saved in the original file type [image] except for the displayed image, which is converted.

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

In addition, document properties are saved within TIFF images only.

If the FileType parameter is not entered, the SavePage method uses the original FileType setting of the image as a default.  If the original FileType setting cannot be determined or is read-only, and the SavePage method is saving to a local drive or file server, the method throws an Invalid File Format error.  If the SavePage method is saving to a document server, it saves the image as a TIFF file.

If the PageType and FileType parameters are not entered, the SavePage method uses the original PageType setting of the image as a default.  However, if a FileType is entered, the SavePage 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 [image] TIFF	PageType setting of the displayed image
2 [image] AWD	1 [image] Black-and-white
3 [image] BMP	PageType setting of the displayed image
If the CompressionType parameter is Group3(2D), the SavePage method saves the image using the Group4(2D) compression type.  If the CompressionType parameter is LZW, the SavePage method saves the image using no compression.

If the CompressionType parameter is not entered, the SavePage 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
2 [image] AWD	1 [image] Black-and-white	1 [image] No compression
3 [image] BMP	1,5,7 [image] All supported PageTypes	1 [image] No compression
1 [image] TIFF	1 [image] Black-and-white	2 [image] Group3(1D)
1 [image] TIFF	2 [image] Gray4	1 [image] No compression
1 [image] TIFF	3 [image] Gray8	1 [image] No compression
1 [image] TIFF	4 [image] Palettized4	1 [image] No compression
1 [image] TIFF	5 [image] Palettized8	1 [image] No compression
1 [image] TIFF	6 [image] RGB24	1 [image] No compression
To use a PageType setting of 4 (Palettized4), the displayed image must already be a Palettized4 image.

Note:  AWD is not available with Imaging for Windows NT 4.0.

If the CompressionInfo parameter is not entered, the SavePage 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 [image] No compression	0 [image] No compression
2 [image] Group3(1D)	8 [image] Compressed LTR, 16 [image] Expand LTR, 1 [image] EOL, and 4 [image] Prefixed EOL
3 [image] Group3(Modified Huffman)	8 [image] Compressed LTR and 16 [image] Expand LTR
4 [image] PackBits	16 [image] Expand LTR
5 [image] Group4(2D)	2 [image] Packed Lines, 8 [image] Compressed LTR, and 16 [image] Expand LTR
6 [image] JPEG	1024 [image] Medium Resolution/Medium Quality
9 [image] LZW	0 [image] No compression
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 [image] Compressed LTR,
16 [image] Expand LTR,
1 [image] EOL, and
4 [image] Prefixed EOL

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

Invoking the SavePage method sets the ImageModified property to False.

Special Note Regarding Imaging 1.x/Enterprise Imaging Documents and Files

You cannot save image documents to Enterprise Imaging Servers.

Imaging 1.x and Enterprise Imaging server access is available with Imaging for Windows Professional Edition V1.1, V2.0, and V2.5 only.

Special Note Regarding URLs

The SavePage method does not function when a URL has been entered into the Image property.


SavePage Example -VB
SavePage Example [image] VB

This example shows how to save a page to a new file of the same file type and page type.  It also shows how to save the displayed page as a new, uncompressed BMP file at the displayed zoom factor.

Private Sub cmdSavePage_Click()

    'Save only the currently displayed page to a new file.  Keep file

    'type and page type the same as they were originally.  Use defaults

    'for file compression.  Save at original zoom factor.

    ImgEdit1.SavePage "D:\image2\savepage.tif", , , , , False, 1

    'Save the currently displayed page to a new uncompressed color BMP file.

    'Save at the displayed zoom factor.

    ImgEdit1.SavePage "D:\image2\saved.bmp", wiFileTypeBMP, wiPageTypeBGR24, 1, 0, True, 1

End Sub


SavePage Example - VC++
SavePage Example [image] VC++

This example shows how to save a page to a new file of the same file type and page type.  It also shows how to save the displayed page as a new, uncompressed BMP file at the displayed zoom factor.

void CImgEdit1Dlg::OnSavePage()

{

    // Some examples of the SavePage method

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default for saveas

    VARIANT vFileType; V_VT(&vFileType) = VT_I2; // set FileType for saveas

    VARIANT vPageType; V_VT(&vPageType) = VT_I2; // set PageType for saveas

    VARIANT vCompresionType; V_VT(&vCompresionType) = VT_I2; // set CompressionType

                                                             // for saveas

    VARIANT vCompresionInfo; V_VT(&vCompresionInfo) = VT_I2; // set CompressionInfo

                                                             // for saveas

    VARIANT vSaveAtZoom; V_VT(&vSaveAtZoom) = VT_BOOL; // set SaveAtZoom

                                                       // for saveas

    VARIANT vPageNumber; V_VT(&vPageNumber) = VT_I2; // set CompressionInfo

                                                     // for saveas

    // Save only the currently displayed page to a new file.  Keep file

    // type and page type the same as they were originally.  Use defaults

    // for file compression.  Save at original zoom factor.

    V_BOOL(&vSaveAtZoom) = FALSE;

    V_I2(&vPageNumber) = 1;

    ImgEdit1.SavePage ("D:\\image2\\savepage.tif", evt ,evt ,evt ,evt ,

     vSaveAtZoom, vPageNumber);

    // Save the currently displayed page to a new uncompressed color BMP file.

    // Save at the displayed zoom factor.

    V_I2(&vFileType) = 1;

    V_I2(&vPageType) = 1;

    V_I2(&vCompresionType) = 1;

    V_I2(&vCompresionInfo) = 0;

    V_BOOL(&vSaveAtZoom) = TRUE;

    V_I2(&vPageNumber) = 1;

    // wiFileTypeBMP, wiPageTypeBGR24, 1, 0, True, 1

    ImgEdit1.SavePage ("D:\\image2\\saved.bmp",vFileType,vPageType,vCompresionType,

     vCompresionInfo,vSaveAtZoom, vPageNumber);

}


ScrollImage Method

See Also	Example-VB
Scrolls a displayed image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 [image] Down 1 [image] Up 2 [image] Right 3 [image] 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.


ScrollImage Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


SelectAnnotationGroup Method

See Also	Example-VB
Selects all annotation marks within a specific group on the image page.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.

Selecting annotations enables many methods to perform functions on them.


SelectAnnotationGroup Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


SelectFirstOcrZone Method

See Also	Example-VB
Selects the first OCR zone on the displayed image page.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

object.SelectFirstOcrZone ZoneType

Argument

Parameter	Data Type	Setting
ZoneType	Integer (enumerated)	0 [image] Select the first OCR Text zone 1 [image] Select the first OCR Picture zone 2 [image] Select the first OCR Text or Picture zone
Return Value

Long (NextInfo, which is used by the SelectNextOcrZone method)

Remarks

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

This method works in conjunction with the SelectNextOcrZone method.


SelectFirstOcrZone Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


SelectNextOcrZone Method

See Also	Example-VB
Selects the next OCR zone on the displayed image page.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

object.SelectNextOcrZone(NextInfo)

Argument

Parameter	Data Type	Setting
NextInfo	Long	Next information from the last invocation of the SelectFirstOcrZone or SelectNextOcrZone method
Return Value

Long (NextInfo, which is used by the next invocation of this method)

Remarks

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


SelectNextOcrZone Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


SelectTool Method

See Also	Example-VB	Example-VC++
Selects an annotation tool from the Annotation Tool Palette.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 11 12 13	No Tool Selection Freehand Line Highlighter Straight Line Hollow Rectangle Filled Rectangle Text Attach-a-Note Text From File Text Stamp Hyperlink OCR Zones Initials
Note:  Hyperlink and OCR Zone ToolID settings are available with Imaging for Windows Professional Edition only.

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.


SelectTool Example - VB
SelectTool Example [image] VB

This example uses the SelectTool method to select the Text From File annotation type. It then uses the content of the AnnotationTextFile property and the Draw method to overlay text from a text file onto an image.

Private Sub cmdSelectTool_Click()

    'Uses the SelectTool method to select the Text from file

    'annotation type.  Overlays text from a text file onto an

    'image.

    'If the annotation tool palette is utilized within an

    'application, SelectTool should be used rather than

    'setting the AnnotationType property for drawing marks

    'programatically.

    ImgEdit1.SelectTool 9 'Text from file

    ImgEdit1.AnnotationTextFile = "C:\text\disclaim.txt"

    ImgEdit1.Draw 20, 20

End Sub


SelectTool Example - VC++
SelectTool Example [image] VC++

This example uses the SelectTool method to select the Text From File annotation type. It then uses the content of the AnnotationTextFile property and the Draw method to overlay text from a text file onto an image.

void CImgEdit1Dlg::OnSelectTool()

{

    // Uses the SelectTool method to select the Text from file

    // annotation type.  Overlays text from a text file onto an

    // image.

    // If the annotation tool palette is utilized within an

    // application, SelectTool should be used rather than

    // setting the AnnotationType property for drawing marks

    // programatically.

    ImgEdit1.SelectTool(9); // Text from file

    ImgEdit1.SetAnnotationTextFile("C:\\text\\disclaim.txt");

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    ImgEdit1.Draw(10, 10, evt, evt);

}


SetCurrentAnnotationGroup Method

See Also	Example-VB
Sets the annotation group to which subsequent annotations will belong.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


SetCurrentAnnotationGroup Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


SetIbkDefaultFile Method

See Also	Example-VB
Sets a bookmark file to point to an underlying file.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Edit control

Syntax

object.SetIbkDefaultFile szIBKFileName, szUnderlyingFileName

Arguments

Parameter	Data Type	Setting
szIBKFilename	String	Destination file name
szUnderlyingFileName	String	Source file name
Remarks

An image bookmark file must be displayed when you call this method.


SetIbkTargetFile Method

See Also	Example-VB
Sets the name of the underlying file that is referenced by the bookmark file created during a bookmark “Save As” operation.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Edit control

Syntax

object.SetIbkTargetFile szUnderlyingFileName

Arguments

Parameter	Data Type	Setting
szUnderlyingFilename	String	Underlying file name
Remarks

The displayed file must be an image bookmark file, or an error is generated.


SetICMOptions Method

See Also	Example-VB
Sets the current ICM options.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Image Edit control

Syntax

object.SetICMOptions(Option)

Arguments

Parameter	Data Type	Setting	Description
Option	Long	0 1	No options Save image data as sRGB
Return Value

None

Remarks

Color correction is only applied with Windows 98 and Windows 2000.

If an image is not modified, it is not converted to sRGB during a Save operation.


SetImagePalette Method

See Also	Example-VB
Sets the palette to be used for the image currently being displayed, or an image to be displayed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


SetImagePalette Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


SetRubberStampItem Method

See Also	Example-VB	Example-VC++
Sets the item number for the rubber stamp according to its position on the Rubber Stamp Properties dialog box  and drop-down menu.  Also activates the Rubber Stamp annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

object.SetRubberStampItem ItemNumber

Argument

Parameter	Data Type	Setting
ItemNumber	Integer	The desired rubber stamp item number
Return Value

None

Remarks

The item number is zero based.  For example, an ItemNumber of 2 selects the Received stamp because it is the third item on the Rubber Stamp Properties dialog box and drop-down menu.

The Rubber Stamp Properties dialog box is accessible by right-clicking on the Rubber Stamp tool in the Annotation Tool Palette.  The drop-down menu is accessible by left-clicking on the tool.


SetRubberStampItem Example - VB
SetRubberStampItem Example [image] VB

This example lets users select the type of rubber stamp they want to use.

Private Sub cmdSetStamp_Click()

    'This allows a user to click on a stamp in order to

    'select it as the current stamp.  See the GetRubberStampMenuItems

    'method for an example of how to create a list of stamps.

    Dim intNewStamp As Integer

    'Get the index number of the stamp that was selected

    'in the list box

    intNewStamp = frmStampList.List1.ListIndex

    'Set the selected stamp as the current stamp to be used.

    frmMain.ImgEdit1.SetRubberStampItem intNewStamp

    Unload frmStampList

End Sub


SetRubberStampItem Example - VC++
SetRubberStampItem Example [image] VC++

This example lets users select the type of rubber stamp they want to use.

void CImgEdit2Dlg::OnSetcurrentstamp()

{

    // This allows a user to click on a stamp in order to

    // select it as the current stamp.  See GetRubberStampMenuItems

    // for an example of how to create a list of stamps.

    // Load the list box

    CStampList frmStampList;

    frmStampList.m_pParent= this;

    frmStampList.DoModal();

    ImgEdit1.SetRubberStampItem(frmStampList.m_intNewStamp);

}


SetSelectedAnnotationBackColor Method

See Also	Example-VB	Example-VC++
Sets the background color of a selected Attach-a-Note annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.SetSelectedAnnotationBackColor Color

Argument

Parameter	Data Type	Setting
Color	Long	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.  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.

Invoking the SetSelectedAnnotationBackColor method sets the ImageModified property to True.


SetSelectedAnnotationBackColor Example - VB
SetSelectedAnnotationBackColor Example [image] VB

This example uses the GetSelectedAnnotationBackColor method, the SetSelectedAnnotationBackColor method, and the Microsoft common dialog box to change the background color of a selected text annotation.

Private Sub cmdBackColor_Click()

    'This example uses the Microsoft color dialog box to change

    'a selected text attachment annotation mark's background color.

    Dim BackColor As Long

    'Determine the current color of the selected annotation

    'mark and init the dialog box color property to that color.

    BackColor = ImgEdit1.GetSelectedAnnotationBackColor

    CommonDialog1.Color = BackColor

    CommonDialog1.Flags = cdlCCRGBInit

    'Display the dialog box, and set the annotation background color

    'to the color selected.

    CommonDialog1.ShowColor

    ImgEdit1.SetSelectedAnnotationBackColor CommonDialog1.Color

End Sub


SetSelectedAnnotationBackColor Example - VC++
SetSelectedAnnotationBackColor Example [image] VC++

This example uses the GetSelectedAnnotationBackColor method, the SetSelectedAnnotationBackColor method, and the Microsoft common dialog box to change the background color of a selected text annotation.

void CImgEdit2Dlg::OnBackcolor()

{

    // This example uses the Microsoft color dialog box to change

    // a selected text attachment annotation mark's background color.

    long BackColor;

    // Determine the current color of the selected annotation

    // mark and init the dialog box color property to that color.

    BackColor = ImgEdit1.GetSelectedAnnotationBackColor();

    CommonDialog1.SetColor(BackColor);

    CommonDialog1.SetFlags(1); // cdlCCRGBInit

    CommonDialog1.ShowColor();

    ImgEdit1.SetSelectedAnnotationBackColor(CommonDialog1.GetColor());

}


SetSelectedAnnotationFillColor Method

See Also	Example-VB	Example-VC++
Sets the color used to fill a selected Filled Rectangle annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.SetSelectedAnnotationFillColor Color

Argument

Parameter	Data Type	Setting
Color	Long	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.

Invoking the SetSelectedAnnotationFillColor method sets the ImageModified property to True.


SetSelectedAnnotationFillColor Example - VB
SetSelectedAnnotationFillColor Example [image] VB

This example uses the GetSelectedAnnotationFillColor method to determine the fill color of a selected annotation.  It then updates the Microsoft common dialog box to indicate the color obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationFillColor method to change the fill color of a selected annotation.

Private Sub cmdFillColor_Click()

    'This example uses the Microsoft color dialog box to

    'change a selected annotation mark's fill color.

    Dim FillColor As Long

    'Determine the current color of the selected annotation

    'mark and init the dialog box color property to that color.

    FillColor = ImgEdit1.GetSelectedAnnotationFillColor

    CommonDialog1.Color = FillColor

    CommonDialog1.Flags = cdlCCRGBInit

    CommonDialog1.ShowColor

    ImgEdit1.SetSelectedAnnotationFillColor CommonDialog1.Color

End Sub


SetSelectedAnnotationFillColor Example - VC++
SetSelectedAnnotationFillColor Example [image] VC++

This example uses the GetSelectedAnnotationFillColor method to determine the fill color of a selected annotation.  It then updates the Microsoft common dialog box to indicate the color obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationFillColor method to change the fill color of a selected annotation.

void CImgEdit2Dlg::OnFillcolor()

{

    // This example uses the Microsoft color dialog box to

    // change a selected annotation mark's fill color.

    long FillColor;

    // Determine the current color of the selected annotation

    // mark and init the dialog box color property to that color.

    FillColor = ImgEdit1.GetSelectedAnnotationFillColor();

    CommonDialog1.SetColor(FillColor);

    CommonDialog1.SetFlags(1); // cdlCCRGBInit

    CommonDialog1.ShowColor();

    ImgEdit1.SetSelectedAnnotationFillColor(CommonDialog1.GetColor());

}


SetSelectedAnnotationFillStyle Method

See Also	Example-VB	Example-VC++
Sets the style used to fill a selected image or Filled Rectangle annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.SetSelectedAnnotationFillStyle Style

Argument

Parameter	Data Type	Constant	Setting	Description
Style	Integer (enumerated)	wiTransparent	0	Transparent [image] The underlying image data is visible
		wiOpaque	1	Opaque [image] 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

Invoking the SetSelectedAnnotationFillStyle method sets the ImageModified property to True.


SetSelectedAnnotationFillStyle Example - VB
SetSelectedAnnotationFillStyle Example [image] VB

This example uses the GetSelectedAnnotationFillStyle method to determine whether a selected image or filled rectangle annotation is opaque or transparent, and the SetSelectedAnnotationFillStyle method to change the fill style.

    'Private Sub Form_Load()

    'This example would determine whether a selected annotation

    'image or filled rectangle is opaque or transparent and

    'would allow that attribute to be changed.  The form used

    'would have 2 option buttons -- one labeled "Opaque" and one

    'labeled "Transparent".

    Dim FillStyle As AnnotationStyleConstants

    'Determine if the selected image annotation is opaque or

    'transparent and set the corresponding option button on

    'the form.

    FillStyle = frmMain.ImgEdit1.GetSelectedAnnotationFillStyle

    If FillStyle = wiOpaque Then

      optOpaque.Value = True

    Else

      optTransparent.Value = True

    End If

    frmFillStyle.Show

End Sub

Private Sub optOpaque_Click()

     'If the user clicks on the Opaque option button the annotation

     'is changed to be opaque.

     frmMain.ImgEdit1.SetSelectedAnnotationFillStyle wiOpaque

End Sub

Private Sub optTransparent_Click()

     'If the user clicks on the Transparent option button the annotation

     'is changed to be transparent.

     frmMain.ImgEdit1.SetSelectedAnnotationFillStyle wiTransparent

End Sub


SetSelectedAnnotationFillStyle Example - VC++
SetSelectedAnnotationFillStyle Example [image] VC++

This example uses the GetSelectedAnnotationFillStyle method to determine whether a selected image or filled rectangle annotation is opaque or transparent, and the SetSelectedAnnotationFillStyle method to change the fill style.

void CLineStyles::OnOK()

{

    if(m_Transparent.GetCheck() && m_bLineStyle)

      m_pParent->ImgEdit1.SetSelectedAnnotationLineStyle(0);

    else

      m_pParent->ImgEdit1.SetSelectedAnnotationLineStyle(1);

    if(m_Transparent.GetCheck() && !m_bLineStyle)

      m_pParent->ImgEdit1.SetSelectedAnnotationFillStyle(0);

    else

      m_pParent->ImgEdit1.SetSelectedAnnotationFillStyle(1);

    CDialog::OnOK();

}

BOOL CLineStyles::OnInitDialog()

{

    CDialog::OnInitDialog();

    short LineStyle;

    // Determine if the selected line or fill annotation is opaque or

    // transparent and set the corresponding option button on

    // the form.

    if(m_bLineStyle)

      LineStyle = m_pParent->ImgEdit1.GetSelectedAnnotationLineStyle();

    else

     {

      LineStyle = m_pParent->ImgEdit1.GetSelectedAnnotationFillStyle();

      SetWindowText("Fill Styles");

     }

    if(LineStyle == 1)  //  wiOpaque

     {

      m_Opaque.SetCheck(1);

      m_Transparent.SetCheck(0);

     }

    else

     {

      m_Opaque.SetCheck(0);

      m_Transparent.SetCheck(1);

     }

    return TRUE;  // return TRUE unless you set the focus to a control

                  // EXCEPTION: OCX Property Pages should return FALSE

}


SetSelectedAnnotationFont Method

See Also	Example-VB	Example-VC++
Sets a font object’s properties.  Applies to selected text annotations.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.SetSelectedAnnotationFont Font

Argument

Parameter	Data Type	Setting
Font	IFontDisp	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 [image] Selects bold attribute False [image] Deselects bold attribute	False
Italic	Boolean	True [image] Selects italic attribute False [image] 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 [image] Selects underline attribute False [image] Deselects underline attribute	False
StrikeThrough	Boolean	True [image] Selects strikethrough attribute False [image] Deselects strikethrough attribute	False
The SetSelectedAnnotationFont method is used with annotations of the following types:

Attach-a-Note

Hyperlink

Text

Text From File

Text Stamp

Note:  Hyperlink annotations are available with Imaging for Windows Professional Edition only.

Invoking the SetSelectedAnnotationFont method sets the ImageModified property to True.


SetSelectedAnnotationFont Example - VB
SetSelectedAnnotationFont Example [image] VB

This example uses the GetSelectedAnnotationFont method to determine the font attributes of a selected annotation.  It then updates the Microsoft common dialog box to indicate the attributes obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationFont method to change the font attributes of a selected annotation.

Private Sub cmdGetAnnoFont_Click()

    'This example uses the Microsoft font dialog box to

    'change a selected text annotation mark's font.

    Dim AnnoFont As IFontDisp

    Dim FontColor As Long

    'Determine the current font used in the selected annotation

    'mark and init the dialog box font property to that font.

    Set AnnoFont = ImgEdit1.GetSelectedAnnotationFont

    FontColor = ImgEdit1.GetSelectedAnnotationFontColor

    CommonDialog1.FontName = AnnoFont.Name

    CommonDialog1.FontBold = AnnoFont.Bold

    CommonDialog1.FontItalic = AnnoFont.Italic

    CommonDialog1.FontSize = AnnoFont.Size

    CommonDialog1.FontUnderline = AnnoFont.Underline

    CommonDialog1.FontStrikethru = AnnoFont.Strikethrough

    CommonDialog1.Color = FontColor

    CommonDialog1.Flags = cdlCFScreenFonts Or cdlCFEffects

    CommonDialog1.ShowFont

    'Take values set in the font dialog box and set these

    'attributes in the annotation font.

    AnnoFont.Name = CommonDialog1.FontName

    AnnoFont.Bold = CommonDialog1.FontBold

    AnnoFont.Italic = CommonDialog1.FontItalic

    AnnoFont.Size = CommonDialog1.FontSize

    AnnoFont.Underline = CommonDialog1.FontUnderline

    AnnoFont.Strikethrough = CommonDialog1.FontStrikethru

    'Apply the new font and font color to the selected

    'annotation.

    ImgEdit1.SetSelectedAnnotationFont AnnoFont

    ImgEdit1.SetSelectedAnnotationFontColor CommonDialog1.Color

End Sub


SetSelectedAnnotationFont Example - VC++
SetSelectedAnnotationFont Example [image] VC++

This example uses the GetSelectedAnnotationFont method to determine the font attributes of a selected annotation.  It then updates the Microsoft common dialog box to indicate the attributes obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationFont method to change the font attributes of a selected annotation.

void CImgEdit2Dlg::OnAnnofont()

{

    // This example uses the Microsoft font dialog box to

    // change a selected text annotation mark's font.

    COleFont AnnoFont;

    AnnoFont = ImgEdit1.GetSelectedAnnotationFont();

    CY cy;

    long FontColor;

    // Determine the current font used in the selected annotation

    // mark and init the dialog box font property to that font.

    AnnoFont = ImgEdit1.GetSelectedAnnotationFont();

    FontColor = ImgEdit1.GetSelectedAnnotationFontColor();

    CommonDialog1.SetFontName(AnnoFont.GetName());

    CommonDialog1.SetFontBold(AnnoFont.GetBold());

    CommonDialog1.SetFontItalic(AnnoFont.GetItalic());

    cy = AnnoFont.GetSize();

    CommonDialog1.SetFontSize((float)cy.Lo / 10000);

    CommonDialog1.SetFontUnderLine(AnnoFont.GetUnderline());

    CommonDialog1.SetFontStrikeThru(AnnoFont.GetStrikethrough());

    CommonDialog1.SetColor(FontColor);

    CommonDialog1.SetFlags(0x101); //cdlCFScreenFonts Or cdlCFEffects

    CommonDialog1.ShowFont();

    // Take values set in the font dialog box and set these

    // attributes in the annotation font.

    AnnoFont.SetName(CommonDialog1.GetFontName());

    AnnoFont.SetBold(CommonDialog1.GetFontBold());

    AnnoFont.SetItalic(CommonDialog1.GetFontItalic());

    cy.Lo = (unsigned long)CommonDialog1.GetFontSize() * 10000;

    AnnoFont.SetSize(cy);

    AnnoFont.SetUnderline(CommonDialog1.GetFontUnderLine());

    AnnoFont.SetStrikethrough(CommonDialog1.GetFontStrikeThru());

    // Apply the new font and font color to the selected

    // annotation.

    ImgEdit1.SetSelectedAnnotationFont(AnnoFont);

    ImgEdit1.SetSelectedAnnotationFontColor(CommonDialog1.GetColor());

}


SetSelectedAnnotationFontColor Method

See Also	Example-VB	Example-VC++
Sets the font color used in a selected text annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.SetSelectedAnnotationFontColor Color

Argument

Parameter	Data Type	Setting
Color	Long	The desired font color
Return Value

None

Remarks

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

Attach-a-Note

Hyperlink

Text

Text From File

Text Stamp

Note:  Hyperlink annotations are available with Imaging for Windows Professional Edition only.

Invoking the SetSelectedAnnotationFontColor method sets the ImageModified property to True.

Use the RGB format.  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.


SetSelectedAnnotationFontColor Example - VB
SetSelectedAnnotationFontColor Example [image] VB

This example uses the GetSelectedAnnotationFontColor method to determine the font color of a selected annotation.  It then updates the Microsoft common dialog box to indicate the color obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationFontColor method to change the font color of a selected annotation.

Private Sub cmdFontColor_Click()

    'This example uses the Microsoft color dialog box to

    'change a selected annotation mark's font color.

    Dim FontColor As Long

    'Determine the current color of the selected annotation

    'mark and init the dialog box color property to that color.

    FontColor = ImgEdit1.GetSelectedAnnotationFontColor

    CommonDialog1.Color = FontColor

    CommonDialog1.Flags = cdlCCRGBInit

    CommonDialog1.ShowColor

    ImgEdit1.SetSelectedAnnotationFontColor CommonDialog1.Color

End Sub


SetSelectedAnnotationFontColor Example - VC++
SetSelectedAnnotationFontColor Example [image] VC++

This example uses the GetSelectedAnnotationFontColor method to determine the font color of a selected annotation.  It then updates the Microsoft common dialog box to indicate the color obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationFontColor method to change the font color of a selected annotation.

void CImgEdit2Dlg::OnAnnofont()

{

    // This example uses the Microsoft font dialog box to

    // change a selected text annotation mark's font.

    COleFont AnnoFont;

    AnnoFont = ImgEdit1.GetSelectedAnnotationFont();

    CY cy;

    long FontColor;

    // Determine the current font used in the selected annotation

    // mark and init the dialog box font property to that font.

    AnnoFont = ImgEdit1.GetSelectedAnnotationFont();

    FontColor = ImgEdit1.GetSelectedAnnotationFontColor();

    CommonDialog1.SetFontName(AnnoFont.GetName());

    CommonDialog1.SetFontBold(AnnoFont.GetBold());

    CommonDialog1.SetFontItalic(AnnoFont.GetItalic());

    cy = AnnoFont.GetSize();

    CommonDialog1.SetFontSize((float)cy.Lo / 10000);

    CommonDialog1.SetFontUnderLine(AnnoFont.GetUnderline());

    CommonDialog1.SetFontStrikeThru(AnnoFont.GetStrikethrough());

    CommonDialog1.SetColor(FontColor);

    CommonDialog1.SetFlags(0x101); //cdlCFScreenFonts Or cdlCFEffects

    CommonDialog1.ShowFont();

    // Take values set in the font dialog box and set these

    // attributes in the annotation font.

    AnnoFont.SetName(CommonDialog1.GetFontName());

    AnnoFont.SetBold(CommonDialog1.GetFontBold());

    AnnoFont.SetItalic(CommonDialog1.GetFontItalic());

    cy.Lo = (unsigned long)CommonDialog1.GetFontSize() * 10000;

    AnnoFont.SetSize(cy);

    AnnoFont.SetUnderline(CommonDialog1.GetFontUnderLine());

    AnnoFont.SetStrikethrough(CommonDialog1.GetFontStrikeThru());

    // Apply the new font and font color to the selected

    // annotation.

    ImgEdit1.SetSelectedAnnotationFont(AnnoFont);

    ImgEdit1.SetSelectedAnnotationFontColor(CommonDialog1.GetColor());

}


SetSelectedAnnotationLineColor Method

See Also	Example-VB	Example-VC++
Sets the line color used in a selected line or Hollow Rectangle annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.SetSelectedAnnotationLineColor Color

Argument

Parameter	Data Type	Setting
Color	Long	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.

Invoking the SetSelectedAnnotationLineColor method sets the ImageModified property to True.


SetSelectedAnnotationLineColor Example - VB
SetSelectedAnnotationLineColor Example [image] VB

This example uses the GetSelectedAnnotationLineColor method to determine the color of a selected line annotation.  It then updates the Microsoft common dialog box to indicate the color obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationLineColor method to change the color of a selected line annotation.

Private Sub cmdLineColor_Click()

    'This example uses the Microsoft color dialog box to

    'change a selected annotation mark's line color.

    Dim LineColor As Long

    'Determine the current color of the selected annotation

    'mark and init the dialog box color property to that color.

    LineColor = ImgEdit1.GetSelectedAnnotationLineColor

    CommonDialog1.Color = LineColor

    CommonDialog1.Flags = cdlCCRGBInit

    CommonDialog1.ShowColor

    ImgEdit1.SetSelectedAnnotationLineColor CommonDialog1.Color

End Sub


SetSelectedAnnotationLineColor Example - VC++
SetSelectedAnnotationLineColor Example [image] VC++

This example uses the GetSelectedAnnotationLineColor method to determine the color of a selected line annotation.  It then updates the Microsoft common dialog box to indicate the color obtained.

This example also uses the Microsoft common dialog box and the SetSelectedAnnotationLineColor method to change the color of a selected line annotation.

void CImgEdit2Dlg::OnLinecolor()

{

    // This example uses the Microsoft color dialog box to

    // change a selected annotation mark's line color.

    long LineColor;

    // Determine the current color of the selected annotation

    // mark and init the dialog box color property to that color.

    LineColor = ImgEdit1.GetSelectedAnnotationLineColor();

    CommonDialog1.SetColor(LineColor);

    CommonDialog1.SetFlags(1); // cdlCCRGBInit

    CommonDialog1.ShowColor();

    ImgEdit1.SetSelectedAnnotationLineColor(CommonDialog1.GetColor());

}


SetSelectedAnnotationLineStyle Method

See Also	Example-VB	Example-VC++
Sets the line style used in a selected line or Hollow Rectangle annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.SetSelectedAnnotationLineStyle Style

Argument

Parameter	Data Type	Constant	Setting	Description
Style	Integer (enumerated)	wiTransparent	0	Transparent [image] The underlying image data is visible
		wiOpaque	1	Opaque [image] 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

Invoking the SetSelectedAnnotationLineStyle method sets the ImageModified property to True.


SetSelectedAnnotationLineStyle Example - VB
SetSelectedAnnotationLineStyle Example [image] VB

This example uses the GetSelectedAnnotationLineStyle method to determine whether a selected line or hollow rectangle annotation is opaque or transparent, and the SetSelectedAnnotationLineStyle method to change the line style.

Private Sub Form_Load()

    'This example determines whether a selected annotation

    'line or hollow rectangle is opaque or transparent and

    'allows that attribute to be changed.  The form used

    'has 2 option buttons -- one labeled "Opaque" and one

    'labeled "Transparent".

    Dim LineStyle As AnnotationStyleConstants

    'Determine if the selected line annotation is opaque or

    'transparent and set the corresponding option button on

    'the form.

    LineStyle = frmMain.ImgEdit1.GetSelectedAnnotationLineStyle

    If LineStyle = wiOpaque Then

      optOpaque.Value = True

    Else

      optTransparent.Value = True

    End If

    frmLineStyle.Show

End Sub

Private Sub optOpaque_Click()

    'If the user clicks on the Opaque option button the annotation

    'is changed to be opaque.

    frmMain.ImgEdit1.SetSelectedAnnotationLineStyle wiOpaque

End Sub

Private Sub optTransparent_Click()

    'If the user clicks on the Transparent option button the annotation

    'is changed to be transparent.

    frmMain.ImgEdit1.SetSelectedAnnotationLineStyle wiTransparent

End Sub


SetSelectedAnnotationLineStyle Example - VC++
SetSelectedAnnotationLineStyle Example [image] VC++

This example uses the GetSelectedAnnotationLineStyle method to determine whether a selected line or hollow rectangle annotation is opaque or transparent, and the SetSelectedAnnotationLineStyle method to change the line style.

void CLineStyles::OnOK()

{

    if(m_Transparent.GetCheck() && m_bLineStyle)

      m_pParent->ImgEdit1.SetSelectedAnnotationLineStyle(0);

    else

      m_pParent->ImgEdit1.SetSelectedAnnotationLineStyle(1);

    if(m_Transparent.GetCheck() && !m_bLineStyle)

      m_pParent->ImgEdit1.SetSelectedAnnotationFillStyle(0);

    else

      m_pParent->ImgEdit1.SetSelectedAnnotationFillStyle(1);

    CDialog::OnOK();

}

BOOL CLineStyles::OnInitDialog()

{

    CDialog::OnInitDialog();

    short LineStyle;

    // Determine if the selected line or fill annotation is opaque or

    // transparent and set the corresponding option button on

    // the form.

    if(m_bLineStyle)

      LineStyle = m_pParent->ImgEdit1.GetSelectedAnnotationLineStyle();

    else

     {

      LineStyle = m_pParent->ImgEdit1.GetSelectedAnnotationFillStyle();

      SetWindowText("Fill Styles");

     }

    if(LineStyle == 1)  //  wiOpaque

     {

      m_Opaque.SetCheck(1);

      m_Transparent.SetCheck(0);

     }

    else

     {

      m_Opaque.SetCheck(0);

      m_Transparent.SetCheck(1);

     }

    return TRUE;  // return TRUE unless you set the focus to a control

                  // EXCEPTION: OCX Property Pages should return FALSE

}


SetSelectedAnnotationLineWidth Method

See Also	Example-VB	Example-VC++
Sets the line width used in a selected line or Hollow Rectangle annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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

Invoking the SetSelectedAnnotationLineWidth method sets the ImageModified property to True.


SetSelectedAnnotationLineWidth Example - VB
SetSelectedAnnotationLineWidth Example [image] VB

Example 1 allows the user to change the line width value in a text box.  It then updates a line control to illustrate the width, and uses the SetSelectedAnnotationLineWidth method to set the width of a selected line annotation to the value entered in the text box control.

Example 2 allows the user to change the line width value using an UpDown control.  It then updates a line control to illustrate the width, and uses the SetSelectedAnnotationLineWidth method to set the width of a selected line annotation.

Example 1

Private Sub txtWidth_Change()

    'On a form containing a text box and a line control,

    'this allows the user to change the value in the

    'text box and then updates the line control (to

    'illustrate the width) and also updates the width

    'of a selected line annotation.

    Global intLineWidth as integer

    'Determine the width entered by user in the text box

    intLineWidth = Int(txtWidth.Text)

    'Set the width of the line control in the dialog box

    Line1.BorderWidth = intLineWidth

    'Set the width of the line annotation on the displayed

    'image

    frmMain.ImgEdit1.SetSelectedAnnotationLineWidth intLineWidth

End Sub

Example 2

Private Sub UpDown1_Change()

    'On a form containing a text box that is linked to an UpDown

    'control and a line control, this allows the user to

    'scroll the UpDown control and changes the value in

    'the text box, the width of the sample line, and also

    'updates the width of a selected line annotation.

    'Determine the line width by the value of the UpDown

    'control

    intLineWidth = UpDown1.Value

    'Set the width of the "sample" line in the dialog box

    Line1.BorderWidth = intLineWidth

    'Set the width of the selected annotation line

    frmMain.ImgEdit1.SetSelectedAnnotationLineWidth intLineWidth

End Sub


SetSelectedAnnotationLineWidth Example - VC++
SetSelectedAnnotationLineWidth Example [image] VC++

This example uses the GetSelectedAnnotationLineWidth method to determine the width of a selected line annotation.  It then displays the line width in a text box control.

It also uses the SetSelectedAnnotationLineWidth method to set the width of a selected line annotation to the value entered in the text box control.

BOOL CLineWidth::OnInitDialog()

{

    CDialog::OnInitDialog();

    int intLineWidth;

    long LineColor;

    // Get the line width and color to initialize the dialog box

    intLineWidth = m_pParent->ImgEdit1.GetSelectedAnnotationLineWidth();

    LineColor = m_pParent->ImgEdit1.GetSelectedAnnotationLineColor();

    // Set the current line width in the text box

    char tLineWidth [5];

    _itoa(intLineWidth,tLineWidth,10);

    m_Edit.SetWindowText(tLineWidth);

    return TRUE;  // return TRUE unless you set the focus to a control

                  // EXCEPTION: OCX Property Pages should return FALSE

}

void CLineWidth::OnOK()

{

    CString tLineWidth;

    int iLineWidth;

    m_Edit.GetWindowText(tLineWidth);

    iLineWidth = atoi(tLineWidth);

    m_pParent->ImgEdit1.SetSelectedAnnotationLineWidth(iLineWidth);

    CDialog::OnOK();

}


SetSelectedAnnotationOcrType Method

See Also	Example-VB	Example-VC++
Changes the OCR type of a selected OCR Zones annotation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

object.SetSelectedAnnotationOcrType OcrType

Argument

Parameter	Data Type	Setting
OcrType	Integer (enumerated)	0 [image] OCR Text zone 1 [image] OCR Picture zone
Return Value

None

Remarks

An OCR Zones annotation type must be selected prior to calling this method.

Invoking the SetSelectedAnnotationOcrType method sets the ImageModified property to True.


SetSelectedAnnotationOcrType Example - VB
SetSelectedAnnotationOcrType Example [image] VB

This example uses the GetSelectedAnnotationOcrType method to determine whether a selected OCR Zone annotation is a Picture zone or a Text zone.  It then updates the appropriate option button on the form to indicate the OCR type.

This example also allows the user to change the OCR type of a selected OCR Zone annotation using the option buttons on the form.  It uses the SetSelectedAnnotationOcrType method to set the OCR type.

Private Sub Form_Load()

    'This example determines whether a selected OCR recognition

    'zone is defined as a Picture Zone or a Text Zone and

    'shows a dialog box to allow the user to change the OCR zone type.

    'Form used has 2 option buttons labeled Picture Zone and

    'Text Zone

    Dim OCRType As AnnotationOcrTypeConstants

    'Determine if the selected OCR annotation mark is a Text

    'Zone or a Picture Zone and set the corresponding option

    'button on the form.

    OCRType = frmMain.ImgEdit1.GetSelectedAnnotationOcrType

    If OCRType = wiOcrTypeText Then

      optTextZone.Value = True

    Else

      optPictureZone.Value = True

    End If

   frmOCRType.Show

End Sub

Private Sub optPictureZone_Click()

    'If the user clicks on the Picture Zone option button, the OCR

    'Zone type is changed to a Picture Zone.

    frmMain.ImgEdit1.SetSelectedAnnotationOcrType wiOcrTypePicture

End Sub

Private Sub optTextZone_Click()

    'If the user clicks on the Text Zone option button, the OCR

    'Zone type is changed to a Text Zone.

    frmMain.ImgEdit1.SetSelectedAnnotationOcrType wiOcrTypeText

End Sub


SetSelectedAnnotationOcrType Example - VC++
SetSelectedAnnotationOcrType Example [image] VB

This example uses the GetSelectedAnnotationOcrType method to determine whether a selected OCR Zone annotation is a Picture zone or a Text zone.  It then updates the appropriate check box to indicate the OCR type.

This example also allows the user to change the OCR type of a selected OCR Zone annotation using a check box.  It uses the SetSelectedAnnotationOcrType method to set the OCR type.

void COCRZones::OnOK()

{

    if(m_TextZone.GetCheck())

      m_pParent->ImgEdit1.SetSelectedAnnotationOcrType(0);

    else

      m_pParent->ImgEdit1.SetSelectedAnnotationOcrType(1);

    CDialog::OnOK();

}

BOOL COCRZones::OnInitDialog()

{

    CDialog::OnInitDialog();

    short OCRType;

    // Determine if the selected OCR annotation mark is a Text

    // Zone or a Picture Zone and set the corresponding option

    // button on the form.

    OCRType = m_pParent->ImgEdit1.GetSelectedAnnotationOcrType();

    if(OCRType == 0)   // wiOcrTypeText

    {

      m_TextZone.SetCheck(1);

      m_PictureZone.SetCheck(0);

    }

    else

    {

      m_TextZone.SetCheck(0);

      m_PictureZone.SetCheck(1);

    }

    return TRUE;  // return TRUE unless you set the focus to a control

                  // EXCEPTION: OCX Property Pages should return FALSE

}


SetUserId Method

See Also	Example-VB
Sets the User Id, which is used by the Initials annotation stamp, and is displayed with the attributes of an annotation that is created or edited by the user.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Edit control

Syntax

object.SetUserId SzUserId

Data Type

String

Setting	Description
szUserId	Specifies the user’s Id


ShowAnnotationGroup Method

See Also	Example-VB	Example-VC++
Shows the specified annotation group.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.

This method does not show OCR Zone annotations.  To show OCR Zone annotations, use the OcrZoneVisibility property.

Invoking the ShowAnnotationGroup method sets the ImageModified property to True.

Note:  OCR Zone annotations are available with Imaging for Windows Professional Edition only.


ShowAnnotationGroup Example - VB
ShowAnnotationGroup Example [image] VB

This example lets a user select an annotation group from a list and make it visible.  See the example for the GetAnnotationGroup method for instructions on how to list annotation groups.

Private Sub cmdShowGroup_Click()

    Dim strCurGroup As String

    'Determine which group the user selected from the listbox

    strCurGroup = AnnoGroups.List(AnnoGroups.ListIndex)

    Form1.ImgEdit1.ShowAnnotationGroup (strCurGroup)

End Sub


ShowAnnotationGroup Example - VC++
ShowAnnotationGroup Example [image] VC++

This example lets a user select an annotation group from a list and make it visible.  See the example for the GetAnnotationGroup method for instructions on how to list annotation groups.

void CFrmGroup::OnShowGroup()

{

    // This would allow a user to select a Group from a list

    // and make it visible. See example for GetAnnotationGroup method

    // for how to list annotation groups.

    CString szCurGroup;

    // Determine which group the user selected from the listbox

    m_GroupList.GetText(m_GroupList.GetCurSel(),szCurGroup);

    VARIANT vCurGroup;

    V_VT(&vCurGroup) = VT_BSTR;

    V_BSTR(&vCurGroup) = szCurGroup.AllocSysString();

    if(pParentDlg)

    {

      pParentDlg->ImgEdit1.ShowAnnotationGroup(vCurGroup);

    }

}


ShowAnnotationToolPalette Method

See Also	Example-VB	Example-VC++
Shows the Annotation Tool Palette, which enables end users to add and edit annotations on the displayed image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 (default) [image] When the end user clicks on a tool palette button using the right mouse button and selects properties from a pop-up menu, the appropriate Annotation Attributes dialog box appears (sample).  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 [image] 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 screen.
Top	Long	The vertical position of the Annotation Tool Palette in pixels, relative to the upper-left corner of the screen.
ToolTipText	String	Contains the tool tip text used for each Annotation Tool Palette button.  Any number of strings may be entered; 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.

Invoking the ShowAnnotationToolPalette method sets the ImageModified property to True.

Tab Characters

The Image Edit control does not support the use of Tab characters in any of the text-related annotation tools.


ShowAnnotationToolPalette Example - VB
ShowAnnotationToolPalette Example [image] VB

This example shows how to invoke the annotation tool palette with user-defined tool tips.  If tool tips are not specified, defaults are used.

Private Sub cmdToolPal_Click()

    'An example of showing the annotation tool palette with user

    'defined tooltips.  If Tool tips are not specified default values

    'are provided

    'True parameter allows user to right click on a tool on the

    'palette to set attributes (color, size, etc) for that tool

    'If location is not specified, palette is positioned relative

    'to ImgEdit control

    ToolTips$ = "Tool Tip #1|Tool Tip #2|Tool Tip #3|Tool Tip #4|Tool Tip #5|

     Tool Tip #6|Tool Tip #7|Tool Tip #8|Tool Tip #9|Tool Tip #10|

     Tool Tip #11"

   'Tool palette will appear in its default location since it is not specified

   ImgEdit1.ShowAnnotationToolPalette True, , , ToolTips$

End Sub


ShowAnnotationToolPalette Example - VC++
ShowAnnotationToolPalette Example [image] VC++

This example shows how to invoke the annotation tool palette with user-defined tool tips.  If tool tips are not specified, defaults are used.

void CImgEdit1Dlg::OnToolPalette()

{

    // An example of showing the annotation tool palette with user

    // defined tooltips.  If Tool tips are not specified default values

    // are provided

    // True parameter allows user to right click on a tool on the

    // palette to set attributes (color, size, etc) for that tool

    // If location is not specified, palette is positioned relative to ImgEdit control

    CString szToolTips;

    szToolTips = "Tool Tip #1|Tool Tip #2|Tool Tip #3|Tool Tip #4|

     Tool Tip #5|Tool Tip #6|Tool Tip #7|Tool Tip #8|

     Tool Tip #9|Tool Tip #10|Tool Tip #11";

    // Tool palette will appear in its default location since it is

    // not specified

    VARIANT vToolTips;

    V_VT(&vToolTips) = VT_BSTR;

    V_BSTR(&vToolTips) = szToolTips.AllocSysString();

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default

    VARIANT vShowAttrDlg; V_VT(&vShowAttrDlg) = VT_BOOL;

    V_BOOL(&vShowAttrDlg) = TRUE;

    ImgEdit1.ShowAnnotationToolPalette(vShowAttrDlg, evt, evt, vToolTips);

}


ShowAttribsDialog Method

See Also	Example-VB	Example-VC++
Shows an Annotation Attributes dialog box, which lets end users change the attributes of the selected annotation mark, or the attributes of the current type.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.ShowAttribsDialog Option

Arguments

None

Parameter	Data Type	Setting
Option	Integer (enumerated)	0 [image] Show the Annotation Attributes dialog box (sample) for the currently selected annotation (default) ToolID - 1 [image] Show the attribute defaults for the given Tool ID number minus 1 99 [image] Show the LinkTo dialog box for the selected annotation
Note:  The Option parameter is available with Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5. With the exception of setting 99 (Link-To), it also available with Imaging for Windows 98.

Return Value

None

Remarks

The type of dialog box invoked depends on the annotation type of the selected mark.

The ToolID setting must be passed as the actual Tool ID number minus 1.  For example, to show the attribute defaults for the Attach-a-Note tool, pass 7 (Attach-a-Note Tool ID of 8 minus 1).

An annotation must be selected if ToolID is not passed or is 0.

The Link To dialog box enables end users to make any annotation mark a Hyperlink annotation.  A Hyperlink annotation can be linked to the following items:

An image page in a TIFF image document stored on a local or network drive

Universal Resource Locator (URL) on the World Wide Web

While users can create a Hyperlink annotation on any type of image, a Hyperlink annotation can be saved to disk only when the image upon which it is drawn is saved as a TIFF file.  If end users burn-in a Hyperlink annotation, it no longer functions as a hypertext jump.


ShowAttribsDialog Example - VB
ShowAttribsDialog Example [image] VB

This example invokes the Annotation Attributes dialog box when the user right-clicks an annotation mark.

Private Sub ImgEdit1_MarkSelect(ByVal Button As Integer, ByVal Shift As Integer,

 ByVal Left As Long, ByVal Top As Long, ByVal Width As Long,

 ByVal Height As Long, ByVal MarkType As Integer, ByVal GroupName As String)

    'If user right clicks on an annotation mark using the annotation

    'select tool, the attributes dialog box for that type of mark

    'will be displayed so the user could change the mark attributes

    If Button = 2 Then     'User selected mark with a right mouse click

      ImgEdit1.ShowAttribsDialog

    End If

End Sub


ShowAttribsDialog Example - VC++
ShowAttribsDialog Example [image] VC++

This example invokes the Annotation Attributes dialog box when the user right-clicks an annotation mark.

void CImgEdit1Dlg::OnMarkSelect(short Button, short Shift, long Left, long Top, long Width,

 long Height, short MarkType, LPCTSTR GroupName)

{

    // If user right clicks on an annotation mark using the annotation

    // select tool, the attributes dialog box for that type of mark

    // will be displayed so the user could change the mark attributes

    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to selected mark type

    if(Button == 2)     // User selected mark with a right mouse click

      ImgEdit1.ShowAttribsDialog(evt);

}


ShowFileOptionsDialog Method

See Also	Example-VB
Displays the File Options dialog box.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Image Edit control

Syntax

object.ShowFileOptionsDialog

Arguments

None

Remarks

This method updates the following properties:

ICMOptions
ForceTiffJpeg6
ForceTiffSingleStrip

The following values are set by the specified properties. A user can accept or change these settings from the dialog box.

The initial value of the “Standard (sRGB) color output” check box is set by SetICMOptions.

The initial state of the “TIFF JPEG 6.0” checkbox is set by the ForceTiffJpeg6 property.

The initial state of the “TIFF Single Strip” checkbox is set by the ForceTiffSingleStrip property.


ShowMagnifier Method

See Also	Example-VB	Example-VC++
Displays or hides the magnifier window.  Can also optionally move and resize the magnifier window.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Edit control

Syntax

object.ShowMagnifier Show[[,Left,Top][,Width,Height]]

Arguments

Parameter	Data Type	Setting
Show	Boolean	True [image] Display the magnifier window False [image] Hide the magnifier window
Left	Long	The horizontal position of the magnifier window in pixels, relative to the upper-left corner of the screen
Top	Long	The vertical position of the magnifier window in pixels, relative to the upper-left corner of the screen
Width	Long	The width of the magnifier window in pixels
Height	Long	The height of the magnifier window in pixels
Return Value

None

Remarks

If the position and size parameters are not specified, the magnifier window is shown at its previous location, in its previous size.  If the Left parameter is specified, the Top parameter must also be specified. Likewise, if the Width parameter is specified, the Height parameter must also be specified.

The magnifier window can be resized by the user at run time; it does not have a caption bar.


ShowMagnifier Example - VB
ShowMagnifier Example [image] VB

This example scrolls the image to a specified location, sets the Magnifier zoom factor, and then displays the Magnifier window.

Private Sub cmdMagnifier_Click()

    'Scroll the image to a specific horizontal/vertical pixel

    'location.

    ImgEdit1.ScrollPositionX = 800

    ImgEdit1.ScrollPositionY = 1000

    'Magnifier window will zoom underlying image data to 4 times

    'its size.

    ImgEdit1.MagnifierZoom = wi4XMagnifier  '1

    ImgEdit1.ShowMagnifier True

End Sub


ShowMagnifier Example - VC++
ShowMagnifier Example [image] VC++

This example scrolls the image to a specified location, sets the Magnifier zoom factor, and then displays the Magnifier window.

void CImgEdit1Dlg::OnMagnifier()

{

    // This example scrolls the image to a specific location and

    // then displays a magnifier window.

    // Scroll the image to a specific horizontal/vertical pixel

    // location.

    ImgEdit1.SetScrollPositionX(800);

    ImgEdit1.SetScrollPositionY(1000);

    // Magnifier window zooms underlying image data to 4 times

    // its size.

    ImgEdit1.SetMagnifierZoom(1); // wi4XMagnifier  // 1

    VARIANT evt; V_VT(&evt) = VT_ERROR;	// set to default

    ImgEdit1.ShowMagnifier(TRUE,evt,evt,evt,evt);

}


ShowPageProperties Method

See Also	Example-VB
Shows the Page Properties dialog box, which enables end users to view or modify the properties of the displayed image page.  The Page properties are: Color, Compression, Resolution, and Size.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

object.ShowPageProperties(bReadOnly)

Arguments

Parameter	Data Type	Setting
bReadOnly	Boolean	Determines read/write privileges: True [image] Read only. Users cannot alter property values. False [image] Read/write. Users can alter property values.
Return Value

Long

Constant	Value	Description
vbOK	1	Returned when users click the OK button, and a modification has been made
vbCANCEL	2	Returned when users click the Cancel button, or when users click the OK button, and no modifications have been made
Remarks

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


ShowPageProperties Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


ShowRubberStampDialog Method

See Also	Example-VB
Can be used in conjunction with the Annotation Tool Palette to show the Rubber Stamp Properties dialog box, which permits end users to create, delete, and edit Rubber Stamps.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
√	Imaging for Windows 95
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

object.ShowRubberStampDialog

Arguments

None

Return Value

None

Remarks

None


ShowRubberStampDialog Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


Undo Method

See Also	Example-VB	Example-VC++
Undoes the last imaging operation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

object.Undo [Option]

Argument

Parameter	Data Type	Setting
Option	Long	0 (default)
Return Value

None

Remarks

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

The Undo method undoes imaging operations only; it is limited to the number of undo levels specified in the UndoLevels property. If Undo is called when there is nothing to undo, an error is generated. Check the StatusCode property for the error.

Invoking the Undo method sets the ImageModified property to False if no other modifications were performed previously.


Undo Example - VB
Undo Example [image] VB

This example illustrates how to enable Undo functionality in an application.

Private Sub Form_Load()

    'UndoLevels must be set at form load to allocate undo buffers

    ImgEdit1.UndoLevels = 1

End Sub

Private Sub cmdUndo_Click()

    'The Undo method will undo the last imaging operation

    'performed.

    ImgEdit1.Undo

End Sub


Undo Example - VC++
Undo Example [image] VC++

This example illustrates how to enable Undo functionality in an application.

BOOL CImgEdit1Dlg::OnInitDialog()

{

    CDialog::OnInitDialog();

    blnIsRectangle = FALSE;

    // UndoLevels must be set at form load to allocate undo buffers

    ImgEdit1.SetUndoLevels(1);

    return TRUE;  // return TRUE  unless you set the focus to a control

}

void CImgEdit1Dlg::OnUndo()

{

    // The Undo method will undo the last imaging operation

    // performed.

    VARIANT evt; V_VT(&evt) = VT_ERROR;	// set to default

    ImgEdit1.Undo(evt);

}


ZoomToSelection Method

See Also	Example-VB	Example-VC++
Scales a selected portion of a displayed image so that it fits into the size of the control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


ZoomToSelection Example - VB
ZoomToSelection Example [image] VB

This example draws a selection rectangle on an image and zooms in on the area bound by the rectangle.

Private Sub cmdZoomSelect_Click()

    'Enable rectangle drawing

    ImgEdit1.SelectionRectangle = True

    'Draw rectangle

    ImgEdit1.DrawSelectionRect 150, 200, 400, 400

    ImgEdit1.ZoomToSelection

End Sub


ZoomToSelection Example - VC++
ZoomToSelection Example [image] VC++

This example draws a selection rectangle on an image and zooms in on the area bound by the rectangle.

void CImgEdit1Dlg::OnZoomto()

{

    // This would draw a rectangle on an image and would

    // zoom in on the area bound by the rectangle

    // Enable rectangle drawing

    ImgEdit1.SetSelectionRectangle(TRUE);

    // Draw rectangle

    ImgEdit1.DrawSelectionRect( 150, 200, 400, 400);

    ImgEdit1.ZoomToSelection();

}


BadDocumentFileType Event

See Also	Example-VB	Example-VC++
This event occurs when an image is being saved to an existing image document, and the current page attempting to be overwritten is read-only.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Edit control

Syntax

Sub object_BadDocumentFileType(Page,ErrorOut,Skip,Overwrite)

Arguments

Parameter	Data Type	Setting
Page	Long	Specifies the page number being saved.
ErrorOut	Boolean	Determines whether the current operation terminates with an error when the event fires: True [image] The current operation terminates with an error (default).  The Skip and Overwrite parameters are ignored. False [image] The current operation does not terminate with an error.  Handling is determined by the Skip or Overwrite parameter setting.
Skip	Boolean	If the ErrorOut parameter is set to False, the Skip parameter determines whether to skip the file being processed: True [image] Skips the file being processed.  The Overwrite parameter is ignored. False [image] Does not skip the file being processed (default).  Handling is determined by the Overwrite parameter setting.
Overwrite	Boolean	If the ErrorOut and Skip parameters are set to False, the Overwrite parameter determines whether the current, read-only page in the document is overwritten: True [image] The current, read-only page in the document is overwritten. The overwritten image document retains the same name, which insures that any links to it are not broken.  However, its extension may be changed to a read-only type, even though it contains read-write image data (the overwritten page). False [image] The current, read-only page in the document is not overwritten (default). Set Overwrite to False if you want to create a new, read-write file for the page being saved.  (Keep in mind that other documents linking to this page will not be affected, but that the current document will no longer point to the same file for the current page).
Remarks

This event is functional only when writing to AWD, BMP, and TIFF file types.

Links to image document pages are managed using Hyperlink annotations.

Note:  AWD is not available with Imaging for Windows NT 4.0.


BadDocumentFileType Example - VB
BadDocumentFileType Example [image] VB

In this example, when the BadDocumentFileType event fires, the associated file is overwritten.

Private Sub ImgEdit1_BadDocumentFileType(ByVal Page As Long, ErrorOut As Boolean,

 SkipPage As Boolean, OverWritePage As Boolean)

    'If an attempt is made to rewrite a file type which is not

    'supported for write, the file is converted to TIFF

    'and overwritten.

    ErrorOut = False

    Overwrite = True

End Sub


BadDocumentFileType Example - VC++
BadDocumentFileType Example [image] VC++

In this example, when the BadDocumentFileType event fires, the associated file is overwritten.

void CImgEdit2Dlg::OnBadDocumentFileTypeEditctrl1(long Page, BOOL FAR* ErrorOut,

 BOOL FAR* SkipPage, BOOL FAR* OverWritePage)

{

    // If an attempt is made to rewrite a file type which is not

    // supported for write, the file is converted to TIFF

    // and overwritten.

    bool bErrorOut = FALSE;

    bool Overwrite = TRUE;

}


CheckContinuePrinting Event

See Also	Example-VB
This event occurs when a print operation requests whether it should cancel or continue printing.  The value of the ContinuePrinting property provides the event with the desired response.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

Sub object_CheckContinuePrinting(PagesPrinted,CurrentPage,Status)

Arguments

Parameter	Data Type	Setting
PagesPrinted	Long	The number of pages already printed
CurrentPage	Long	The current page being printed
Status	Integer	Not used currently
Remarks

The CheckContinuePrinting event fires at the beginning of a print operation and after each page is printed.  The default is to continue printing.

Before you can use the ContinuePrinting property and the CheckContinuePrinting event, the UseCheckContinuePrinting property must be set to True.


CheckContinuePrinting Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


Close Event

See Also	Example-VB	Example-VC++
This event occurs when one of the following methods is invoked:

Display

ClearDisplay

DisplayBlankImage

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

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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, SaveAs, or SavePage 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 end users to save the changes.


Close Example - VB
Close Example [image] VB

In this example, when the Close event fires, the code evaluates the ImageModified property to see if changes were made to the image.  If the value of the ImageModified property is True, the code prompts the user to save the image.

Private Sub ImgEdit1_Close()

    'This code could be used at the time a user attempts to open

    'a new file or clear a previously displayed image in order

    'to prompt for changes to be saved if the image has been modified.

    Dim intSaveImg As Integer

    If ImgEdit1.ImageModified = True Then

      intSaveImg = MsgBox("Do you want to save changes?", vbYesNoCancel,

       "Image has been modified")

      Select Case intSaveImg

        Case vbYes

          'Save the changes

          ImgEdit1.Save

          'Drop down to the Open file code

        Case vbNo

          'Don't save file, just drop down to the Open

          'file code

        Case vbCancel

          'User pressed cancel

          'Don't open a file, don't save changes

          Exit Sub

      End Select

    End If

    'Open a new file at this point

End Sub


Close Example - VC++
Close Example [image] VC++

In this example, when the Close event fires, the code evaluates the ImageModified property to see if changes were made to the image.  If the value of the ImageModified property is True, the code prompts the user to save the image.

void CImgEdit1Dlg::OnCloseEditctrl1()

{

    // This code could be used at the time a user attempts to open

    // a new file or clear a previously displayed image in order

    // to prompt for changes to be saved if the image has been modified.

    int iSaveImg;

    if(ImgEdit1.GetImageModified())

    {

      iSaveImg = AfxMessageBox("Do you want to save changes?", MB_YESNOCANCEL);

      switch (iSaveImg)

      {

        case IDYES:

          // Save the changes

          VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default for save at zoom

          ImgEdit1.Save(evt);

          break;

          // Drop down to the Open file code

        case IDNO:

          // Don't save file, just drop down to the Open

          // file code

          break;

        case IDCANCEL:

          // User pressed cancel

          // Don't open a file, don't save changes

          return;

        }

    }

    // Open a new file at this point

}


EditingTextAnnotation Event

See Also	Example-VB
This event occurs immediately after the Image Edit control enters or exits Text Edit mode.

When the Image Edit control is in Text Edit mode, it displays the Text Edit dialog box to let end users create or modify a Text, Attach-a-Note, or Hyperlink annotation.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

Sub object_EditingTextAnnotation(Editing)

Argument

Parameter	Data Type	Setting
Editing	Boolean	True [image] The Image Edit control is entering Text Edit mode. False [image] The Image Edit control is exiting Text Edit mode.
Remarks

For this event to fire, an image must be displayed and the Image Edit control must be entering or exiting Text Edit mode.

The Image Edit control enters Text Edit mode when:

An end user double-clicks on a selected Text, Attach-a-Note, or Hyperlink annotation

The EditSelectedAnnotationText method is invoked with a Text, Attach-a-Note, or Hyperlink annotation selected

A new Text, Attach-a-Note, or Hyperlink annotation is created

The Image Edit control exits Text Edit mode when:

An end user presses the Escape key (cancel)

An end user clicks outside the Text Edit dialog box, but inside the client area

The ExecuteTextEditCommand method is invoked using the Finish command (value: 8 constant: wiFinishEditText) or the Cancel command (value: 9 constant: wiCancelEditText)

Any other method is invoked

Notes: When the Image Edit control is in Text Edit mode, the accelerator keys for Cut (Ctrl+X), Copy (Ctrl+C), Paste (Ctrl+V), Undo (Ctrl+Z) and Backspace (Ctrl+H) are processed by the Text Edit box and are therefore not passed back to the application.  In other words, an application that uses these keys as menu accelerators will not receive them when the Image Edit control is in Text Edit mode.

Hyperlink annotations are available with Imaging for Windows Professional Edition only.


EditingTextAnnotation Example - VB
EditingTextAnnotation Example [image] VB

In this example, when the EditingTextAnnotation event fires, the Undo selection on the Edit menu is updated so it indicates the action the Undo method will perform if the user invokes it.

Private Sub ImgEdit1_EditingTextAnnotation(ByVal Editing As Boolean)

    'When a text annotation is edited, this event could be used to

    'change the caption for the undo function to describe the function

    'which would be undone if the Undo menu pick was selected

    mnuEditUndo.Caption = "Undo Annotation Edit"

End Sub


Error Event

See Also	Example-VB
This event occurs when a unexpected error is encountered (such as an error condition that occurs during painting, after a mouse click, etc.).

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit and Image Annotation Tool Button controls

Syntax

Sub object_Error(Number,Description,Scode,Source,HelpFile,HelpContext,CancelDisplay)

Arguments

Parameter	Data Type	Setting
Number	Long	The native error number.
Description	String	The description of the error condition.
Scode	Long	The error return code.
Source	String	The source of the error condition.
HelpFile	String	The fully-qualified file name of the help system containing information about the error condition.
HelpContext	Long	The numeric help context ID that maps to the help topic that contains specific information about the error condition.
CancelDisplay	Boolean	Determines whether the error message is displayed: True [image] Display the error message (default). False [image] Continue processing without displaying the error message.
Remarks

This error does not occur when a property is accessed or a method is invoked using invalid parameters.


Error Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


ErrorSavingUndoInformation Event

See Also	Example-VB
This event occurs when an operation cannot save the information required to undo it.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

Sub object_ErrorSavingUndoInformation(Error)

Argument

Parameter	Data Type	Setting
Error	Long	The error that occurred.
Remarks

The value of the ContinueWithoutUndo property provides the event with the desired processing alternative.  The default is to continue the undo operation without saving the undo information.


ErrorSavingUndoInformation Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


HyperlinkGoToDoc Event

See Also	Example-VB
This event occurs when end users click a Hyperlink annotation that is linked to an image page in an external image document.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

Sub object_HyperlinkGoToDoc(Link,Page,Handled)

Argument

Parameter	Data Type	Setting
Link	String	The fully-qualified name of the destination document
Page	Long	The destination page number of the link.
Handled	Boolean	Determines the manner in which the link is handled: True [image] If the link is to the current document and page, it is not executed.  This setting is recommended if the event is handled by the application. False [image] Forces the execution of the link.
Remarks

Intradocument links are functional within TIFF documents only.


HyperlinkGoToDoc Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


HyperlinkGoToPage Event

See Also	Example-VB
This event occurs when end users click a Hyperlink annotation that is linked to an image page within the current image document.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows Professional Edition V1.0 and V1.1
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

Sub object_HyperlinkGoToPage(Page)

Argument

Parameter	Data Type	Setting
Page	Long	The destination page number of the link. If the link is to the current page, it is not executed.
Remarks

Intradocument links are functional within TIFF documents only.


HyperlinkGoToPage Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


ImageDragAndDrop Event

See Also	Example-VB
This event is fired when a user clicks inside a selection rectangle and the SingleSelectionMode property is set to True.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Edit control

Remarks

This event is used to process a drag and drop operation in an application that has implemented OLE drag and drop.


Load Event

See Also	Example-VB	Example-VC++
This event occurs immediately after the Display method is invoked.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 [image] Fit to width.  The image was fit to the width of the window when it was displayed. -2 [image] Fit to height.  The image was fit to the height of the window when it was displayed. -3 [image] 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, 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.


Load Example - VB
Load Example [image] VB

In this example, when the Load event fires, properties that control image display are set.

Private Sub ImgEdit1_Load(ByVal Zoom As Double)

    'Here are some examples of default settings you might

    'want to specify prior to displaying an image.

    'Repaint any changes immediately (ex. zoom or resolution

    'changes, etc.)

    ImgEdit1.AutoRefresh = True

    'ScrollBars already default to true, but this is

    'modifiable if desired

    ImgEdit1.ScrollBars = True

    'Scale black and white images to grayscale.  Keep color image

    'displayed as color images.

    ImgEdit1.DisplayScaleAlgorithm = wiScaleOptimize

    'Allow user to scroll image using keyboard shortcuts

    ImgEdit1.ScrollShortcutsEnabled = True

    'Display all OCR zones

    ImgEdit1.OcrZoneVisibility = wiOcrShowAllZones  '3

End Sub


Load Example - VC++
Load Example [image] VC++

In this example, when the Load event fires, properties that control image display are set.

void CImgEdit1Dlg::OnLoadEditctrl1(double Zoom)

{

    // Here are some examples of default settings you might

    // want to specify prior to displaying an image.

    // Repaint any changes immediately (ex. zoom or resolution

    // changes, etc.)

    ImgEdit1.SetAutoRefresh(TRUE);

    // ScrollBars already default to true, but this is

    // modifiable if desired

    ImgEdit1.SetScrollBars(TRUE);

    // Scale black and white images to grayscale.  Keep color image

    // displayed as color images.

    ImgEdit1.SetDisplayScaleAlgorithm(4);   // wiScaleOptimize

    // Allow user to scroll image using keyboard shortcuts

    ImgEdit1.SetScrollShortcutsEnabled(TRUE);

    // Display all OCR zones

    ImgEdit1.SetOcrZoneVisibility(3);  // wiOcrShowAllZones  // 3

}


MagnifierStatus Event

See Also	Example-VB
This event occurs when the status of the magnifier window has changed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

Sub object_MagnifierStatus(hWnd,Status,MagnifierZoom,Left,Top,Width,Height)

Arguments

Parameter	Data Type	Setting
hWnd	Stdole.OLE_HANDLE	The handle to the magnifier window
Status	Long	The current status of the magnifier window.  Can be one of the following values: 0 [image] Primary magnifier window created. 1 [image] Primary magnifier window locked.  No further status will be reported. 2 [image] Primary magnifier window closed.
MagnifierZoom	Long	The current setting of the MagnifierZoom property.  Can be one of the following values: -1 [image] The displayed image in the magnifier window is locked at the current Zoom factor  0 [image] 2 times the current Zoom factor  1 [image] 4 times the current Zoom factor  2 [image] 8 times the current Zoom factor
Left	Long	The horizontal position of the magnifier window in pixels, relative to the upper-left corner of the screen
Top	Long	The vertical position of the magnifier window in pixels, relative to the upper-left corner of the screen
Width	Long	The width of the magnifier window in pixels
Height	Long	The height of the magnifier window in pixels
Remarks

None.


MagnifierStatus Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


MarkEnd Event

See Also	Example-VB	Example-VC++
This event occurs immediately after the end user or program completes the drawing of an annotation mark.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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
Remarks

The MarkType parameter cannot be the Select Annotations annotation type.

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


MarkEnd Example - VB
MarkEnd Example [image] VB

In this example, when the MarkEnd event fires, the Undo selection on the Edit menu is updated so it indicates the action the Undo method will perform if the user invokes it.

Private Sub ImgEdit1_MarkEnd(ByVal Left As Long, ByVal Top As Long, ByVal Width As Long,

 ByVal Height As Long, ByVal MarkType As Integer,

 ByVal GroupName As String)

    'This event could be used after an annotation mark is drawn

    'to change the caption on an undo menu selection to indicate

    'what action undo will take.

    mnuEditUndo.Caption = "Undo Annotation"

End Sub


MarkEnd Example - VC++
MarkEnd Example [image] VC++

In this example, when the MarkEnd event fires, the Undo selection on the Edit menu is updated so it indicates the action the Undo method will perform if the user invokes it.

void CImgEdit2Dlg::OnMarkEnd(long Left, long Top, long Width, long Height, short MarkType,

 LPCTSTR GroupName)

{

    // This event could be used after an annotation mark is drawn

    // to change the caption on an undo menu selection to indicate

    // what action undo will take.

    mnuEditUndo.Caption = "Undo Annotation";

}


MarkMove Event

See Also	Example-VB	Example-VC++
This event occurs immediately after the end user or program moves or resizes an annotation mark.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

Sub object_MarkMove(MarkType,GroupName)

Arguments

Parameter	Data Type	Setting
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, or an empty string if more than one annotation mark is selected
Remarks

The MarkType parameter cannot be the Select Annotations annotation type.

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


MarkMove Example - VB
MarkMove Example [image] VB

In this example, when the MarkMove event fires, the Undo selection on the Edit menu is updated so it indicates the action the Undo method will perform if the user invokes it.

Private Sub ImgEdit1_MarkMove(Button As Integer, Shift As Integer, x As Single,

 y As Single)

    'This event could be used after an annotation mark is moved

    'to change the caption on an undo menu selection to indicate

    'what action undo will take.

    mnuEditUndo.Caption = "Undo Annotation Move"

End Sub


MarkMove Example - VC++
MarkMove Example [image] VC++

In this example, when the MarkMove event fires, the Undo selection on the Edit menu is updated so it indicates the action the Undo method will perform if the user invokes it.

void CImgEdit2Dlg::OnMarkMove(short Button, short Shift, long x, long y)

{

    // This event could be used after an annotation mark is moved

    // to change the caption on an undo menu selection to indicate

    // what action undo will take.

    mnuEditUndo.Caption = "Undo Annotation Move";

}


MarkSelect Event

See Also	Example-VB	Example-VC++
This event occurs immediately after the end user or program selects an annotation mark.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 [image] Left button 2 [image] Right button 4 [image] Middle button
Shift	Integer (enumerated)	Specifies whether the Shift, Ctrl, or Alt key is pressed: 1 [image] Shift key 2 [image] Ctrl key 4 [image] 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
Remarks

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

The MarkSelect event returns Left and Top coordinates that are relative to the Image Edit control. You need to add the values of the ScrollPositionX and ScrollPositionY properties to obtain the absolute position within the image.

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


MarkSelect Example - VB
MarkSelect Example [image] VB

In this example, when the MarkSelect event fires, the MarkLeft and MarkTop global variables are assigned the Left and Top coordinates of the selected annotation.

Then, the EditSelectedAnnotationText method in the cmdEditText_Click event procedure, permits the user to edit the text of the selected annotation.

Private Sub ImgEdit1_MarkSelect(ByVal Button As Integer, ByVal Shift As Integer,

 ByVal Left As Long, ByVal Top As Long, ByVal Width As Long,

 ByVal Height As Long, ByVal MarkType As Integer,

 ByVal GroupName As String)

   'Dimension MarkLeft and MarkTop as global variables so these

   'values can be passed back to the EditSelectedAnnotationText method

    MarkLeft = Left

    MarkTop = Top

End Sub

Private Sub cmdEditText_Click()

    'This would allow the user to edit the text of an existing

    'selected annotation mark

    On Error GoTo HandleIt

    'Coordinates of the mark are obtained from the MarkSelect

    'event (see code above).

    ImgEdit1.EditSelectedAnnotationText MarkLeft, MarkTop

    Exit Sub

HandleIt:

    'Handle error if no mark is selected or the wrong type

    'of mark is selected

     MsgBox Err.Description

End Sub


MarkSelect Example - VC++
MarkSelect Example [image] VC++

In this example, when the MarkSelect event fires, the m_MarkLeft and m_MarkTop variables are assigned the Left and Top coordinates of the selected annotation.

Then, the EditSelectedAnnotationText method in the CImgEdit2Dlg::OnAnnotext() procedure, permits the user to edit the text of the selected annotation.

void CImgEdit2Dlg::OnAnnotext()

{

    // This would allow the user to edit the text of an existing

    // selected annotation mark

    TRY {

      // Coordinates of the mark are obtained from the MarkSelect

      // event (see code below).

      ImgEdit1.EditSelectedAnnotationText(m_MarkLeft, m_MarkTop);

    }

    CATCH (COleDispatchException, e)

    {

      // Handle error if no mark is selected or the wrong type

      // of mark is selected

       AfxMessageBox(e->m_strDescription);

      //Err.Description

    }

    END_CATCH

}

void CImgEdit2Dlg::OnMarkSelect(short Button, short Shift, long Left,

 long Top, long Width, long Height, short MarkType, LPCTSTR GroupName)

{

    m_MarkLeft = Left;

    m_MarkTop = Top;

}


OverlayFileNotFound Event

See Also	Example-VB
This event occurs when an overlay file specified in the Page Properties dialog box cannot be found.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Edit control

Syntax

Sub object_OverlayFileNotFound(szOverlayFileName, bTryAgain)

Arguments

Parameter	Data Type	Setting
szOverlayFileName	String	The fully-qualified path name to the overlay file
bTryAgain	Boolean	True [image] Allows a user 4 attempts to provide valid path information to the overlay file. After the fourth attempt fails, an error is thrown. False [image] Terminates the operation when an incorrect path is entered, and generates an error. (default)


NextPage Event

See Also	Example-VB
This event is fired when the Page Down key is pressed at the bottom of the current page.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Edit control

Syntax

Sub object_NextPage

Remarks

This event is used to notify the application to display the next page.


PrevPage Event

See Also	Example-VB
This event is fired by the Image Edit control when the Page Up key is pressed at the top of the current page.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Edit control

Syntax

Sub object_PrevPage

Remarks

This event can be used in conjunction with the ScrollToBottom property to display the bottom of the previous page. Set ScrollToBottom to True before this event is fired. When the user presses PageUp while at the top of the image page, the bottom of the previous page is displayed.


PagePropertiesClose Event

See Also	Example-VB
This event occurs when an end user clicks OK after having changed the compression type on the Page Properties dialog box.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Edit control

Syntax

Sub object_PagePropertiesClose( )

Arguments

None

Remarks

This event gives you the opportunity to execute code that saves page changes for undo purposes.


PagePropertiesClose Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


PasteClip Event

See Also	Example-VB
This event occurs when data being pasted onto a base image is too large (dimensionally) to within the confines of the image.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Edit control

Syntax

Sub object_PasteClip(Mode)

Argument

Parameter	Data Type	Setting
Mode	Long	Determines the action to be performed when the event fires: vbYes [image] Enlarge the base image so it can accommodate the paste data (default).  The base image is enlarged by adding white data around the image borders. vbNo [image] Do not enlarge the base image, clip the paste data to the current size of the base image. vbCancel [image] Cancel the Paste operation.
Remarks

None.


PasteClip Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


PasteCompleted Event

See Also	Example-VB
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.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

Sub object_PasteCompleted( )

Arguments

None

Remarks

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


PasteCompleted Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


ReadyStateChange Event

See Also	Example-VB
This event occurs when the state of the control has changed.  When it fires, check the ReadyState property or the ReadyState parameter to ascertain the readiness state of the control.

You can use the ReadyState property and ReadyStateChange event to manage the asynchronous downloading of images from the World Wide Web.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
Applies To

Image Annotation Tool Button control, Image Edit control

Syntax

Sub object_ReadyStateChange(ReadyState)

Argument

Parameter	Data Type	Setting
ReadyState	Long	The readiness state of the control: 0 [image] The control is initializing and retrieving properties; cannot perform methods 2 [image] The control has initialized and downloading has started; cannot perform methods 4 [image] The control is ready for all requests; can perform methods
Remarks

This event is useful when the Image property is set to a URL pathname.

The control can perform methods only when its ReadyState property is 4.


ReadyStateChange Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


Scroll Event

See Also	Example-VB
This event occurs immediately after the end user or program scrolls an image in the control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

Sub object_Scroll( )

Arguments

None

Remarks

None


Scroll Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


SelectionRectDrawn Event

See Also	Example-VB	Example-VC++
This event occurs immediately after the end user releases the mouse button after drawing a selection rectangle, or the DrawSelectionRect method is invoked.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


SelectionRectDrawn Example - VB
SelectionRectDrawn Example [image] VB

In this example, when the SelectionRectDrawn event fires, its parameters are evaluated.  A state variable is then set to True or False to indicate whether a selection rectangle has been drawn by the user.

Private Sub ImgEdit1_SelectionRectDrawn(ByVal Left As Long, ByVal Top As Long,

 ByVal Width As Long, ByVal Height As Long)

    'If the parameters returned by this event are all 0, the user

    'has clicked on the image and removed a previously drawn rectangle

    'If parameters have values, a rectangle has been drawn (note that

    'blnIsRectangle would need to be set to False if another image

    'is opened/created or another page is displayed).

    'This technique could also be used for enabling disable cut/copy

    'paste menu picks.

    Dim blnIsRectangle As Boolean

    If Width + Height = 0 Then

        blnIsRectangle = False

    Else

        blnIsRectangle = True

    End If

End Sub


SelectionRectDrawn Example - VC++
SelectionRectDrawn Example [image] VC++

In this example, when the SelectionRectDrawn event fires, its parameters are evaluated.  A state variable is then set to True or False to indicate whether a selection rectangle has been drawn by the user.

void CImgEdit1Dlg::OnSelectionRectDrawn(long Left, long Top, long Width, long Height)

{

    // If the parameters returned by this event are all 0, the user

    // has clicked on the image and removed a previously drawn rectangle

    // If parameters have values, a rectangle has been drawn

    // IsRectangle would need to be set to false if another image

    // is opened/created or another page is displayed.

    // This technique could also be used for enabling disable cut copy

    // paste menu picks.

    if (Width + Height == 0)

      blnIsRectangle = FALSE;

    else

      blnIsRectangle = TRUE;

}


StraightenPage Event

See Also	Example-VB
This event occurs immediately after the end user straightens a page and then clicks OK on the Straighten Page dialog box.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Edit control

Syntax

Sub object_StraightenPage( )

Arguments

None

Remarks

This event works in conjunction with the ManualDeSkew method.


StraightenPage Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


ToolPaletteHidden Event

See Also	Example-VB	Example-VC++
This event occurs immediately after the Annotation Tool Palette has been hidden.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


ToolPaletteHidden Example - VB
ToolPaletteHidden Example [image] VB

In this example, when the ToolPaletteHidden event fires, the TPLeft and TPTop global variables are assigned to the coordinates of the Annotation Tool Palette (before it was hidden).

These values can be used by the ShowAnnotationToolPalette method to have the tool palette reappear at the same coordinates.

Private Sub ImgEdit1_ToolPaletteHidden(ByVal Left As Long, ByVal Top As Long)

    'This event could be used to track the current location of

    'the tool palette when it is hidden so that it could be shown

    'at the same location when it is shown again.

    'Dimension TPLeft and TPTop as global long variables

    TPLeft = Left

    TPTop = Top

    'Pass TPLeft and TPTop in to the ShowAnnotationToolPalette

    'method.

End Sub


ToolPaletteHidden Example - VC++
ToolPaletteHidden Example [image] VC++

In this example, when the ToolPaletteHidden event fires, the TPLeft and TPTop global variables are assigned to the coordinates of the Annotation Tool Palette (before it was hidden).

These values can be used by the ShowAnnotationToolPalette method to have the tool palette reappear at the same coordinates.

void CImgEdit2Dlg::OnToolPaletteHidden(long Left, long Top)

{

    // This event could be used to track the current location of

    // the tool palette when it is hidden so that it could be shown

    // at the same location when it is shown again.

   // Dimension TPLeft and TPTop as global long variables

   long TPLeft = Left;

   long TPTop = Top;

   // Pass TPLeft and TPTop in to the ShowAnnotationToolPalette

   // method.

}


ToolTip Event

See Also	Example-VB
This event occurs immediately after a tool tip has been displayed on the Annotation Tool Palette.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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
Remarks

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


ToolTip Example [image] VB

This example shows how to set the Annotation BackColor Property.

Private Sub AssignBackColor()  'General procedure to assign the background color

End Sub


ToolSelected Event

See Also	Example-VB	Example-VC++
This event occurs immediately after the end user selects a tool from the Annotation Tool Palette.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Edit control

Syntax

Sub object_ToolSelected(ToolID)

Argument

Parameter	Data Type	Setting
ToolID	Integer (enumerated)	Identifier of the tool, which corresponds to the Tool ID settings
Remarks

The ShowAnnotationToolPalette method does not have to be invoked to trigger this event.  The SelectTool method can be used to select the annotation tool in the Annotation Tool Palette.


ToolSelected Example - VB
ToolSelected Example [image] VB

In this example, when the ToolSelected event fires, all of the annotation tool names that appear in the Tools menu are unchecked.  (There is one menu item for each annotation tool in the Annotation Tool Palette.)

Then, according to the value of the ToolID parameter, the procedure checks the menu item that corresponds to the annotation tool selected by the user.

Private Sub ImgEdit1_ToolSelected(ByVal ToolId As Integer)

    'This event could be used to keep menu selections in

    'sync with selections made from the Annotation Tool Palette

    'Initialize all menu selections to unchecked

    mnuToolsAnnoSelect.Checked = False

    mnuToolsFreeLine.Checked = False

    mnuToolsHighLine.Checked = False

    mnuToolsStraightLine.Checked = False

    mnuToolsHollowRect.Checked = False

    mnuToolsFilledRect.Checked = False

    mnuToolsText.Checked = False

    mnuToolsNote.Checked = False

    mnuToolsTextFile.Checked = False

    mnuToolsStamp.Checked = False

    mnuToolsHyperlinks.Checked = False

    'Use the ToolId parameter to determine which tool

    'the user selected and then check the corresponding

    'menu item.

    Select Case ToolId

       Case 1

         mnuToolsAnnoSelect.Checked = True

       Case 2

         mnuToolsFreeLine.Checked = True

        Case 3

          mnuToolsHighLine.Checked = True

        Case 4

          mnuToolsStraightLine.Checked = True

        Case 5

          mnuToolsHollowRect.Checked = True

        Case 6

          mnuToolsFilledRect.Checked = True

        Case 7

          mnuToolsText.Checked = True

        Case 8

          mnuToolsNote.Checked = True

        Case 9

          mnuToolsTextFile.Checked = True

        Case 10

          mnuToolsStamp.Checked = True

        Case 11

          mnuToolsHyperlinks.Checked = True

    End Select

End Sub


ToolSelected Example - VC++
ToolSelected Example [image] VC++

In this example, when the ToolSelected event fires, all of the annotation tool names that appear in the Tools menu are unchecked.  (There is one menu item for each annotation tool in the Annotation Tool Palette.)

Then, according to the value of the ToolID parameter, the procedure checks the menu item that corresponds to the annotation tool selected by the user.

void CImgEdit2Dlg::OnToolSelected(short ToolId)

{

    // Demonstrates using this event to keep menu selections in

    // sync with selections made from the Annotation Tool Palette

    // Initialize all menu selections to unchecked

    mnuToolsAnnoSelect.Checked = False;

    mnuToolsFreeLine.Checked = False;

    mnuToolsHighLine.Checked = False;

    mnuToolsStraightLine.Checked = False;

    mnuToolsHollowRect.Checked = False;

    mnuToolsFilledRect.Checked = False;

    mnuToolsText.Checked = False;

    mnuToolsNote.Checked = False;

    mnuToolsTextFile.Checked = False;

    mnuToolsStamp.Checked = False;

    mnuToolsHyperlinks.Checked = False;

    // Use the ToolId parameter to determine which tool

    // the user selected and then check the corresponding

    // menu item.

    switch (ToolId)

    {

      case 1:

        mnuToolsSelectArrow.Checked = True;

      case 2:

        mnuToolsSelectFreeLine.Checked = True;

      case 3:

        mnuToolsSelectHighLine.Checked = True;

      case 4:

        mnuToolsStraightLine.Checked = True;

      case 5:

        mnuToolsSelectHollowRect.Checked = True;

      case 6:

        mnuToolsSelectFilledRect.Checked = True;

      case 7:

        mnuToolsSelectText.Checked = True;

      case 8:

        mnuToolsSelectNote.Checked = True;

      case 9:

        mnuToolsSelectTextFile.Checked = True;

      case 10:

        mnuToolsSelectStamp.Checked = True;

      case 11:

        mnuToolsSelectHyperlinks.Checked = True;

    }

}


ZoomChanged Event

See Also	Example-VB
This event is fired after the user enters a new zoom factor.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Edit and Image Annotation Tool Button controls

Syntax

Sub object_ZoomChanged(Zoom)

Argument

Parameter	Data Type	Setting
Zoom	Float	New zoom factor
Remarks

If the ZoomMode property is set to Inch-to-Inch, and the value specified by the user translates to a constant that is less than 20, or more than 65,535, the control recalculates the zoom factor and then fires the event.


Annotation types

The Image Edit Control supports 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 Highlights text when drawn using the transparent line style
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
Hyperlink	Enters a hypertext link directly on an image; invokes the Link To dialog box to permit end users to specify the desired link
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)
Initials	Places a stamp with the user’s Id on the image
OCR Zones	Draws an OCR Text or Picture zone on an image
Select Annotations	Selects annotation marks for deleting, modifying, moving, or resizing
Straight Line	Underlines text, demarcates a section of a page, or draws callout lines Highlights text when drawn using the transparent line style
Text	Enters text directly on an image
Text From File	Enters text from a file on an image
Text Stamp	Places a text stamp directly on an image
Note:  Hyperlink and OCR Zones are available with Imaging for Windows Professional Edition Edition (V1.0, V1.1, V2.0, and V2.5) only.


PageType settings

The following list shows the valid PageType settings:

Constant	Setting	Description
wiPageTypeBW	1	Black-and-white
wiPageTypeGray4	2	Gray scale, 4-bit
wiPageTypeGray8	3	Gray scale, 8-bit
wiPageTypePal4	4	Palettized, 4-bit
wiPageTypePal8	5	Palettized, 8-bit
wiPageTypeRGB24	6	RGB, 24-bit
wiPageTypeBGR24	7	BGR, 24-bit
Note:  Palettized4 is not available as a parameter for the ConvertPageType method unless the image presently has a 4-bit palette).


PageType settings

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

Constant	Setting	Description	Prerequisite FileType
wiPageTypeBW	1	Black-and- white	1 [image] TIFF,  2 [image] AWD, or 3 [image] BMP
wiPageTypeGray4	2	Gray4	1 [image] TIFF
wiPageTypeGray8	3	Gray8	1 [image] TIFF
wiPageTypePal4	4	Palettized4	1 [image] TIFF or 3 [image] BMP
wiPageTypePal8	5	Palettized8	1 [image] TIFF or 3 [image] BMP
wiPageTypeRGB24	6	RGB24	1 [image] TIFF
wiPageTypeBGR24	7	BGR24	3 [image] BMP
Notes: AWD is not available with Imaging for Windows NT 4.0.

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


Annotation Type settings

The following list shows the valid AnnotationType settings:

Setting	Setting	Description
wiNone	0 (default)	None
wiStraightLine	1	Straight Line
wiFreehandLine	2	Freehand Line
wiHollowRect	3	Hollow Rectangle
wiFilledRect	4	Filled Rectangle
wiImageEmbedded	5	Image Embedded
wiImageReference	6	Image Reference
wiText	7	Text
wiTextStamp	8	Text Stamp
wiTextFromFile	9	Text From File
wiTextAttachment	10	Attach-a-Note
wiAnnotationSelection	11	Select Annotations
wiHyperlink	12	Hyperlink
wiOcrRegion	13	OCR Zone
wiInitials	14	Initials
Note:  Hyperlink and OCR Zones are available with Imaging for Windows Professional Edition (V1.0, V1.1, V2.0, and V2.5) only.


FileType settings

The following list shows the valid FileType settings:

Constant	Setting	Description
wiFileTypeTIFF	1	TIFF
wiFileTypeAWD	2	AWD
wiFileTypeBMP	3	BMP
wiFileTypePCX	4	PCX
wiFileTypeDCX	5	DCX
wiFileTypeJPG	6	JPG
wiFileTypeXIF	7	XIF
wiFileTypeGIF	8	GIF
wiFileTypeWIFF	9	WIFF
Displayed file types of PCX, DCX, JPG, XIF, GIF, or WIFF must be saved using a FileType setting of 1 (TIFF), 2 (AWD), or 3 (BMP).

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

A file with a .JFX extension is also a TIFF file type.

Note:  AWD is not available with Imaging for Windows NT 4.0.

GIF and WIFF are available with Imaging for Windows Professional Edition (V1.0, V1.1, V2.0, and V2.5); and Imaging for Windows 98.


CompressionType settings

The following list shows the valid CompressionType settings:

Setting	Description
1	No compression
2	Group3(1D)
3	Group3(Modified Huffman)
4	PackBits
5	Group4(2D)
6	JPEG
7	Reserved
8	Group3(2D) (read only)
9	LZW
AWD and BMP files must be saved using a CompressionType setting of 1.

Note:  AWD is not available with Imaging for Windows NT 4.0.


CompressionInfo settings

The following list shows the valid CompressionInfo settings (bit-wise values):

Setting	Description
0	No compression [image] If CompressionType is set to 1 (no compression) Default compression [image] 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	Low Resolution/High Quality (JPEG compression only)
128	Low Resolution/Medium Quality (JPEG compression only)
256	Low Resolution/Low Quality (JPEG compression only)
512	Medium Resolution/High Quality (JPEG compression only)
1024	Medium Resolution/Medium Quality (JPEG compression only)
2048	Medium Resolution/Low Quality (JPEG compression only)
4096	High Resolution/High Quality (JPEG compression only)
8192	High Resolution/Medium Quality (JPEG compression only)
16384	High Resolution/Low Quality (JPEG compression only)
AWD, BMP, and other uncompressed files must be saved using a CompressionInfo setting of 0.  LZW-compressed files must be saved using a CompressionInfo setting of 8.

Note:  AWD is not available with Imaging for Windows NT 4.0.


Tool ID settings

The following list shows the valid Tool ID settings:

Parameter	Data Type	Setting	Description
ToolID	Integer (enumerated)	0 1 2 3 4 5 6 7 8 9 10 11 12 13	No Tool Select Annotations Freehand Line Highlighter Straight Line Hollow Rectangle Filled Rectangle Text Attach-a-Note Text From File Rubber Stamp Hyperlink OCR Zones Initials
Note:  Hyperlink and OCR Zone Tool ID settings are available with Imaging for Windows Professional Edition (V1.0, V1.1, V2.0, and V2.5) only.


Annotation Tool Palette
Palette

Click on the components of the Annotation Tool Palette to see an explanation of each one.


Selection Pointer
Select Annotations and Zones

The only tool that does not draw an annotation, the Select Annotations and Zones tool is used to select single or multiple annotation marks, including OCR zones.

End users can select annotation marks and zones by clicking on them, or by dragging a selection rectangle around them.

Note:  OCR Zone annotations are available with Imaging for Windows Professional Edition (V1.0, V1.1, V2.0, and V2.5) only.


Highlighter

The Highlighter tool is used to draw a transparent, filled rectangle for highlighting emphasis.

Tip

End users can right-click on the tool to set the highlight color.


Hollow Rectangle

The Hollow Rectangle tool is used to place a border around areas of an image for emphasis.

Tip

End users can right-click on the tool to set line properties, such as width, style, and color.


Text

The Text tool is used to enter text directly on an image.

Tip

End users can right-click on the tool to set font properties, such as name, style, size, color, script, strikethrough, and underline.


Text From File

The Text From File tool is used to enter text from a file onto an image.  When used, it invokes the Select Text File dialog box, which permits users to select the desired text file.

Tip

End users can right-click on the tool to set font properties, such as name, style, size, color, script, strikethrough, and underline.


Freehand Line

The Freehand Line tool is used to draw a freehand line on a section of text or a portion of an image for emphasis.

Tip

End users can right-click on the tool to set the line properties, such as width and color.


Straight Line

The Straight Line tool is used to underline text, demarcate a section of a page, or draw callout lines.

Tip

End users can right-click on the tool to set the line properties, such as width and color.


Filled Rectangle

The Filled Rectangle tool is used to create a color background for text annotations or to hide a portion of an image.

Tip

End users can right-click on the tool to set the fill color.


Attach-a-Note

The Attach-a-Note tool is used to enter text into a background rectangle on an image.

Tip

End users can right-click on the tool to set the background color and font properties, such as name, style, size, color, script, strikethrough, and underline.


Rubber Stamp

The Rubber Stamp tool is used to place an image or text stamp onto an image.

Tip

End users can right-click on the tool to format the stamp text.


Hyperlink

The Hyperlink tool is used to enter a hypertext link directly on an image.  When used, it invokes the Link To dialog box, which permits users to specify the desired link.

Tip

End users can right-click on the tool to set font properties, such as name, style, size, color, script, strikethrough, and underline.

Note

The Hyperlink tool is available with Imaging for Windows Professional Edition (V1.0, V1.1, V2.0, and V2.5) only.


Fully-qualified image document names

A fully-qualified image document name includes the complete path to where the image document file or managed image document resides.  There are several formats, depending on the file system or document management database in use. Refer to the following path types and examples.

Windows [image] Windows paths follow the conventions for drive, folder, and filenames used by Windows 95, Windows 98, Windows NT 4.0, and Windows 2000.

c:\insurance\claims\claim234.tif

UNC (Universal Naming Convention) [image] addresses are supported by Imaging for Windows Professional Edition V2.0 and later.

\\INSURANCE\CLAIMS\CLAIM234.TIF

URL (Uniform Resource Locator) [image] URLs can be either HTTP (HyperText Transfer Protocol) or FTP (File Transfer Protocol) addresses. URL addressing is supported by Imaging for Windows Professional Edition V2.0 or later. Keep in mind that some properties and methods do not support URLs.

http://www.dxcessinsurance.com/auto/claims.tif or ftp://ftp.dxcess.ins.net/pub/access/claims.tif

Imaging 1.x Server Document Manager database [image] For 1.x documents, all paths must begin with the prefix “Image://” to denote 1.x documents or files, followed by the server name (DXCESS), and the database or volume name (ins_db1). Next is cabinet name (INSURANCE), drawer name (AUTO), folder name (CLAIMS), and finally file name (CLAIM234). Slashes must be used to separate nodes, as shown in the following example:

Image://DXCESS/ins_db1:/INSURANCE/AUTO/CLAIMS/CLAIM234

The drawer name is optional. If you do not use it, however, you must use two slashes between the cabinet (INSURANCE) and folder (CLAIMS) nodes.

Image://DXCESS/ins_db1:/INSURANCE//CLAIMS/CLAIM234

Imaging 1.x Server Image File volume [image] } For 1.x files, all paths must begin with the prefix “Image://” to denote 1.x files, followed by the server name (DXCESS), and the database or volume name (images). Next is the subdirectory name (auto) and finally the file name (claims.tif).

Image://DXCESS\images:\auto\claims.tif

Notes: The file or document names of images saved to Imaging 1.x Servers must not contain any of the following characters: Angle brackets (< >), asterisks (*), colons (:), question marks (?), quotes ("), slashes (\ /), or vertical bars (|).

Imaging 1.x Server access is available with Imaging for Windows Professional Edition V1.1 and later.

Enterprise Imaging Document Manager database [image] Enterprise Imaging documents can be accessed using either a short or a long name. The short name is the image’s external name. The following line of VB code assigns to the Image property an Enterprise Imaging document named test2.

Imgadmin1.Image = "Imagex://test2"

The long (or compound) name is constructed by concatenating the image document’s external name, the domain name, and the document’s internal identifier, each separated by a delimiter. The following line of VB code assigns a long name.

Imgadmin1.Image = "Imagex://test2%anydomain%8251XYZ000003%"

"test2" is the external name

"%" is the delimiter

"anydomain" is the domain name

"8251XYZ000003" is the internal identifier

The external name is not unique [image] more than one Enterprise Imaging document can have the same external name. If you assign only the external name to the Image property, the program opens the first document with the specified external name that it locates. To uniquely identify an Enterprise Imaging document, use the long name format.

Notes: Enterprise Imaging documents are read-only.

Enterprise Imaging server access is available with Imaging for Windows Professional Edition V1.1 and later.


Extender Properties (Image Edit)
Image Edit Extender Properties

See Also	Example
This topic lists the Extender properties that are available when the Image Edit control is drawn on a Visual Basic form.

Name	Description
Container	Returns the container of an object
DataBindings	Returns the DataBindings collection object containing the available bindable properties
DataChanged	Returns or sets a value indicating that the data in the bound Image Edit control has been changed by some process other than that of retrieving data from the current record
DataField	Returns or sets a value that binds the Image Edit control to a field in the current record
DragIcon	Returns or sets the mouse pointer icon in a drag-and-drop operation
DragMode	Returns or sets the drag mode (manual or automatic)
Height	Returns or sets the height of an object
HelpContextID	Returns or sets the Help context ID for an object
Index	Returns or sets the subscript value of a control in an array of controls
Left	Returns or sets the distance between the left edge of an object and the left edge of its container
Name	Returns the name of an object
Object	Returns a reference to a property or method of a control that has the same name as a property or method extended to the control
Parent	Returns the form, object, or collection that contains either a control, or another object or collection
TabIndex	Returns or sets the tab order of an object within its parent
TabStop	Returns or sets whether the Tab key can be used to move focus to an object
Tag	Returns or sets ancillary data
ToolTipText	Returns or sets a tool tip.
Top	Returns or sets the distance between the top edge of an object and the top edge of its container
Visible	Returns or sets whether an object is visible or hidden
WhatsThisHelpID	Returns or sets the context-sensitive help ID for an object
Width	Returns or sets the width of an object
Refer to the Visual Basic on-line help for more information about these properties.


Extender Methods (Image Edit)
Image Edit Extender Methods

See Also	Example
This topic lists the Extender methods that are available when the Image Edit control is drawn on a Visual Basic form.

Name	Description
Drag	Begins, ends, or cancels a drag operation.
Move	Moves an object
SetFocus	Gives focus to the object specified
ShowWhatsThis	Displays the help topic corresponding to the value of the WhatsThisHelpID property
Zorder	Places an object at the front or back of the z-order within its graphical level
Refer to the Visual Basic on-line help for more information about these methods.


Extender Events (Image Edit)
Image Edit Extender Events

See Also	Example
This topic lists the Extender events that are available when the Image Edit control is drawn on a Visual Basic form.

Name	Description
Click	Fires when a user presses and then releases a mouse button over an object
DblClick	Fires when a user presses and releases a mouse button twice over an object
DragDrop	Fires when a drag-and-drop operation is completed.
DragOver	Fires when a drag-and-drop operation is in progress
Error	Fires when an error occurs
GotFocus	Fires when an object receives focus
KeyDown	Fires when a user presses a key while the object has focus
KeyPress	Fires when a user presses and then releases a key while the object has focus
KeyUp	Fires when a user releases a key while the object has focus
LostFocus	Fires when an object loses focus
MouseDown	Fires when a user presses a mouse button
MouseMove	Fires when a user moves the mouse
MouseUp	Fires when a user releases a mouse button
Refer to the Visual Basic on-line help for more information about these events.


Image Admin Control

See Also	Properties	Methods	Events
What the Image Admin control lets you do

The Image Admin control lets you [image] the application developer [image] add image file management functions to applications using the Imaging ActiveX controls.

The Image Admin control can manage files that reside locally or on a local area network (LAN), and documents that reside on Eastman Software’s Imaging 1.x and Enterprise Imaging servers. Read/Write access is supported for Imaging 1.x documents, and Read-only access for Enterprise Imaging documents. File and Print common dialog boxes support specific image file options as well as general directory and file functions.

What the Image Admin control lets your users do

Depending on how you design and code your application, the Image Admin control lets your users:

Create and delete directories

Create and delete image files

Open, save, and print image documents

Append, insert, and replace pages in multipage image documents and 1.x server documents

Manage File (Summary) properties


Extender Properties (Image Admin)
Image Admin Extender Properties

See Also	Example
This topic lists the Extender properties that are available when the Image Admin control is drawn on a Visual Basic form.

Name	Description
Index	Returns or sets the subscript value of a control in an array of controls
Name	Returns the name of an object
Object	Returns a reference to a property or method of a control that has the same name as a property or method extended to the control
Parent	Returns the form, object, or collection that contains either a control, or another object or collection
Tag	Returns or sets ancillary data
Refer to the Visual Basic on-line help for more information about these properties.


Author Property

See Also	Example-VB	Example-VC++
Returns or sets the Author property of the current image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98 (read only)
Applies To

Image Admin control

Syntax

object.Author[=value]

Data Type

String

Remarks

This property pertains to local/redirected TIFF files, and 1.x files (not documents).

Setting this property does not write the change to disk. To do so, you must call the SetFileProperties method, or, choose OK in the dialog box created by the ShowFileProperties method.

The current setting of this property can be displayed and changed from the Summary tab on the dialog box created by the ShowFileProperties method.


Author Example - VB
Author Example [image] VB

This example shows how you can set several file properties. These properties can also be set by the user at runtime from the UI dialog box created by the ShowFileProperties method.

Private Sub cmdSetProperties_Click()

    'Specify the image you are going to set properties for.

    ImgAdmin1.Image = "D:\image2\hopolicy.tif"

    ImgAdmin1.Title = "HomeOwners Policy"

    ImgAdmin1.Author = "John Q. Agent"

    'Add multiple keywords.

    ImgAdmin1.Keywords = "insurance important house"

    ImgAdmin1.Comments = "1997 Homeowners Policy"

    ImgAdmin1.Subject = "Insurance"

    'Call SetFileProperties to actually write the properties to the file.

    ImgAdmin1.SetFileProperties

End Sub


Author Example - VC++
Author Example [image] VC++

This example shows how you can set several file properties. These properties can also be set by the user at runtime from the UI dialog box created by the ShowFileProperties method.

void CAdmin1Dlg::OnFileproperties()

{

    // Specify the image you are going to set properties for.

    ImgAdmin1.SetImage ("D:\\image2\\hopolicy.tif");

    ImgAdmin1.SetTitle ("HomeOwners Policy");

    ImgAdmin1.SetAuthor ("John Q. Agent");

    // Adding multiple keywords.

    ImgAdmin1.SetKeywords ("insurance important house");

    ImgAdmin1.SetComments ("1997 Homeowners Policy");

    ImgAdmin1.SetSubject ("Insurance");

    // Call SetFileProperties to actually write the properties to the file.

    ImgAdmin1.SetFileProperties();

}


Browse1xReturnedPath Property

See Also	Example-VB
Specifies the path returned by the Browse1X method.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.Browse1xReturnedPath[=value]

Data Type

String

Remarks

This property is read-only.


Browse1xReturnedType Property

See Also	Example-VB
Specifies the type of path returned by the Browse1X method.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.Browse1xReturnedType[=value]

Data Type

String

Remarks

This property is read-only.

Path types are:

 IFS (imaging file system) that displays a directory structure

 DM (document management system) that displays nodes such as database, cabinet, drawer, or folder


CancelError Property

See Also	Example-VB	Example-VC++
Returns or sets whether an error will be returned when a user chooses Cancel from any of the following dialog boxes: Browse, Logon, Imaging Server Options, Open or Save As, File Properties, Find, or Print.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Note: This property is not recognized by the File Properties dialog box (through the ShowFileProperties method) in Imaging for Windows 98 and Imaging for Windows Professional Edition, Versions V1.0 and V1.1.

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 any of the dialog boxes
False	No error is returned when the user chooses Cancel
Remarks

When a user chooses Cancel from any of the dialog boxes listed below, and the CancelError property is set to True, an error is returned by the corresponding method.

Dialog Box	Method
Browse	Browse1x
File Properties	ShowFileProperties
Find	ShowFindDialog
Imaging Server Options	Show1xServerOptDlg
Logon	LoginToServer
Open	ShowFileDialog
Print	ShowPrintDialog
Save As	ShowFileDialog


CancelError Example - VB
CancelError Example [image] VB

This example uses the ShowPrintDialog method to enable the user to specify printing parameters. The image displayed in the Image Edit control is then printed.

Private Sub cmdPrint_Click()

    On Error GoTo PrintErr

    'Display an image

    ImgEdit1.Image = "D:\image2\4page.tif"

    ImgEdit1.Display

    'Reset NumCopies in case user printed multiple copies last time.

    ImgAdmin1.PrintNumCopies = 1

    'If CancelError is true, an error is generated if user presses
    'cancel.  Trap the error to avoid trying to print the file.

    ImgAdmin1.CancelError = True

    'Set filename to be printed to the displayed file. If this property
    'is not set the dialog box will not display.

    ImgAdmin1.Image = ImgEdit1.Image

    ImgAdmin1.ShowPrintDialog Form1.hWnd

    'Print the image using the parameters obtained from the print
    'dialog box (for example, start page, end page, and so on).

    ImgEdit1.PrintImage ImgAdmin1.PrintStartPage,
        ImgAdmin1.PrintEndPage, ImgAdmin1.PrintOutputFormat,
        ImgAdmin1.PrintAnnotations

PrintErr:

    'User pressed the cancel button

        Exit Sub

End Sub


CancelError Example - VC++
CancelError Example [image] VC++

This example uses the ShowPrintDialog method to enable the user to specify printing parameters. The image displayed in the Image Edit control is then printed.

void CAdmin1Dlg::OnPrint()

{

    // Display an image

    ImgEdit1.SetImage ("D:\\image2\\4page.tif");
    ImgEdit1.Display();

    // Reset NumCopies in case user printed multiple copies last time.

    ImgAdmin1.SetPrintNumCopies (1);

    // If CancelError is true, an error is generated if user presses
    // cancel.  Trap the error to avoid trying to print the file.

    ImgAdmin1.SetCancelError (TRUE);

    // Set filename to be printed to the displayed file. If this property
    // is not set the dialog box will not display.

    ImgAdmin1.SetImage (ImgEdit1.GetImage());
    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;
    V_I4(&vhWnd) = (long)m_hWnd;

    // Use Try and Catch around ShowPrintDialog to catch Cancel error.
    // If Cancel is pressed then the Catch will capture the error exception.

Try

{

    ImgAdmin1.ShowPrintDialog (vhWnd);

    // Print the image using the parameters obtained from the print
    // dialog box (ex. start page, end page etc.).

    VARIANT vStart, vEnd, vOutputFormat, vAnnotations, evt;
    evt.vt = VT_ERROR;      // set to error for optional parameter

    V_I4(&vStart) = ImgAdmin1.GetPrintStartPage();
    V_I4(&vEnd) = ImgAdmin1.GetPrintEndPage();
    V_I4(&vOutputFormat) = ImgAdmin1.GetPrintOutputFormat();
    V_I4(&vAnnotations) = ImgAdmin1.GetPrintAnnotations();

    ImgEdit1.PrintImage (vStart, vEnd, vOutputFormat ,
        vAnnotations, evt, evt, evt);

  }

  catch(COleDispatchException* e)

  {

    //Handle error in print dialog or in actual printing of the image

    CstringCStrErr;

    CstrErr += “Error Description: ” = e->m_strDescription;

    AfxMessageBox( CstrErr );

  }

}


Comments Property

See Also	Example-VB	Example-VC++
Specifies the Comments property of the current image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98 (read only)
Applies To

Image Admin control

Syntax

object.Comments[=value]

Data Type

String

Remarks

This property pertains to local/redirected TIFF files, and 1.x files (not documents).

Setting this property does not write the change to disk. To do so, you must call the SetFileProperties method, or, choose OK in the dialog box created by the ShowFileProperties method.

The current setting of this property can be displayed and changed from the Summary tab on the dialog box created by the ShowFileProperties method.


Comments Example - VB
Comments Example [image] VB

This example shows how you can set several file properties. These properties can also be set by the user at runtime from the UI dialog box created by the ShowFileProperties method.

Private Sub cmdSetProperties_Click()

    'Specify the image you are going to set properties for.

    ImgAdmin1.Image = "D:\image2\hopolicy.tif"

    ImgAdmin1.Title = "HomeOwners Policy"

    ImgAdmin1.Author = "John Q. Agent"

    'Add multiple keywords.

    ImgAdmin1.Keywords = "insurance important house"

    ImgAdmin1.Comments = "1997 Homeowners Policy"

    ImgAdmin1.Subject = "Insurance"

    'Call SetFileProperties to actually write the properties to the file.

    ImgAdmin1.SetFileProperties

End Sub


Comments Example - VC++
Comments Example [image] VC++

This example shows how you can set several file properties. These properties can also be set by the user at runtime from the UI dialog box created by the ShowFileProperties method.

void CAdmin1Dlg::OnFileproperties()

{

    // Specify the image you are going to set properties for.

    ImgAdmin1.SetImage ("D:\\image2\\hopolicy.tif");

    ImgAdmin1.SetTitle ("HomeOwners Policy");

    ImgAdmin1.SetAuthor ("John Q. Agent");

    // Adding multiple keywords.

    ImgAdmin1.SetKeywords ("insurance important house");

    ImgAdmin1.SetComments ("1997 Homeowners Policy");

    ImgAdmin1.SetSubject ("Insurance");

    // Call SetFileProperties to actually write the properties to the file.

    ImgAdmin1.SetFileProperties();

}


CompressionInfo Property

See Also	Example-VB
Returns the bitwise compression options set for the current image.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
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.

0	No flags or options are set. This is the default value if the Image property is empty.
1	EOL [image] include or expect standard end of line bit sequences
2	Packed lines [image] data is not byte aligned
4	Prefixed EOLs [image] 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 [image] indicates data is stored with black bits equal to 0 (zero)
Note:  Values 64 to 16384 pertain only to JPEG compression.

64	Low resolution, high quality
128	Low resolution, medium quality
256	Low resolution, low quality
512	Medium resolution, high quality
1024	Medium resolution, medium quality
2048	Medium resolution, low quality
4096	High resolution, high quality
8192	High resolution, medium quality
16384	High resolution, 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.


CompressionInfo Example [image] VB


CompressionType Property

See Also	Example-VB	Example-VC++
Returns the compression type of the current image.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
Applies To

Image Admin control

Syntax

object.CompressionType[=value]

Data Type

CompressionTypeValue (Integer)

Constant	Setting	Description
CompTypeUnk	0	Unknown
CompTypeNone	1	No compression
CompTypeGroup3	2	Group 3 1D FAX
CompTypeGroup3Huff	3	Group 3 Modified Huffman
CompTypePacked	4	PackBits
CompTypeGroup4	5	Group 4 2D FAX
CompTypeJPEG	6	JPEG
	7	Reserved
CompTypeGroup32DFax	8	Group 3 2D FAX
CompTypeLZW	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.


CompressionType Example - VB
CompressionType Example [image] VB

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties to request information about a file. Attributes for specific page of a specific file will be displayed.

Private Sub cmdGetInfo_Click()

    Dim strImgFileType, strImgCompType, strImgPageType As String

    ImgAdmin1.Image = "D:\image2\4page.tif"

    'Must specify page number if other than page 1

    ImgAdmin1.PageNumber = 2

    'Load the form where we will display file attributes.

    Load frmInfo

    'Read the Filetype property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.FileType

        Case 0
            strImgFileType = "Unknown"

        Case 1
            strImgFileType = "TIF"

        Case 2
            strImgFileType = "AWD"

        Case 3
            strImgFileType = "BMP"

        Case 4
            strImgFileType = "PCX"

        Case 5
            strImgFileType = "DCX"

        Case 6
            strImgFileType = "JPG"

        Case 7
            strImgFileType = "XIF"

        Case 8
            strImgFileType = "GIF"

        Case 9
            strImgFileType = "WIF"

    End Select

    frmInfo.lblImgInfo(0).Caption = strImgFileType

    'Read the CompressionType property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.CompressionType

        Case 0
            strImgCompType = "Unknown"

        Case 1
            strImgCompType = "No Compression"

        Case 2
            strImgCompType = "Group3(1D)"

        Case 3
            strImgCompType = "Group3(Modified Huffman)"

        Case 4
            strImgCompType = "PackBits"

        Case 5
            strImgCompType = "Group4(2D)"

        Case 6
            strImgCompType = "JPEG"

        Case 7
            strImgCompType = "RBA"

        Case 8
            strImgCompType = "Group3(2D)"

        Case 9
            strImgCompType = "LZW"

    End Select

    frmInfo.lblImgInfo(1).Caption = strImgCompType

    'Read the PageType property and translate the value to a
    'corresponding string.

    Select Case ImgAdmin1.PageType

        Case 0
            strImgPageType = "Unknown"

        Case 1
            strImgPageType = "Black and White"

        Case 2
            strImgPageType = "4 bit grayscale"

        Case 3
            strImgPageType = "8 bit grayscale"

        Case 4
            strImgPageType = "4 bit palettized"

        Case 5
            strImgPageType = "8 bit palettized"

        Case 6
            strImgPageType = "24 bit RGB"

        Case 7
            strImgPageType = "24 bit BGR"

End Select

    frmInfo.lblImgInfo(6).Caption = strImgPageType

    'Determine the dimensions of the image page.

    frmInfo.lblImgInfo(2).Caption = ImgAdmin1.ImageHeight

    frmInfo.lblImgInfo(3).Caption = ImgAdmin1.ImageWidth

    'Determine the X and Y resolution of the image page.

    frmInfo.lblImgInfo(4).Caption = ImgAdmin1.ImageResolutionX

    frmInfo.lblImgInfo(5).Caption = ImgAdmin1.ImageResolutionY

    'Determine the number of pages in the file.

    frmInfo.lblImgInfo(7).Caption = ImgAdmin1.PageCount

    'Show the form with the image attributes.

    frmInfo.Show

End Sub


CompressionType Example - VC++
CompressionType Example [image] VC++

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties to request information about a file. Attributes for specific page of a specific file will be displayed.

void CAdmin1Dlg::OnGetimageinfo()

{

    // Load the form where we will display file attributes.

    CFrmInfo frmInfo;

    CString strImgFileType, strImgCompType, strImgPageType;

    // Must specify page number if other than page 1

    ImgAdmin1.SetPageNumber(2);

    // Read the Filetype property and translate the value to

    // a corresponding string.

    switch  (ImgAdmin1.GetFileType())

    {

    case 0:

            strImgFileType = "Unknown";
                        break;

    case 1:

            strImgFileType = "TIF";
                        break;

    case 2:

            strImgFileType = "AWD";
                        break;

    case 3:

            strImgFileType = "BMP";
                        break;

    case 4:

            strImgFileType = "PCX";
                        break;

    case 5:

            strImgFileType = "DCX";
                        break;

    case 6:

            strImgFileType = "JPG";
                     break;

    case 7:

            strImgFileType = "XIF";
                        break;

    case 8:

            strImgFileType = "GIF";
                        break;

    case 9:

            strImgFileType = "WIF";
                       break;

    }

    frmInfo.m_FileType = strImgFileType;

    // Read the CompressionType property and translate the value to
    // a corresponding string.

    switch (ImgAdmin1.GetCompressionType())

    {

    case 0:

            strImgCompType = "Unknown";
                        break;

    case 1:

            strImgCompType = "No Compression";
                        break;

    case 2:

            strImgCompType = "Group3(1D)";
                        break;

    case 3:

            strImgCompType = "Group3(Modified Huffman)";
                        break;

    case 4:

            strImgCompType = "PackBits";
                        break;

    case 5:

            strImgCompType = "Group4(2D)";
                        break;

    case 6:

            strImgCompType = "JPEG";
                        break;

    case 7:

            strImgCompType = "RBA";
                        break;

    case 8:

            strImgCompType = "Group3(2D)";
                        break;

    case 9:

            strImgCompType = "LZW";
                        break;

    }

    frmInfo.m_CompType = strImgCompType;

    // Read the PageType property and translate the value to a
    // corresponding string.

    switch (ImgAdmin1.GetPageType())

    {

    case 0:

            strImgPageType = "Unknown";
                        break;

    case 1:

            strImgPageType = "Black and White";
                        break;

    case 2:

            strImgPageType = "4 bit grayscale";
                        break;

    case 3:

            strImgPageType = "8 bit grayscale";
                        break;

    case 4:

            strImgPageType = "4 bit palettized";
                        break;

    case 5:

            strImgPageType = "8 bit palettized";
                        break;

    case 6:

            strImgPageType = "24 bit RGB";
                        break;

    case 7:

            strImgPageType = "24 bit BGR";
                        break;

    }

    frmInfo.m_PageType = strImgPageType;

    // Determine the dimensions of the image page.

    long lInfo = ImgAdmin1.GetImageHeight();

    frmInfo.m_Height.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageWidth();

    frmInfo.m_Width.Format("%i",lInfo);

    // Determine the X and Y resolution of the image page.

    lInfo = ImgAdmin1.GetImageResolutionX();

    frmInfo.m_XRes.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageResolutionY();

    frmInfo.m_YRes.Format("%i",lInfo);

    // Determine the number of pages in the file.

    lInfo = ImgAdmin1.GetPageCount();

    frmInfo.m_PageCount.Format("%i",lInfo);

    // Show the form with the image attributes.

    frmInfo.DoModal();

}


Count Property

See Also	Example-VB
Specifies the number of items returned by the DoQuery method.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Image Admin control

Syntax

object.Count[=number]

Data Type

Long

Remarks

This read-only property is available at run time after the DoQuery method is called, but before the EndQuery method is called.


DefaultExt Property

See Also	Example-VB
Returns or sets the default file extension in the dialog box created by the ShowFileDialog method.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


DefaultExt Example [image] VB


DialogTitle Property

See Also	Example-VB	Example-VC++
Returns or sets the title used in the dialog box created by the ShowFileDialog method.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 [image] either Open or Save As.


DialogTitle Example - VB
DialogTitle Example [image] VB

This example shows how to use the ImgAdmin Open dialog box to display a file in the Image Edit and the Thumbnail controls.

Private Sub cmdDisplay_Click()

    'Initialize the Image property to check for Cancel pressed.
    'When the dialog box is shown, check for a value in the
    'Image property.

    ImgAdmin1.Image = ""

    'Specify a dialog title and a list filter rather than using
    'the defaults.

    ImgAdmin1.DialogTitle = "Select Image for Display"

    ImgAdmin1.Filter = "All Image Files |*.bmp; *.jpg; *.tif|
        Bitmap Files(*.bmp)|*. bmp| JPG Files (*.jpg)|*.jpg|
        TIFF Files (*.tif)|*.tif|All Files (*.*)|*.*|"

    'Default filter will be TIFF (fourth item).

    ImgAdmin1.FilterIndex = 4

    'Set the InitDir property to the preferred directory.

    ImgAdmin1.InitDir = "C:\images"

    ImgAdmin1.CancelError = False

   'Note: If you have Server Access software installed this
   'will automatically be enabled in the Open dialog box after
   'the user authenticates.

    ImgAdmin1.ShowFileDialog OpenDlg, Form1.hWnd

    'Determine if a file was selected or cancel was pressed

    If ImgAdmin1.Image = "" Then Exit Sub

    'Set the image properties in the Image Edit and Thumbnail controls
    'to the name of the file selected in the dialog box.

    ImgEdit1.Image = ImgAdmin1.Image

    ImgThumbnail1.Image = ImgAdmin1.Image

    'Display the image in the Image Edit and Thumbnail control.

    ImgEdit1.Display

End Sub


DialogTitle Example - VC++
DialogTitle Example [image] VC++

This example shows how to use the ImgAdmin Open dialog box to display a file in the Image Edit and the Thumbnail controls.

void CAdmin1Dlg::OnFileopen()

{

    // Initialize Image property in order to check for Cancel
    // pressed.  After the dialog box is shown, check for a value
    // in the image property.

    ImgAdmin1.SetImage ("" );

    // Specify a dialog title and a list filter rather than using
    // the defaults.

    ImgAdmin1.SetDialogTitle ("Select Image for Display");

    ImgAdmin1.SetFilter ("All Image Files |*.bmp; *.jpg; *.tif|
        Bitmap Files (*.bmp)|*. bmp|JPG Files (*.jpg)|*.jpg|
        Tiff Files (*.tif)|*.tif|All Files (*.*)|*.*|");

    // Default filter will be TIFF (fourth item).

    ImgAdmin1.SetFilterIndex (4);

    // Set the InitDir property to the preferred directory.

    ImgAdmin1.SetInitDir ("C:\\images");

    ImgAdmin1.SetCancelError (FALSE);

   // Note:  if you have Server Access software installed this
   // will automatically be enabled in the Open dialog box after
   // the user authenticates.

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;
    ImgAdmin1.ShowFileDialog (0,vhWnd);       // OpenDlg

    // Determine if a file was selected or cancel was pressed

    if (ImgAdmin1.GetImage() =="")
            return;

    // Set the image properties in the ImgEdit and Thumbnail control
    // to the name of the file selected in the dialog box.

    ImgEdit1.SetImage (ImgAdmin1.GetImage());

    ImgThumbnail1.SetImage (ImgAdmin1.GetImage());

    // Display the image in the ImgEdit and Thumbnail control.

    ImgEdit1.Display();

}


Domain Property

See Also	Example-VB
Returns or sets the name of the server running Enterprise Imaging services.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.Domain[=name]

Data Type

String

Remarks

The name of the Enterprise Imaging server last accessed is the default.

The LoginToServer method authenticates the user to the server specified by this property.


Domain Example [image] VB

This example shows ...

Private Sub xxxxx_Click()

.

.

.

.

End Sub


FileStgLoc1x Property

See Also	Example-VB	Example-VC++
Returns or sets the location where new files will be placed when creating 1.x server documents.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.FileStgLoc1x[=string]

Data Type

String

Remarks

Depending on the application, this location can be used by the Image Edit Control’s SaveAs and SavePage methods, and also by the Image Admin control’s Append, Replace, and Insert methods. These methods will cause a new image file with a unique filename to be created in the following situations.

  A page from a local file is being inserted, appended, or saved to a 1.x document.

  The ForceFileLinking1x property is set to False, and a page from a 1.x document or file is being inserted, appended, replaced, or saved to another 1.x document.

Use this property to set the initial value in the “File location for document pages” edit box in the 1.x Server Options dialog box. The user can accept or change this value.

The 1.x Server Options dialog box is created by the Show1xServerOptDlg method.


FileStgLoc1x Example - VB
FileStgLoc1x Example [image] VB

This example shows how to make a copy of a file being inserted into a 1.x document.

Private Sub cmdLink_Click()

    'Request file being inserted into a document be copied
    'to a new file in a location to be specified.

    ImgAdmin1.ForceFileLinking1x = False

    'To specify location of the new files, use the
    'FileStgLoc1x property.

    ImgAdmin1.FileStgLoc1x = "Image://srvrname\new_images:"

    'Second page of INSERTED DOC, will be inserted before page 3
    'of ORIG DOC.  Associated image files will be copied
    'to new randomly generated file names in directory specified.

     ImgAdmin1.Image =
        "Image://srvrname\doc_db:\CAB\DRAWER\FOLDER\ORIG DOC"

     ImgAdmin1.Insert
        "Image://srvrname\doc_db:\CAB\DRAWER\FOLDER\INSERTED DOC", 2, 3

End Sub


FileStgLoc1x Example - VC++
FileStgLoc1x Example [image] VC++

This example shows how to make a copy of a file being inserted into a 1.x document.

void CAdmin1Dlg::OnFilelink()

{

    // Request file being inserted into a document be copied
    // to a new file in a location to be specified.

    ImgAdmin1.SetForceFileLinking1x(FALSE);

    // To specify location of the new files, use the
    // FileStgLoc1x property.

    ImgAdmin1.SetFileStgLoc1x("Image://srvrname\\new_images:");

    // Second page of INSERTED DOC, will be inserted before page 3
    // of ORIG DOC.  Associated image files will be copied
    // to new randomly generated file names in directory specified.

    VARIANT evt;

    evt.vt = VT_ERROR;    // set to error for optional parameter

    ImgAdmin1.SetImage("Image://srvrname\\doc_db:\\CAB\\DRAWER\\
       FOLDER\\ORIG DOC");

    ImgAdmin1.Insert("Image://srvrname\\doc_db:\\CAB\\DRAWER\\FOLDER\\
       INSERTED DOC", 2, 3,1,evt,evt);

}


FileType Property

See Also	Example-VB	Example-VC++
Returns the file format of the image file.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
Applies To

Image Admin control

Syntax

object.FileType[=value]

Data Type

FileTypeValue (Integer)

Constant	Setting	Description
FileTypeUnk	0	Unknown
FileTypeTIFF	1	TIFF
FileTypeAWD	2	AWD (Windows 95 and 98 only)
FileTypeBMP	3	Bitmap (BMP)
FileTypePCX	4	PCX
FileTypeDCX	5	DCX
FileTypeJPEG	6	JPEG
FileTypeXIF	7	XIF
FileTypeGIF	8	GIF
FileTypeWIFF	9	WIF
Remarks

The file format is determined by the Image property.

This property is read-only.


FileType Example - VB
FileType Example [image] VB

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties to request information about a file. Attributes for specific page of a specific file will be displayed.

Private Sub cmdGetInfo_Click()

    Dim strImgFileType, strImgCompType, strImgPageType As String

    ImgAdmin1.Image = "D:\image2\4page.tif"

    'Must specify page number if other than page 1

    ImgAdmin1.PageNumber = 2

    'Load the form where we will display file attributes.

    Load frmInfo

    'Read the Filetype property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.FileType

        Case 0
            strImgFileType = "Unknown"

        Case 1
            strImgFileType = "TIF"

        Case 2
            strImgFileType = "AWD"

        Case 3
            strImgFileType = "BMP"

        Case 4
            strImgFileType = "PCX"

        Case 5
            strImgFileType = "DCX"

        Case 6
            strImgFileType = "JPG"

        Case 7
            strImgFileType = "XIF"

        Case 8
            strImgFileType = "GIF"

        Case 9
            strImgFileType = "WIF"

    End Select

    frmInfo.lblImgInfo(0).Caption = strImgFileType

    'Read the CompressionType property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.CompressionType

        Case 0
            strImgCompType = "Unknown"

        Case 1
            strImgCompType = "No Compression"

        Case 2
            strImgCompType = "Group3(1D)"

        Case 3
            strImgCompType = "Group3(Modified Huffman)"

        Case 4
            strImgCompType = "PackBits"

        Case 5
            strImgCompType = "Group4(2D)"

        Case 6
            strImgCompType = "JPEG"

        Case 7
            strImgCompType = "RBA"

        Case 8
            strImgCompType = "Group3(2D)"

        Case 9
            strImgCompType = "LZW"

    End Select

    frmInfo.lblImgInfo(1).Caption = strImgCompType

    'Read the PageType property and translate the value to a
    'corresponding string.

    Select Case ImgAdmin1.PageType

        Case 0
            strImgPageType = "Unknown"

        Case 1
            strImgPageType = "Black and White"

        Case 2
            strImgPageType = "4 bit grayscale"

        Case 3
            strImgPageType = "8 bit grayscale"

        Case 4
            strImgPageType = "4 bit palettized"

        Case 5
            strImgPageType = "8 bit palettized"

        Case 6
            strImgPageType = "24 bit RGB"

        Case 7
            strImgPageType = "24 bit BGR"

End Select

    frmInfo.lblImgInfo(6).Caption = strImgPageType

    'Determine the dimensions of the image page.

    frmInfo.lblImgInfo(2).Caption = ImgAdmin1.ImageHeight

    frmInfo.lblImgInfo(3).Caption = ImgAdmin1.ImageWidth

    'Determine the X and Y resolution of the image page.

    frmInfo.lblImgInfo(4).Caption = ImgAdmin1.ImageResolutionX

    frmInfo.lblImgInfo(5).Caption = ImgAdmin1.ImageResolutionY

    'Determine the number of pages in the file.

    frmInfo.lblImgInfo(7).Caption = ImgAdmin1.PageCount

    'Show the form with the image attributes.

    frmInfo.Show

End Sub


FileType Example - VC++
FileType Example [image] VC++

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties to request information about a file. Attributes for specific page of a specific file will be displayed.

void CAdmin1Dlg::OnGetimageinfo()

{

    // Load the form where we will display file attributes.

    CFrmInfo frmInfo;

    CString strImgFileType, strImgCompType, strImgPageType;

    // Must specify page number if other than page 1

    ImgAdmin1.SetPageNumber(2);

    // Read the Filetype property and translate the value to
    // a corresponding string.

    switch  (ImgAdmin1.GetFileType())

    {

    case 0:

            strImgFileType = "Unknown";
                        break;

    case 1:

            strImgFileType = "TIF";
                        break;

    case 2:

            strImgFileType = "AWD";
                        break;

    case 3:

            strImgFileType = "BMP";
                        break;

    case 4:

            strImgFileType = "PCX";
                        break;

    case 5:

            strImgFileType = "DCX";
                        break;

    case 6:

            strImgFileType = "JPG";
                     break;

    case 7:

            strImgFileType = "XIF";
                        break;

    case 8:

            strImgFileType = "GIF";
                        break;

    case 9:

            strImgFileType = "WIF";
                       break;

    }

    frmInfo.m_FileType = strImgFileType;

    // Read the CompressionType property and translate the value to
    // a corresponding string.

    switch (ImgAdmin1.GetCompressionType())

    {

    case 0:

            strImgCompType = "Unknown";
                        break;

    case 1:

            strImgCompType = "No Compression";
                        break;

    case 2:

            strImgCompType = "Group3(1D)";
                        break;

    case 3:

            strImgCompType = "Group3(Modified Huffman)";
                        break;

    case 4:

            strImgCompType = "PackBits";
                        break;

    case 5:

            strImgCompType = "Group4(2D)";
                        break;

    case 6:

            strImgCompType = "JPEG";
                        break;

    case 7:

            strImgCompType = "RBA";
                        break;

    case 8:

            strImgCompType = "Group3(2D)";
                        break;

    case 9:

            strImgCompType = "LZW";
                        break;

    }

    frmInfo.m_CompType = strImgCompType;

    // Read the PageType property and translate the value to a
    // corresponding string.

    switch (ImgAdmin1.GetPageType())

    {

    case 0:

            strImgPageType = "Unknown";
                        break;

    case 1:

            strImgPageType = "Black and White";
                        break;

    case 2:

            strImgPageType = "4 bit grayscale";
                        break;

    case 3:

            strImgPageType = "8 bit grayscale";
                        break;

    case 4:

            strImgPageType = "4 bit palettized";
                        break;

    case 5:

            strImgPageType = "8 bit palettized";
                        break;

    case 6:

            strImgPageType = "24 bit RGB";
                        break;

    case 7:

            strImgPageType = "24 bit BGR";
                        break;

    }

    frmInfo.m_PageType = strImgPageType;

    // Determine the dimensions of the image page.

    long lInfo = ImgAdmin1.GetImageHeight();

    frmInfo.m_Height.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageWidth();

    frmInfo.m_Width.Format("%i",lInfo);

    // Determine the X and Y resolution of the image page.

    lInfo = ImgAdmin1.GetImageResolutionX();

    frmInfo.m_XRes.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageResolutionY();

    frmInfo.m_YRes.Format("%i",lInfo);

    // Determine the number of pages in the file.

    lInfo = ImgAdmin1.GetPageCount();

    frmInfo.m_PageCount.Format("%i",lInfo);

    // Show the form with the image attributes.

    frmInfo.DoModal();

}


Filter Property

See Also	Example-VB	Example-VC++
Returns or sets the list of file filters displayed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Admin control

Syntax

object.Filter[=filter]

Data Type

String

Remarks

Filters are displayed in the 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.


Filter Example - VB
Filter Example [image] VB

This example shows how to use the ImgAdmin Open dialog box to display a file in the Image Edit and the Thumbnail controls.

Private Sub cmdDisplay_Click()

    'Initialize the Image property to check for Cancel pressed.
    'When the dialog box is shown, check for a value in the
    'Image property.

    ImgAdmin1.Image = ""

    'Specify a dialog title and a list filter rather than using
    'the defaults.

    ImgAdmin1.DialogTitle = "Select Image for Display"

    ImgAdmin1.Filter = "All Image Files|*.bmp; *.jpg; *.tif|
        Bitmap Files(*.bmp)|*. bmp| JPG Files (*.jpg)|*.jpg|
        TIFF Files (*.tif)|*.tif|All Files (*.*)|*.*|"

    'Default filter will be TIFF (fourth item).

    ImgAdmin1.FilterIndex = 4

    'Set the InitDir property to the preferred directory.

    ImgAdmin1.InitDir = "C:\images"

    ImgAdmin1.CancelError = False

   'Note: If you have Server Access software installed this
   'will automatically be enabled in the Open dialog box after
   'the user authenticates.

    ImgAdmin1.ShowFileDialog OpenDlg, Form1.hWnd

    'Determine if a file was selected or cancel was pressed

    If ImgAdmin1.Image = "" Then Exit Sub

    'Set the image properties in the Image Edit and Thumbnail controls
    'to the name of the file selected in the dialog box.

    ImgEdit1.Image = ImgAdmin1.Image

    ImgThumbnail1.Image = ImgAdmin1.Image

    'Display the image in the Image Edit and Thumbnail control.

    ImgEdit1.Display

End Sub


Filter Example - VC++
Filter Example [image] VC++

This example shows how to use the ImgAdmin Open dialog box to display a file in the Image Edit and the Thumbnail controls.

void CAdmin1Dlg::OnFileopen()

{

    // Initialize Image property in order to check for Cancel
    // pressed.  After the dialog box is shown, check for a value
    // in the image property.

    ImgAdmin1.SetImage ("" );

    // Specify a dialog title and a list filter rather than using
    // the defaults.

    ImgAdmin1.SetDialogTitle ("Select Image for Display");

    ImgAdmin1.SetFilter ("All Image Files|*.bmp; *.jpg; *.tif|
        Bitmap Files (*.bmp)|*. bmp|JPG Files (*.jpg)|*.jpg|
        Tiff Files (*.tif)|*.tif|All Files (*.*)|*.*|");

    // Default filter will be TIFF (fourth item).

    ImgAdmin1.SetFilterIndex (4);

    // Set the InitDir property to the preferred directory.

    ImgAdmin1.SetInitDir ("C:\\images");

    ImgAdmin1.SetCancelError (FALSE);

   // Note:  if you have Server Access software installed this
   // will automatically be enabled in the Open dialog box after
   // the user authenticates.

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowFileDialog (0,vhWnd);       // OpenDlg

    // Determine if a file was selected or cancel was pressed

    if (ImgAdmin1.GetImage() =="")
            return;

    // Set the image properties in the ImgEdit and Thumbnail control
    // to the name of the file selected in the dialog box.

    ImgEdit1.SetImage (ImgAdmin1.GetImage());

    ImgThumbnail1.SetImage (ImgAdmin1.GetImage());

    // Display the image in the ImgEdit and Thumbnail control.

    ImgEdit1.Display();

}


FilterIndex Property

See Also	Example-VB	Example-VC++
Returns or sets which of the file filters is highlighted when the dialog box first opens.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Admin control

Syntax

object.FilterIndex[=index]

Data Type

Long

Remarks

The file Open or Save As dialog box is created by the ShowFileDialog method.

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


FilterIndex Example - VB
FilterIndex Example [image] VB

This example shows how to use the ImgAdmin Open dialog box to display a file in the Image Edit and the Thumbnail controls.

Private Sub cmdDisplay_Click()

    'Initialize the Image property to check for Cancel pressed.
    'When the dialog box is shown, check for a value in the
    'Image property.

    ImgAdmin1.Image = ""

    'Specify a dialog title and a list filter rather than using
    'the defaults.

    ImgAdmin1.DialogTitle = "Select Image for Display"

    ImgAdmin1.Filter = "All Image Files |*.bmp; *.jpg; *.tif|
        Bitmap Files(*.bmp)|*. bmp| JPG Files (*.jpg)|*.jpg|
        TIFF Files (*.tif)|*.tif|All Files (*.*)|*.*|"

    'The default filter will be TIFF (fourth item).

    ImgAdmin1.FilterIndex = 4

    'Set the InitDir property to the preferred directory.

    ImgAdmin1.InitDir = "C:\images"

    ImgAdmin1.CancelError = False

   'Note: If you have Server Access software installed this
   'will automatically be enabled in the Open dialog box after
   'the user authenticates.

    ImgAdmin1.ShowFileDialog OpenDlg, Form1.hWnd

    'Determine if a file was selected or cancel was pressed

    If ImgAdmin1.Image = "" Then Exit Sub

    'Set the image properties in the Image Edit and Thumbnail controls
    'to the name of the file selected in the dialog box.

    ImgEdit1.Image = ImgAdmin1.Image

    ImgThumbnail1.Image = ImgAdmin1.Image

    'Display the image in the Image Edit and Thumbnail control.

    ImgEdit1.Display

End Sub


FilterIndex Example - VC++
FilterIndex Example [image] VC++

This example shows how to use the ImgAdmin Open dialog box to display a file in the Image Edit and the Thumbnail controls.

void CAdmin1Dlg::OnFileopen()

{

    // Initialize Image property in order to check for Cancel
    // pressed.  After the dialog box is shown, check for a value
    // in the image property.

    ImgAdmin1.SetImage ("" );

    // Specify a dialog title and a list filter rather than using
    // the defaults.

    ImgAdmin1.SetDialogTitle ("Select Image for Display");

    ImgAdmin1.SetFilter ("All Image Files |*.bmp; *.jpg; *.tif|
        Bitmap Files (*.bmp)|*. bmp|JPG Files (*.jpg)|*.jpg|
        TIFF Files (*.tif)|*.tif|All Files (*.*)|*.*|");

    // Default filter will be TIFF (fourth item).

    ImgAdmin1.SetFilterIndex (4);

    // Set the InitDir property to the preferred directory.

    ImgAdmin1.SetInitDir ("C:\\images");

    ImgAdmin1.SetCancelError (FALSE);

   // Note:  if you have Server Access software installed this
   // will automatically be enabled in the Open dialog box after
   // the user authenticates.

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowFileDialog (0,vhWnd);       // OpenDlg

    // Determine if a file was selected or cancel was pressed

    if (ImgAdmin1.GetImage() =="")
            return;

    // Set the image properties in the ImgEdit and Thumbnail control
    // to the name of the file selected in the dialog box.

    ImgEdit1.SetImage (ImgAdmin1.GetImage());

    ImgThumbnail1.SetImage (ImgAdmin1.GetImage());

    // Display the image in the ImgEdit and Thumbnail control.

    ImgEdit1.Display();

}


Flags Property

See Also	Example-VB	Example-VC++
Returns or sets initialization flags for the File (Open or Save As) dialog box or the Print dialog box. These dialog boxes are created by the ShowFileDialog and ShowPrintDialog methods.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 file name 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 file name
&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.
&H40&	Causes the dialog box to display the preview options and the Find button

Values for ShowPrintDialog

Value	Description
&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
&H4&	Disables the Selection button
Remarks

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

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


Flags Example - VB
Flags Example [image] VB

This example uses the Flags property to define options for the Open dialog box; hides the Read-Only check box and enables preview image window and the find button.

Private Sub cmdSetFlags_Click()

    'Private Sub mnuSetFlags_Click

    Const OFN_HIDEREADONLY = &H4&

    Const FINDANDPREVIEW = &H40&

    'Bitwise OR the flags together

    ImgAdmin1.Flags = OFN_HIDEREADONLY + FINDANDPREVIEW

    ImgAdmin1.ShowFileDialog OpenDlg

End Sub


Flags Example - VC++
Flags Example [image] VC++

This example uses the Flags property to define options for the Open dialog box; hides the Read-Only check box and enables preview image window and the find button.

{

    // Private Sub mnuSetFlags_Click

    #define FINDANDPREVIEW 0x40

    // Bitwise OR the flags together

    ImgAdmin1.SetFlags (OFN_HIDEREADONLY | FINDANDPREVIEW);

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowFileDialog (0,vhWnd);    // OpenDlg

}


ForceFileDeletion1x Property

See Also	Example-VB
Returns or sets whether the file referenced by a 1x document page is deleted when the document page itself is deleted. This property is used in conjunction with the Delete and DeletePages methods.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.ForceFileDeletion1x[={True|False}]

Data Type

Boolean

Setting	Description
True (default)	Source file pages linked to the 1x document are deleted when a document page is deleted
False	Source file pages linked to the 1x document are not deleted when a document page is deleted
Remarks

The True setting is ignored in cases where a document contains several pages that are linked to the same source file, and not all of the pages are being deleted. In this case, the linked source file is not deleted because other pages in the document are linked to it.

For example, a document named  anydoc.tif  contains 5 pages, and pages 1 and 4 are linked to  imgfile.tif.  If you set this property to True, and delete page 1 of anydoc.tif,  then  imgfile.tif  is not deleted because it is still needed by page 4.

Note: This exception is only true for pages within the same document.

Use this property to set the state of the checkbox “Delete File with pages” in the 1.x Server Options dialog box. The user can accept or change this value.

The 1.x Server Options dialog box is created by the Show1xServerOptDlg method.


ForceFileLinking1x Property

See Also	Example-VB	Example-VC++
Returns or sets how file pages being added to a document residing in a 1.x repository are handled.

Depending on the setting of the ForceFileLinking1x property, the Admin control’s Append, Replace, and Insert methods can create copies of the source file pages in the 1.x file repository, or create links between the source file pages and the destination document.

The Image Edit control’s SaveAs and SavePage methods can also use this property if the destination file is a 1.x document.

Note: This property setting is ignored in cases where the source document/file is located on a local or redirected drive, and the Append, Insert, Replace, SaveAs, or SavePage method is called. In these situations, the source file pages are copied to the 1.x repository, given unique file names, and referenced by the destination document.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.ForceFileLinking1x[={True|False}]

Data Type

Boolean

Setting	Description
True	The source file pages are linked to the destination document.
False (default)	Copies of the source file pages are created in the 1.x file repository, given unique file names, and linked to the destination document.
Remarks

The source file/document (for the pages being appended, replaced, or inserted) can be located either on a local or redirected drive, or in the 1.x file/document repository [image] the destination document must reside in a 1.x repository and be managed by the Document Manager.

In cases where both the source and destination documents reside in a 1.x repository, the property settings work in the following manner.

Setting = True [image] Source file pages are linked to a document, which means each time the source file changes, the destination document reflects the changes. You can link the same set of source pages to several documents so that information can be easily updated.

Setting = False [image] Copies of the source file pages are created in the location specified by the FileStgLoc1x property, and given unique file names. Each time pages are appended to or inserted into a destination document, a new set of copies are made. Changing the original source pages has no effect on the destination document because it references the copy of the source page.

Use this property to provide the initial value for the checkbox “Link files on reference” in the 1.x Server Options dialog box. The user can accept or change this value.

The 1.x Server Options dialog box is created by the Show1xServerOptDlg method.


ForceFileLinking1x Example - VB
ForceFileLinking1x Example [image] VB

The following examples demonstrate options for file linking/copying when performing insert/append functions using 1x server files and documents.

Private Sub cmdLink_Click()

'Example 1

    'Request file being inserted into a document be copied
    'to a new file in a location to be specified.

    ImgAdmin1.ForceFileLinking1x = False

    'To specify location of the new files, use the
    'FileStgLoc1x property.

    ImgAdmin1.FileStgLoc1x = "Image://srvrname\new_images:"

    'Second page of INSERTED DOC, will be inserted before page 3
    'of ORIG DOC.  Associated image files will be copied
    'to new randomly generated file names in directory specified.

     ImgAdmin1.Image =
        "Image://srvrname\doc_db:\CAB\DRAWER\FOLDER\ORIG DOC"

     ImgAdmin1.Insert
        "Image://srvrname\doc_db:\CAB\DRAWER\FOLDER\INSERTED DOC", 2, 3

'Example 2

    'Request files associated with the page being appended
    'reference the original files.  This results in
    'multiple documents accessing the same files -- could
    'be useful to prevent rewrites of optical disk files.

    ImgAdmin1.ForceFileLinking1x = True

    'Pages 2, 3 and 4 of 5page.tif will be appended to
    'ORIG DOC but they are actually linked back to the file.

    ImgAdmin1.Image =
       "Image://srvrname\doc_db:\CAB\DRAWER\FOLDER\ORIG DOC"

    ImgAdmin1.Append "Image://srvrname\images:\5page.tif", 2, 3

End Sub


ForceFileLinking1x Example - VC++
ForceFileLinking1x Example [image] VC++

The following examples demonstrate options for file linking/copying when performing insert/append functions using 1x server files and documents.

void CAdmin1Dlg::OnFilelink()

{

// Example 1

    // Request file being inserted into a document be copied
    // to a new file in a location to be specified.

    ImgAdmin1.SetForceFileLinking1x(FALSE);

    // To specify location of the new files, use the
    // FileStgLoc1x property.

    ImgAdmin1.SetFileStgLoc1x("Image://srvrname\\new_images:");

    // Second page of INSERTED DOC, will be inserted before page 3
    // of ORIG DOC.  Associated image files will be copied
    // to new randomly generated file names in directory specified.

    VARIANT evt;

    evt.vt = VT_ERROR;    // set to error for optional parameter

    ImgAdmin1.SetImage("Image://srvrname\\doc_db:\\CAB\\DRAWER\\
       FOLDER\\ORIG DOC");

    ImgAdmin1.Insert("Image://srvrname\\doc_db:\\CAB\\DRAWER\\FOLDER\\
       INSERTED DOC", 2, 3,1,evt,evt);

// Example 2

    // Request files associated with the page being appended
    // reference the original files.  This results in
    // multiple documents accessing the same files -- could
    // be useful to prevent rewrites of optical disk files.

    ImgAdmin1.SetForceFileLinking1x(TRUE);

    // Pages 2, 3 and 4 of 5page.tif will be appended to
    // ORIG DOC but they are actually linked back to the file.

    ImgAdmin1.SetImage("Image://srvrname\\doc_db:\\CAB\\DRAWER\\FOLDER\\
       ORIG DOC");

    ImgAdmin1.Append("Image://srvrname\\images:\\5page.tif", 2, 3,evt,evt);

}


ForceLowerCase1x Property

See Also	Example-VB
Returns or sets if file names are forced to lower case.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.ForceLowerCase1x[={True|False}]

Data Type

Boolean

Setting	Description
True	File names are forced to lower case when reading or writing 1.x files
False (default)	File name case is not altered
Remarks

This property is used for backward compatibility with older, 16-bit clients that force directory path and file names to lower case when communicating with 1.x servers.

Setting this property provides the initial value of the “Force lower-case file names” checkbox in the 1.x Server Options dialog box. The user can accept or change this value.

The 1.x Server Options dialog box is created by the Show1xServerOptDlg method.


ForceLowerCase1x Example [image] VB

This example shows….

Private Sub xxxxx_Click()

.

.

.

.

End Sub


IbkUnderlyingFile Property

See Also	Example-VB
Returns the name of the underlying file that is referenced by the file specified by the Image property.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Admin control

Syntax

object.IbkUnderlyingFile[=name]

Data Type

String


HelpCommand Property

See Also	Example-VB
Returns or sets the type of Help requested.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 HelpContextID 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

This property is used in conjunction with other Admin control help properties [image] HelpContextId, HelpKey, and HelpFile [image] to enable an application to use a custom Help file for the dialog box displayed by the ShowFileDialog method.


HelpCommand Example [image] VB


HelpContextId Property

See Also	Example-VB
Returns or sets a Help context Id. Context Ids are assigned to objects to provide context-sensitive Help to your application.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Admin control

Syntax

object.HelpContextId[=value]

Data Type

Integer

Remarks

This property is used in conjunction with other Admin control help properties [image] HelpCommand, HelpKey, and HelpFile [image] to enable an application to use a custom Help file for the file Open/Save As dialog box. The Open/Save As dialog box is displayed by the ShowFileDialog method.

If this property is set to a value other than 0 (zero), and the HelpFile property contains a valid value, Help will be displayed when the Help button in the dialog box is clicked.


HelpContextId Example [image] VB


HelpKey Property

See Also	Example-VB
Returns or sets the keyword that identifies the requested Help topic.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Admin control

Syntax

object.HelpKey[=keyword]

Data Type

String

Remarks

This property is used in conjunction with the HelpCommand and HelpFile properties. Together, they enable an application to use a custom Help file for the file Open/Save As dialog box displayed by the ShowFileDialog method.


HelpKey Example [image] VB


HelpFile Property

See Also	Example-VB
Returns or sets the name of a Help file to be used by the file Open/Save As dialog box. The Open/Save As dialog box is displayed by the ShowFileDialog method.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Admin control

Syntax

object.HelpFile[=filename]

Data Type

String

Remarks

This property is used in conjunction with the other Admin control help properties [image] HelpCommand, HelpContextId, and HelpKey.


HelpFile Example [image] VB


Image Property (Admin control)
Image Property

See Also	Example-VB	Example-VC++
Returns or sets the file name of the current image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Admin control

Syntax

object.Image[=filename]

Data Type

String

Remarks

If the file specified does not exist, one is created.

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	Replace	ShowFileProperties
DeletePages	SetFileProperties	ShowPrintDialog
Insert	ShowFileDialog	VerifyImage

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

CompressionInfo	ImageResolutionX	PageNumber
CompressionType	ImageResolutionY	PageType
FileType	ImageWidth
ImageHeight	PageCount
Also, the Admin control ShowFileProperty method is updated.

1.x Documents

When you specify the path to 1.x documents, use 4 nodes, separated by slashes. Refer to the following example:

Image://server\volume:\cabinet\drawer\folder\document

If there is no drawer, the string should contain another slash to signify the missing node. In the following example:

Image://server\volume:\\cabinet\folder\document

Note the two slashes before "cabinet", which means there is no drawer node.


Image Example (Admin) - VB
Image Example [image] VB

The following examples show syntax for the Image property. Single slashes can be forward or back.

Private Sub cmdSetImage_Click()

    'Showing syntax for 1.x Server document
    'Note: prefix Image:// denotes service name for 1.x server

    ImgAdmin1.Image =
       "Image://srvrname\volname:\CAB\DRAWER\FOLDER\YOUR DOC"

    'Showing syntax for 1.x Server filename with a volume name mapped.

    ImgAdmin1.Image = "Image://srvrname/volname:/dirname/temp.tif"

    'Showing syntax for Enterprise Imaging server document
    'Note: prefix Imagex:// denotes service name for Enterprise Imaging
    'server

    ImgAdmin1.Image = "Imagex://Docid1234

    'URL syntax

    ImgAdmin1.Image = "http://www.eastmansoftware.com/sbu/sampimg.tif"

    'UNC filename

    ImgAdmin1.Image = "\\srvrname\shared3\images\bw\thisisa.tif"

End Sub


Image Example (Admin) - VC++
Image Example [image] VC++

The following examples show syntax for the Image property. Single slashes can be forward or back.

void CAdmin1Dlg::OnClickImgedit1()

{

    // Examples of syntax for the Image property. Single
    // slashes can be forward or back.

    // Showing syntax for 1.x Server document
    // Note: prefix Image:// denotes service name for 1.x server.

    ImgAdmin1.SetImage
       ("Image://srvrname\\volname:\\CAB\\DRAWER\\FOLDER\\YOUR DOC");

    // Showing syntax for 1.x Server filename with a volume name mapped.

    ImgAdmin1.SetImage ("Image://srvrname/volname:/dirname/temp.tif");

    // Showing syntax for Enterprise Imaging server document.
    // Note: prefix Image:// denotes service name for Enterprise Imaging
    // server

    ImgAdmin1.SetImage ("Imagex://srvrname\\docid1234;)

    // URL syntax

    ImgAdmin1.SetImage ("http://www.eastmansoftware.com/sbu/sampimg.tif");

    // UNC filename

    ImgAdmin1.SetImage ("\\\\srvrname\\shared3\\images\\bw\\thisisa.tif");

}


ImageHeight Property

See Also	Example-VB	Example-VC++
Returns the height, in pixels, of the current page.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
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.

This property is read-only.


ImageHeight Example - VB
ImageHeight Example [image] VB

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties to request information about a file. Attributes for specific page of a specific file will be displayed.

Private Sub cmdGetInfo_Click()

    Dim strImgFileType, strImgCompType, strImgPageType As String

    ImgAdmin1.Image = "D:\image2\4page.tif"

    'Must specify page number if other than page 1

    ImgAdmin1.PageNumber = 2

    'Load the form where we will display file attributes.

    Load frmInfo

    'Read the Filetype property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.FileType

        Case 0
            strImgFileType = "Unknown"

        Case 1
            strImgFileType = "TIF"

        Case 2
            strImgFileType = "AWD"

        Case 3
            strImgFileType = "BMP"

        Case 4
            strImgFileType = "PCX"

        Case 5
            strImgFileType = "DCX"

        Case 6
            strImgFileType = "JPG"

        Case 7
            strImgFileType = "XIF"

        Case 8
            strImgFileType = "GIF"

        Case 9
            strImgFileType = "WIF"

    End Select

    frmInfo.lblImgInfo(0).Caption = strImgFileType

    'Read the CompressionType property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.CompressionType

        Case 0
            strImgCompType = "Unknown"

        Case 1
            strImgCompType = "No Compression"

        Case 2
            strImgCompType = "Group3(1D)"

        Case 3
            strImgCompType = "Group3(Modified Huffman)"

        Case 4
            strImgCompType = "PackBits"

        Case 5
            strImgCompType = "Group4(2D)"

        Case 6
            strImgCompType = "JPEG"

        Case 7
            strImgCompType = "RBA"

        Case 8
            strImgCompType = "Group3(2D)"

        Case 9
            strImgCompType = "LZW"

    End Select

    frmInfo.lblImgInfo(1).Caption = strImgCompType

    'Read the PageType property and translate the value to a
    'corresponding string.

    Select Case ImgAdmin1.PageType

        Case 0
            strImgPageType = "Unknown"

        Case 1
            strImgPageType = "Black and White"

        Case 2
            strImgPageType = "4 bit grayscale"

        Case 3
            strImgPageType = "8 bit grayscale"

        Case 4
            strImgPageType = "4 bit palettized"

        Case 5
            strImgPageType = "8 bit palettized"

        Case 6
            strImgPageType = "24 bit RGB"

        Case 7
            strImgPageType = "24 bit BGR"

End Select

    frmInfo.lblImgInfo(6).Caption = strImgPageType

    'Determine the dimensions of the image page.

    frmInfo.lblImgInfo(2).Caption = ImgAdmin1.ImageHeight

    frmInfo.lblImgInfo(3).Caption = ImgAdmin1.ImageWidth

    'Determine the X and Y resolution of the image page.

    frmInfo.lblImgInfo(4).Caption = ImgAdmin1.ImageResolutionX

    frmInfo.lblImgInfo(5).Caption = ImgAdmin1.ImageResolutionY

    'Determine the number of pages in the file.

    frmInfo.lblImgInfo(7).Caption = ImgAdmin1.PageCount

    'Show the form with the image attributes.

    frmInfo.Show

End Sub


ImageHeight Example - VC++
ImageHeight Example [image] VC++

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties to request information about a file. Attributes for specific page of a specific file will be displayed.

void CAdmin1Dlg::OnGetimageinfo()

{

    // Load the form where we will display file attributes.

    CFrmInfo frmInfo;

    CString strImgFileType, strImgCompType, strImgPageType;

    // Must specify page number if other than page 1

    ImgAdmin1.SetPageNumber(2);

    // Read the Filetype property and translate the value to
    // a corresponding string.

    switch  (ImgAdmin1.GetFileType())

    {

    case 0:

            strImgFileType = "Unknown";
                        break;

    case 1:

            strImgFileType = "TIF";
                        break;

    case 2:

            strImgFileType = "AWD";
                        break;

    case 3:

            strImgFileType = "BMP";
                        break;

    case 4:

            strImgFileType = "PCX";
                        break;

    case 5:

            strImgFileType = "DCX";
                        break;

    case 6:

            strImgFileType = "JPG";
                     break;

    case 7:

            strImgFileType = "XIF";
                        break;

    case 8:

            strImgFileType = "GIF";
                        break;

    case 9:

            strImgFileType = "WIF";
                       break;

    }

    frmInfo.m_FileType = strImgFileType;

    // Read the CompressionType property and translate the value to
    // a corresponding string.

    switch (ImgAdmin1.GetCompressionType())

    {

    case 0:

            strImgCompType = "Unknown";
                        break;

    case 1:

            strImgCompType = "No Compression";
                        break;

    case 2:

            strImgCompType = "Group3(1D)";
                        break;

    case 3:

            strImgCompType = "Group3(Modified Huffman)";
                        break;

    case 4:

            strImgCompType = "PackBits";
                        break;

    case 5:

            strImgCompType = "Group4(2D)";
                        break;

    case 6:

            strImgCompType = "JPEG";
                        break;

    case 7:

            strImgCompType = "RBA";
                        break;

    case 8:

            strImgCompType = "Group3(2D)";
                        break;

    case 9:

            strImgCompType = "LZW";
                        break;

    }

    frmInfo.m_CompType = strImgCompType;

    // Read the PageType property and translate the value to a
    // corresponding string.

    switch (ImgAdmin1.GetPageType())

    {

    case 0:

            strImgPageType = "Unknown";
                        break;

    case 1:

            strImgPageType = "Black and White";
                        break;

    case 2:

            strImgPageType = "4 bit grayscale";
                        break;

    case 3:

            strImgPageType = "8 bit grayscale";
                        break;

    case 4:

            strImgPageType = "4 bit palettized";
                        break;

    case 5:

            strImgPageType = "8 bit palettized";
                        break;

    case 6:

            strImgPageType = "24 bit RGB";
                        break;

    case 7:

            strImgPageType = "24 bit BGR";
                        break;

    }

    frmInfo.m_PageType = strImgPageType;

    // Determine the dimensions of the image page.

    long lInfo = ImgAdmin1.GetImageHeight();

    frmInfo.m_Height.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageWidth();

    frmInfo.m_Width.Format("%i",lInfo);

    // Determine the X and Y resolution of the image page.

    lInfo = ImgAdmin1.GetImageResolutionX();

    frmInfo.m_XRes.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageResolutionY();

    frmInfo.m_YRes.Format("%i",lInfo);

    // Determine the number of pages in the file.

    lInfo = ImgAdmin1.GetPageCount();

    frmInfo.m_PageCount.Format("%i",lInfo);

    // Show the form with the image attributes.

    frmInfo.DoModal();

}


ImageResoultionX  Property
ImageResolutionX Property

See Also	Example-VB	Example-VC++
Returns the horizontal resolution, in dots-per-inch (dpi), of the current page.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
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.

This property is read-only.


ImageResolutionX Example - VB
ImageResolutionX Example [image] VB

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties to request information about a file. Attributes for specific page of a specific file will be displayed.

Private Sub cmdGetInfo_Click()

    Dim strImgFileType, strImgCompType, strImgPageType As String

    ImgAdmin1.Image = "D:\image2\4page.tif"

    'Must specify page number if other than page 1

    ImgAdmin1.PageNumber = 2

    'Load the form where we will display file attributes.

    Load frmInfo

    'Read the Filetype property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.FileType

        Case 0
            strImgFileType = "Unknown"

        Case 1
            strImgFileType = "TIF"

        Case 2
            strImgFileType = "AWD"

        Case 3
            strImgFileType = "BMP"

        Case 4
            strImgFileType = "PCX"

        Case 5
            strImgFileType = "DCX"

        Case 6
            strImgFileType = "JPG"

        Case 7
            strImgFileType = "XIF"

        Case 8
            strImgFileType = "GIF"

        Case 9
            strImgFileType = "WIF"

    End Select

    frmInfo.lblImgInfo(0).Caption = strImgFileType

    'Read the CompressionType property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.CompressionType

        Case 0
            strImgCompType = "Unknown"

        Case 1
            strImgCompType = "No Compression"

        Case 2
            strImgCompType = "Group3(1D)"

        Case 3
            strImgCompType = "Group3(Modified Huffman)"

        Case 4
            strImgCompType = "PackBits"

        Case 5
            strImgCompType = "Group4(2D)"

        Case 6
            strImgCompType = "JPEG"

        Case 7
            strImgCompType = "RBA"

        Case 8
            strImgCompType = "Group3(2D)"

        Case 9
            strImgCompType = "LZW"

    End Select

    frmInfo.lblImgInfo(1).Caption = strImgCompType

    'Read the PageType property and translate the value to a
    'corresponding string.

    Select Case ImgAdmin1.PageType

        Case 0
            strImgPageType = "Unknown"

        Case 1
            strImgPageType = "Black and White"

        Case 2
            strImgPageType = "4 bit grayscale"

        Case 3
            strImgPageType = "8 bit grayscale"

        Case 4
            strImgPageType = "4 bit palettized"

        Case 5
            strImgPageType = "8 bit palettized"

        Case 6
            strImgPageType = "24 bit RGB"

        Case 7
            strImgPageType = "24 bit BGR"

End Select

    frmInfo.lblImgInfo(6).Caption = strImgPageType

    'Determine the dimensions of the image page.

    frmInfo.lblImgInfo(2).Caption = ImgAdmin1.ImageHeight

    frmInfo.lblImgInfo(3).Caption = ImgAdmin1.ImageWidth

    'Determine the X and Y resolution of the image page.

    frmInfo.lblImgInfo(4).Caption = ImgAdmin1.ImageResolutionX

    frmInfo.lblImgInfo(5).Caption = ImgAdmin1.ImageResolutionY

    'Determine the number of pages in the file.

    frmInfo.lblImgInfo(7).Caption = ImgAdmin1.PageCount

    'Show the form with the image attributes.

    frmInfo.Show

End Sub


ImageResolutionX Example - VC++
ImageResolutionX Example [image] VC++

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties to request information about a file. Attributes for specific page of a specific file will be displayed.

void CAdmin1Dlg::OnGetimageinfo()

{

    // Load the form where we will display file attributes.

    CFrmInfo frmInfo;

    CString strImgFileType, strImgCompType, strImgPageType;

    // Must specify page number if other than page 1

    ImgAdmin1.SetPageNumber(2);

    // Read the Filetype property and translate the value to
    // a corresponding string.

    switch  (ImgAdmin1.GetFileType())

    {

    case 0:

            strImgFileType = "Unknown";
                        break;

    case 1:

            strImgFileType = "TIF";
                        break;

    case 2:

            strImgFileType = "AWD";
                        break;

    case 3:

            strImgFileType = "BMP";
                        break;

    case 4:

            strImgFileType = "PCX";
                        break;

    case 5:

            strImgFileType = "DCX";
                        break;

    case 6:

            strImgFileType = "JPG";
                     break;

    case 7:

            strImgFileType = "XIF";
                        break;

    case 8:

            strImgFileType = "GIF";
                        break;

    case 9:

            strImgFileType = "WIF";
                       break;

    }

    frmInfo.m_FileType = strImgFileType;

    // Read the CompressionType property and translate the value to
    // a corresponding string.

    switch (ImgAdmin1.GetCompressionType())

    {

    case 0:

            strImgCompType = "Unknown";
                        break;

    case 1:

            strImgCompType = "No Compression";
                        break;

    case 2:

            strImgCompType = "Group3(1D)";
                        break;

    case 3:

            strImgCompType = "Group3(Modified Huffman)";
                        break;

    case 4:

            strImgCompType = "PackBits";
                        break;

    case 5:

            strImgCompType = "Group4(2D)";
                        break;

    case 6:

            strImgCompType = "JPEG";
                        break;

    case 7:

            strImgCompType = "RBA";
                        break;

    case 8:

            strImgCompType = "Group3(2D)";
                        break;

    case 9:

            strImgCompType = "LZW";
                        break;

    }

    frmInfo.m_CompType = strImgCompType;

    // Read the PageType property and translate the value to a
    // corresponding string.

    switch (ImgAdmin1.GetPageType())

    {

    case 0:

            strImgPageType = "Unknown";
                        break;

    case 1:

            strImgPageType = "Black and White";
                        break;

    case 2:

            strImgPageType = "4 bit grayscale";
                        break;

    case 3:

            strImgPageType = "8 bit grayscale";
                        break;

    case 4:

            strImgPageType = "4 bit palettized";
                        break;

    case 5:

            strImgPageType = "8 bit palettized";
                        break;

    case 6:

            strImgPageType = "24 bit RGB";
                        break;

    case 7:

            strImgPageType = "24 bit BGR";
                        break;

    }

    frmInfo.m_PageType = strImgPageType;

    // Determine the dimensions of the image page.

    long lInfo = ImgAdmin1.GetImageHeight();

    frmInfo.m_Height.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageWidth();

    frmInfo.m_Width.Format("%i",lInfo);

    // Determine the X and Y resolution of the image page.

    lInfo = ImgAdmin1.GetImageResolutionX();

    frmInfo.m_XRes.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageResolutionY();

    frmInfo.m_YRes.Format("%i",lInfo);

    // Determine the number of pages in the file.

    lInfo = ImgAdmin1.GetPageCount();

    frmInfo.m_PageCount.Format("%i",lInfo);

    // Show the form with the image attributes.

    frmInfo.DoModal();

}


ImageResolutionY Property

See Also	Example-VB	Example-VC++
Returns the vertical resolution, in dots-per-inch (dpi), of the current page.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
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.

This property is read-only.


ImageResolutionY Example - VB
ImageResolutionY Example [image] VB

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties to request information about a file. Attributes for specific page of a specific file will be displayed.

Private Sub cmdGetInfo_Click()

    Dim strImgFileType, strImgCompType, strImgPageType As String

    ImgAdmin1.Image = "D:\image2\4page.tif"

    'Must specify page number if other than page 1

    ImgAdmin1.PageNumber = 2

    'Load the form where we will display file attributes.

    Load frmInfo

    'Read the Filetype property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.FileType

        Case 0
            strImgFileType = "Unknown"

        Case 1
            strImgFileType = "TIF"

        Case 2
            strImgFileType = "AWD"

        Case 3
            strImgFileType = "BMP"

        Case 4
            strImgFileType = "PCX"

        Case 5
            strImgFileType = "DCX"

        Case 6
            strImgFileType = "JPG"

        Case 7
            strImgFileType = "XIF"

        Case 8
            strImgFileType = "GIF"

        Case 9
            strImgFileType = "WIF"

    End Select

    frmInfo.lblImgInfo(0).Caption = strImgFileType

    'Read the CompressionType property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.CompressionType

        Case 0
            strImgCompType = "Unknown"

        Case 1
            strImgCompType = "No Compression"

        Case 2
            strImgCompType = "Group3(1D)"

        Case 3
            strImgCompType = "Group3(Modified Huffman)"

        Case 4
            strImgCompType = "PackBits"

        Case 5
            strImgCompType = "Group4(2D)"

        Case 6
            strImgCompType = "JPEG"

        Case 7
            strImgCompType = "RBA"

        Case 8
            strImgCompType = "Group3(2D)"

        Case 9
            strImgCompType = "LZW"

    End Select

    frmInfo.lblImgInfo(1).Caption = strImgCompType

    'Read the PageType property and translate the value to a
    'corresponding string.

    Select Case ImgAdmin1.PageType

        Case 0
            strImgPageType = "Unknown"

        Case 1
            strImgPageType = "Black and White"

        Case 2
            strImgPageType = "4 bit grayscale"

        Case 3
            strImgPageType = "8 bit grayscale"

        Case 4
            strImgPageType = "4 bit palettized"

        Case 5
            strImgPageType = "8 bit palettized"

        Case 6
            strImgPageType = "24 bit RGB"

        Case 7
            strImgPageType = "24 bit BGR"

End Select

    frmInfo.lblImgInfo(6).Caption = strImgPageType

    'Determine the dimensions of the image page.

    frmInfo.lblImgInfo(2).Caption = ImgAdmin1.ImageHeight

    frmInfo.lblImgInfo(3).Caption = ImgAdmin1.ImageWidth

    'Determine the X and Y resolution of the image page.

    frmInfo.lblImgInfo(4).Caption = ImgAdmin1.ImageResolutionX

    frmInfo.lblImgInfo(5).Caption = ImgAdmin1.ImageResolutionY

    'Determine the number of pages in the file.

    frmInfo.lblImgInfo(7).Caption = ImgAdmin1.PageCount

    'Show the form with the image attributes.

    frmInfo.Show

End Sub


ImageResolutionY Example - VC++
ImageResolutionY Example [image] VC++

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties to request information about a file. Attributes for specific page of a specific file will be displayed.

void CAdmin1Dlg::OnGetimageinfo()

{

    // Load the form where we will display file attributes.

    CFrmInfo frmInfo;

    CString strImgFileType, strImgCompType, strImgPageType;

    // Must specify page number if other than page 1

    ImgAdmin1.SetPageNumber(2);

    // Read the Filetype property and translate the value to
    // a corresponding string.

    switch  (ImgAdmin1.GetFileType())

    {

    case 0:

            strImgFileType = "Unknown";
                        break;

    case 1:

            strImgFileType = "TIF";
                        break;

    case 2:

            strImgFileType = "AWD";
                        break;

    case 3:

            strImgFileType = "BMP";
                        break;

    case 4:

            strImgFileType = "PCX";
                        break;

    case 5:

            strImgFileType = "DCX";
                        break;

    case 6:

            strImgFileType = "JPG";
                     break;

    case 7:

            strImgFileType = "XIF";
                        break;

    case 8:

            strImgFileType = "GIF";
                        break;

    case 9:

            strImgFileType = "WIF";
                       break;

    }

    frmInfo.m_FileType = strImgFileType;

    // Read the CompressionType property and translate the value to
    // a corresponding string.

    switch (ImgAdmin1.GetCompressionType())

    {

    case 0:

            strImgCompType = "Unknown";
                        break;

    case 1:

            strImgCompType = "No Compression";
                        break;

    case 2:

            strImgCompType = "Group3(1D)";
                        break;

    case 3:

            strImgCompType = "Group3(Modified Huffman)";
                        break;

    case 4:

            strImgCompType = "PackBits";
                        break;

    case 5:

            strImgCompType = "Group4(2D)";
                        break;

    case 6:

            strImgCompType = "JPEG";
                        break;

    case 7:

            strImgCompType = "RBA";
                        break;

    case 8:

            strImgCompType = "Group3(2D)";
                        break;

    case 9:

            strImgCompType = "LZW";
                        break;

    }

    frmInfo.m_CompType = strImgCompType;

    // Read the PageType property and translate the value to a
    // corresponding string.

    switch (ImgAdmin1.GetPageType())

    {

    case 0:

            strImgPageType = "Unknown";
                        break;

    case 1:

            strImgPageType = "Black and White";
                        break;

    case 2:

            strImgPageType = "4 bit grayscale";
                        break;

    case 3:

            strImgPageType = "8 bit grayscale";
                        break;

    case 4:

            strImgPageType = "4 bit palettized";
                        break;

    case 5:

            strImgPageType = "8 bit palettized";
                        break;

    case 6:

            strImgPageType = "24 bit RGB";
                        break;

    case 7:

            strImgPageType = "24 bit BGR";
                        break;

    }

    frmInfo.m_PageType = strImgPageType;

    // Determine the dimensions of the image page.

    long lInfo = ImgAdmin1.GetImageHeight();

    frmInfo.m_Height.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageWidth();

    frmInfo.m_Width.Format("%i",lInfo);

    // Determine the X and Y resolution of the image page.

    lInfo = ImgAdmin1.GetImageResolutionX();

    frmInfo.m_XRes.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageResolutionY();

    frmInfo.m_YRes.Format("%i",lInfo);

    // Determine the number of pages in the file.

    lInfo = ImgAdmin1.GetPageCount();

    frmInfo.m_PageCount.Format("%i",lInfo);

    // Show the form with the image attributes.

    frmInfo.DoModal();

}


ImageWidth Property

See Also	Example-VB	Example-VC++
Returns the width, in pixels, of the current page.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
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.

This property is read-only.


ImageWidth Example - VB
ImageWidth Example [image] VB

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties to request information about a file. Attributes for specific page of a specific file will be displayed.

Private Sub cmdGetInfo_Click()

    Dim strImgFileType, strImgCompType, strImgPageType As String

    ImgAdmin1.Image = "D:\image2\4page.tif"

    'Must specify page number if other than page 1

    ImgAdmin1.PageNumber = 2

    'Load the form where we will display file attributes.

    Load frmInfo

    'Read the Filetype property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.FileType

        Case 0
            strImgFileType = "Unknown"

        Case 1
            strImgFileType = "TIF"

        Case 2
            strImgFileType = "AWD"

        Case 3
            strImgFileType = "BMP"

        Case 4
            strImgFileType = "PCX"

        Case 5
            strImgFileType = "DCX"

        Case 6
            strImgFileType = "JPG"

        Case 7
            strImgFileType = "XIF"

        Case 8
            strImgFileType = "GIF"

        Case 9
            strImgFileType = "WIF"

    End Select

    frmInfo.lblImgInfo(0).Caption = strImgFileType

    'Read the CompressionType property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.CompressionType

        Case 0
            strImgCompType = "Unknown"

        Case 1
            strImgCompType = "No Compression"

        Case 2
            strImgCompType = "Group3(1D)"

        Case 3
            strImgCompType = "Group3(Modified Huffman)"

        Case 4
            strImgCompType = "PackBits"

        Case 5
            strImgCompType = "Group4(2D)"

        Case 6
            strImgCompType = "JPEG"

        Case 7
            strImgCompType = "RBA"

        Case 8
            strImgCompType = "Group3(2D)"

        Case 9
            strImgCompType = "LZW"

    End Select

    frmInfo.lblImgInfo(1).Caption = strImgCompType

    'Read the PageType property and translate the value to a
    'corresponding string.

    Select Case ImgAdmin1.PageType

        Case 0
            strImgPageType = "Unknown"

        Case 1
            strImgPageType = "Black and White"

        Case 2
            strImgPageType = "4 bit grayscale"

        Case 3
            strImgPageType = "8 bit grayscale"

        Case 4
            strImgPageType = "4 bit palettized"

        Case 5
            strImgPageType = "8 bit palettized"

        Case 6
            strImgPageType = "24 bit RGB"

        Case 7
            strImgPageType = "24 bit BGR"

End Select

    frmInfo.lblImgInfo(6).Caption = strImgPageType

    'Determine the dimensions of the image page.

    frmInfo.lblImgInfo(2).Caption = ImgAdmin1.ImageHeight

    frmInfo.lblImgInfo(3).Caption = ImgAdmin1.ImageWidth

    'Determine the X and Y resolution of the image page.

    frmInfo.lblImgInfo(4).Caption = ImgAdmin1.ImageResolutionX

    frmInfo.lblImgInfo(5).Caption = ImgAdmin1.ImageResolutionY

    'Determine the number of pages in the file.

    frmInfo.lblImgInfo(7).Caption = ImgAdmin1.PageCount

    'Show the form with the image attributes.

    frmInfo.Show

End Sub


ImageWidth Example - VC++
ImageWidth Example [image] VC++

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties to request information about a file. Attributes for specific page of a specific file will be displayed.

void CAdmin1Dlg::OnGetimageinfo()

{

    // Load the form where we will display file attributes.

    CFrmInfo frmInfo;

    CString strImgFileType, strImgCompType, strImgPageType;

    // Must specify page number if other than page 1

    ImgAdmin1.SetPageNumber(2);

    // Read the Filetype property and translate the value to
    // a corresponding string.

    switch  (ImgAdmin1.GetFileType())

    {

    case 0:

            strImgFileType = "Unknown";
                        break;

    case 1:

            strImgFileType = "TIF";
                        break;

    case 2:

            strImgFileType = "AWD";
                        break;

    case 3:

            strImgFileType = "BMP";
                        break;

    case 4:

            strImgFileType = "PCX";
                        break;

    case 5:

            strImgFileType = "DCX";
                        break;

    case 6:

            strImgFileType = "JPG";
                     break;

    case 7:

            strImgFileType = "XIF";
                        break;

    case 8:

            strImgFileType = "GIF";
                        break;

    case 9:

            strImgFileType = "WIF";
                       break;

    }

    frmInfo.m_FileType = strImgFileType;

    // Read the CompressionType property and translate the value to
    // a corresponding string.

    switch (ImgAdmin1.GetCompressionType())

    {

    case 0:

            strImgCompType = "Unknown";
                        break;

    case 1:

            strImgCompType = "No Compression";
                        break;

    case 2:

            strImgCompType = "Group3(1D)";
                        break;

    case 3:

            strImgCompType = "Group3(Modified Huffman)";
                        break;

    case 4:

            strImgCompType = "PackBits";
                        break;

    case 5:

            strImgCompType = "Group4(2D)";
                        break;

    case 6:

            strImgCompType = "JPEG";
                        break;

    case 7:

            strImgCompType = "RBA";
                        break;

    case 8:

            strImgCompType = "Group3(2D)";
                        break;

    case 9:

            strImgCompType = "LZW";
                        break;

    }

    frmInfo.m_CompType = strImgCompType;

    // Read the PageType property and translate the value to a
    // corresponding string.

    switch (ImgAdmin1.GetPageType())

    {

    case 0:

            strImgPageType = "Unknown";
                        break;

    case 1:

            strImgPageType = "Black and White";
                        break;

    case 2:

            strImgPageType = "4 bit grayscale";
                        break;

    case 3:

            strImgPageType = "8 bit grayscale";
                        break;

    case 4:

            strImgPageType = "4 bit palettized";
                        break;

    case 5:

            strImgPageType = "8 bit palettized";
                        break;

    case 6:

            strImgPageType = "24 bit RGB";
                        break;

    case 7:

            strImgPageType = "24 bit BGR";
                        break;

    }

    frmInfo.m_PageType = strImgPageType;

    // Determine the dimensions of the image page.

    long lInfo = ImgAdmin1.GetImageHeight();

    frmInfo.m_Height.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageWidth();

    frmInfo.m_Width.Format("%i",lInfo);

    // Determine the X and Y resolution of the image page.

    lInfo = ImgAdmin1.GetImageResolutionX();

    frmInfo.m_XRes.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageResolutionY();

    frmInfo.m_YRes.Format("%i",lInfo);

    // Determine the number of pages in the file.

    lInfo = ImgAdmin1.GetPageCount();

    frmInfo.m_PageCount.Format("%i",lInfo);

    // Show the form with the image attributes.

    frmInfo.DoModal();

}


InitDir Property

See Also	Example-VB	Example-VC++
Returns or sets the initial directory displayed in the dialog box created by the ShowFileDialog method.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Admin control

Syntax

object.InitDir[=directoryname]

Data Type

String

Remarks

If the specified directory is invalid, the current directory is displayed.


InitDir Example - VB
InitDir Example [image] VB

This example shows how to use the ImgAdmin Open dialog box to display a file in the Image Edit and the Thumbnail controls.

Private Sub cmdDisplay_Click()

    'Initialize the Image property to check for Cancel pressed.
    'When the dialog box is shown, check for a value in the
    'Image property.

    ImgAdmin1.Image = ""

    'Specify a dialog title and a list filter rather than using
    'the defaults.

    ImgAdmin1.DialogTitle = "Select Image for Display"

    ImgAdmin1.Filter = "All Image Files |*.bmp; *.jpg; *.tif|
        Bitmap Files(*.bmp)|*. bmp| JPG Files (*.jpg)|*.jpg|
        TIFF Files (*.tif)|*.tif|All Files (*.*)|*.*|"

    'The default filter will be TIFF (fourth item).

    ImgAdmin1.FilterIndex = 4

    'Set the InitDir property to the preferred directory.

    ImgAdmin1.InitDir = "C:\images"

    ImgAdmin1.CancelError = False

   'Note:  if you have Server Access software installed this
   'will automatically be enabled in the Open dialog box after
   'the user authenticates.

    ImgAdmin1.ShowFileDialog OpenDlg, Form1.hWnd

    'Determine if a file was selected or cancel was pressed

    If ImgAdmin1.Image = "" Then Exit Sub

    'Set the image properties in the Image Edit and Thumbnail controls
    'to the name of the file selected in the dialog box.

    ImgEdit1.Image = ImgAdmin1.Image

    ImgThumbnail1.Image = ImgAdmin1.Image

    'Display the image in the Image Edit and Thumbnail control.

    ImgEdit1.Display

End Sub


InitDir Example - VC++
InitDir Example [image] VC++

This example shows how to use the ImgAdmin Open dialog box to display a file in the Image Edit and the Thumbnail controls.

void CAdmin1Dlg::OnFileopen()

{

    // Initialize Image property in order to check for Cancel
    // pressed.  After the dialog box is shown, check for a value
    // in the image property.

    ImgAdmin1.SetImage ("" );

    // Specify a dialog title and a list filter rather than using
    // the defaults.

    ImgAdmin1.SetDialogTitle ("Select Image for Display");

    ImgAdmin1.SetFilter ("All Image Files |*.bmp; *.jpg; *.tif|
        Bitmap Files (*.bmp)|*. bmp|JPG Files (*.jpg)|*.jpg|
        Tiff Files (*.tif)|*.tif|All Files (*.*)|*.*|");

    // Default filter will be TIFF (fourth item).

    ImgAdmin1.SetFilterIndex (4);

    // Set the InitDir property to the preferred directory.

    ImgAdmin1.SetInitDir ("C:\\images");

    ImgAdmin1.SetCancelError (FALSE);

   // Note:  if you have Server Access software installed this
   // will automatically be enabled in the Open dialog box after
   // the user authenticates.

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;
    ImgAdmin1.ShowFileDialog (0,vhWnd);       // OpenDlg

    // Determine if a file was selected or cancel was pressed

    if (ImgAdmin1.GetImage() =="")
            return;

    // Set the image properties in the ImgEdit and Thumbnail control
    // to the name of the file selected in the dialog box.

    ImgEdit1.SetImage (ImgAdmin1.GetImage());

    ImgThumbnail1.SetImage (ImgAdmin1.GetImage());

    // Display the image in the ImgEdit and Thumbnail control.

    ImgEdit1.Display();

}


Init1xFindDir Property

See Also	Example-VB
Returns or sets the initial directory displayed in the dialog box created by the ShowFindDialog method.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.Init1xFindDir[=value]

Data Type

String

Remarks

If the specified directory is invalid, the first 1.x Document Manager volume found is displayed.


IsIBK Property

See Also	Example-VB
Queries the Admin control to see if the file specified by the Image property is a bookmark file.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Admin control

Syntax

object.IsIBK[={True|False}]

Data Type

Boolean

Setting	Description
True	The file specified by the Image property is a bookmark file.
False	The file specified by the Image property is not bookmark file.
Remarks

This is a read-only property.


Keywords Property

See Also	Example-VB	Example-VC++
Sets or returns the Keywords property of the current image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98 (read only)
Applies To

Image Admin control

Syntax

object.Keywords[=value]

Data Type

String

Remarks

This property pertains to local/redirected TIFF files, and 1.x files/documents.

The Keywords property string contains all the keywords for the current image. Individual keywords may be separated either by spaces or by commas. In 1.x documents, unlike TIFF files or 1.x files, keywords may consist of multiple words separated by spaces or commas.

Several rules govern how the string assigned to the Keywords property is broken up into the individual keywords. If the Keywords property string contains at least one comma, then commas are regarded as the delimiters between individual keywords. Otherwise, spaces are considered the delimiters. When a Keyword string contains a single keyword consisting of several words and spaces (1.x documents only), you should end the string with a single trailing comma.  Commas are not permitted to be part of a keyword under any circumstances (this is because of a 1.x document manager restriction).

Setting this property does not write the change to disk. To do so, you must call the SetFileProperties method, or, choose OK in the dialog box created by the ShowFileProperties method.

The current setting of this property can be displayed and changed from the Summary tab on the dialog box created by the ShowFileProperties method.


KeyWords Example - VB
Keywords Example [image] VB

This example shows how you can set several file properties. These properties can also be set by the user at runtime from the UI dialog box created by the ShowFileProperties method.

Private Sub cmdSetProperties_Click()

    'Specify the image you are going to set properties for.

    ImgAdmin1.Image = "D:\image2\hopolicy.tif"

    ImgAdmin1.Title = "HomeOwners Policy"

    ImgAdmin1.Author = "John Q. Agent"

    'Add multiple keywords.

    ImgAdmin1.Keywords = "insurance important house"

    ImgAdmin1.Comments = "1997 Homeowners Policy"

    ImgAdmin1.Subject = "Insurance"

    'Call SetFileProperties to actually write the
    'properties to the file.

    ImgAdmin1.SetFileProperties

End Sub


Keywords Example - VC++
Keywords Example [image] VC++

This example shows how you can set several file properties. These properties can also be set by the user at runtime from the UI dialog box created by the ShowFileProperties method.

void CAdmin1Dlg::OnFileproperties()

{

    // Specify the image you are going to set properties for.

    ImgAdmin1.SetImage ("D:\\image2\\hopolicy.tif");

    ImgAdmin1.SetTitle ("HomeOwners Policy");

    ImgAdmin1.SetAuthor ("John Q. Agent");

    // Adding multiple keywords.

    ImgAdmin1.SetKeywords ("insurance important house");

    ImgAdmin1.SetComments ("1997 Homeowners Policy");

    ImgAdmin1.SetSubject ("Insurance");

    // Call SetFileProperties to actually write the
    // properties to the file.

    ImgAdmin1.SetFileProperties();

}


NameServer Property

See Also	Example-VB
Returns or sets the address of the 1.x server being accessed.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.NameServer[=value]

Data Type

String

Remarks

Use the format “IP address/port number” (for example, 172.25.18.79/4010) to specify the address.

The default value is the name of the 1.x server last accessed. The first time this property is used, the name of the server provided during software installation is used.

The LoginToServer method authenticates the user to the server specified by this property.


NameServer Example [image] VB

This example shows ...

Private Sub xxxxx_Click()

.

.

.

.

End Sub


PageCount Property

See Also	Example-VB	Example-VC++
Returns the number of pages in the image file.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
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.


PageCount Example - VB
PageCount Example [image] VB

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties to request information about a file. Attributes for specific page of a specific file will be displayed.

Private Sub cmdGetInfo_Click()

    Dim strImgFileType, strImgCompType, strImgPageType As String

    ImgAdmin1.Image = "D:\image2\4page.tif"

    'Must specify page number if other than page 1

    ImgAdmin1.PageNumber = 2

    'Load the form where we will display file attributes.

    Load frmInfo

    'Read the Filetype property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.FileType

        Case 0
            strImgFileType = "Unknown"

        Case 1
            strImgFileType = "TIF"

        Case 2
            strImgFileType = "AWD"

        Case 3
            strImgFileType = "BMP"

        Case 4
            strImgFileType = "PCX"

        Case 5
            strImgFileType = "DCX"

        Case 6
            strImgFileType = "JPG"

        Case 7
            strImgFileType = "XIF"

        Case 8
            strImgFileType = "GIF"

        Case 9
            strImgFileType = "WIF"

    End Select

    frmInfo.lblImgInfo(0).Caption = strImgFileType

    'Read the CompressionType property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.CompressionType

        Case 0
            strImgCompType = "Unknown"

        Case 1
            strImgCompType = "No Compression"

        Case 2
            strImgCompType = "Group3(1D)"

        Case 3
            strImgCompType = "Group3(Modified Huffman)"

        Case 4
            strImgCompType = "PackBits"

        Case 5
            strImgCompType = "Group4(2D)"

        Case 6
            strImgCompType = "JPEG"

        Case 7
            strImgCompType = "RBA"

        Case 8
            strImgCompType = "Group3(2D)"

        Case 9
            strImgCompType = "LZW"

    End Select

    frmInfo.lblImgInfo(1).Caption = strImgCompType

    'Read the PageType property and translate the value to a
    'corresponding string.

    Select Case ImgAdmin1.PageType

        Case 0
            strImgPageType = "Unknown"

        Case 1
            strImgPageType = "Black and White"

        Case 2
            strImgPageType = "4 bit grayscale"

        Case 3
            strImgPageType = "8 bit grayscale"

        Case 4
            strImgPageType = "4 bit palettized"

        Case 5
            strImgPageType = "8 bit palettized"

        Case 6
            strImgPageType = "24 bit RGB"

        Case 7
            strImgPageType = "24 bit BGR"

End Select

    frmInfo.lblImgInfo(6).Caption = strImgPageType

    'Determine the dimensions of the image page.

    frmInfo.lblImgInfo(2).Caption = ImgAdmin1.ImageHeight

    frmInfo.lblImgInfo(3).Caption = ImgAdmin1.ImageWidth

    'Determine the X and Y resolution of the image page.

    frmInfo.lblImgInfo(4).Caption = ImgAdmin1.ImageResolutionX

    frmInfo.lblImgInfo(5).Caption = ImgAdmin1.ImageResolutionY

    'Determine the number of pages in the file.

    frmInfo.lblImgInfo(7).Caption = ImgAdmin1.PageCount

    'Show the form with the image attributes.

    frmInfo.Show

End Sub


PageCount Example - VC++
PageCount Example [image] VC++

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties to request information about a file. Attributes for specific page of a specific file will be displayed.

void CAdmin1Dlg::OnGetimageinfo()

{

    // Load the form where we will display file attributes.

    CFrmInfo frmInfo;

    CString strImgFileType, strImgCompType, strImgPageType;

    // Must specify page number if other than page 1

    ImgAdmin1.SetPageNumber(2);

    // Read the Filetype property and translate the value to
    // a corresponding string.

    switch  (ImgAdmin1.GetFileType())

    {

    case 0:

            strImgFileType = "Unknown";
                        break;

    case 1:

            strImgFileType = "TIF";
                        break;

    case 2:

            strImgFileType = "AWD";
                        break;

    case 3:

            strImgFileType = "BMP";
                        break;

    case 4:

            strImgFileType = "PCX";
                        break;

    case 5:

            strImgFileType = "DCX";
                        break;

    case 6:

            strImgFileType = "JPG";
                     break;

    case 7:

            strImgFileType = "XIF";
                        break;

    case 8:

            strImgFileType = "GIF";
                        break;

    case 9:

            strImgFileType = "WIF";
                       break;

    }

    frmInfo.m_FileType = strImgFileType;

    // Read the CompressionType property and translate the value to
    // a corresponding string.

    switch (ImgAdmin1.GetCompressionType())

    {

    case 0:

            strImgCompType = "Unknown";
                        break;

    case 1:

            strImgCompType = "No Compression";
                        break;

    case 2:

            strImgCompType = "Group3(1D)";
                        break;

    case 3:

            strImgCompType = "Group3(Modified Huffman)";
                        break;

    case 4:

            strImgCompType = "PackBits";
                        break;

    case 5:

            strImgCompType = "Group4(2D)";
                        break;

    case 6:

            strImgCompType = "JPEG";
                        break;

    case 7:

            strImgCompType = "RBA";
                        break;

    case 8:

            strImgCompType = "Group3(2D)";
                        break;

    case 9:

            strImgCompType = "LZW";
                        break;

    }

    frmInfo.m_CompType = strImgCompType;

    // Read the PageType property and translate the value to a
    // corresponding string.

    switch (ImgAdmin1.GetPageType())

    {

    case 0:

            strImgPageType = "Unknown";
                        break;

    case 1:

            strImgPageType = "Black and White";
                        break;

    case 2:

            strImgPageType = "4 bit grayscale";
                        break;

    case 3:

            strImgPageType = "8 bit grayscale";
                        break;

    case 4:

            strImgPageType = "4 bit palettized";
                        break;

    case 5:

            strImgPageType = "8 bit palettized";
                        break;

    case 6:

            strImgPageType = "24 bit RGB";
                        break;

    case 7:

            strImgPageType = "24 bit BGR";
                        break;

    }

    frmInfo.m_PageType = strImgPageType;

    // Determine the dimensions of the image page.

    long lInfo = ImgAdmin1.GetImageHeight();

    frmInfo.m_Height.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageWidth();

    frmInfo.m_Width.Format("%i",lInfo);

    // Determine the X and Y resolution of the image page.

    lInfo = ImgAdmin1.GetImageResolutionX();

    frmInfo.m_XRes.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageResolutionY();

    frmInfo.m_YRes.Format("%i",lInfo);

    // Determine the number of pages in the file.

    lInfo = ImgAdmin1.GetPageCount();

    frmInfo.m_PageCount.Format("%i",lInfo);

    // Show the form with the image attributes.

    frmInfo.DoModal();

}


PageNumber Property

See Also	Example-VB	Example-VC++
Returns or sets a page number in the current image file.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
Applies To

Image Admin control

Syntax

object.PageNumber

Data Type

Long

Remarks

The image file is specified by the Image property.

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

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


PageNumber Example - VB
PageNumber Example [image] VB

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties. Attributes for specific page of a specific file will be displayed.

Private Sub cmdGetInfo_Click()

    Dim strImgFileType, strImgCompType, strImgPageType As String

    ImgAdmin1.Image = "D:\image2\4page.tif"

    'Must specify page number if other than page 1

    ImgAdmin1.PageNumber = 2

    'Load the form where we will display file attributes.

    Load frmInfo

    'Read the Filetype property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.FileType

        Case 0
            strImgFileType = "Unknown"

        Case 1
            strImgFileType = "TIF"

        Case 2
            strImgFileType = "AWD"

        Case 3
            strImgFileType = "BMP"

        Case 4
            strImgFileType = "PCX"

        Case 5
            strImgFileType = "DCX"

        Case 6
            strImgFileType = "JPG"

        Case 7
            strImgFileType = "XIF"

        Case 8
            strImgFileType = "GIF"

        Case 9
            strImgFileType = "WIF"

    End Select

    frmInfo.lblImgInfo(0).Caption = strImgFileType

    'Read the CompressionType property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.CompressionType

        Case 0
            strImgCompType = "Unknown"

        Case 1
            strImgCompType = "No Compression"

        Case 2
            strImgCompType = "Group3(1D)"

        Case 3
            strImgCompType = "Group3(Modified Huffman)"

        Case 4
            strImgCompType = "PackBits"

        Case 5
            strImgCompType = "Group4(2D)"

        Case 6
            strImgCompType = "JPEG"

        Case 7
            strImgCompType = "RBA"

        Case 8
            strImgCompType = "Group3(2D)"

        Case 9
            strImgCompType = "LZW"

    End Select

    frmInfo.lblImgInfo(1).Caption = strImgCompType

    'Read the PageType property and translate the value to a
    'corresponding string.

    Select Case ImgAdmin1.PageType

        Case 0
            strImgPageType = "Unknown"

        Case 1
            strImgPageType = "Black and White"

        Case 2
            strImgPageType = "4 bit grayscale"

        Case 3
            strImgPageType = "8 bit grayscale"

        Case 4
            strImgPageType = "4 bit palettized"

        Case 5
            strImgPageType = "8 bit palettized"

        Case 6
            strImgPageType = "24 bit RGB"

        Case 7
            strImgPageType = "24 bit BGR"

End Select

    frmInfo.lblImgInfo(6).Caption = strImgPageType

    'Determine the dimensions of the image page.

    frmInfo.lblImgInfo(2).Caption = ImgAdmin1.ImageHeight

    frmInfo.lblImgInfo(3).Caption = ImgAdmin1.ImageWidth

    'Determine the X and Y resolution of the image page.

    frmInfo.lblImgInfo(4).Caption = ImgAdmin1.ImageResolutionX

    frmInfo.lblImgInfo(5).Caption = ImgAdmin1.ImageResolutionY

    'Determine the number of pages in the file.

    frmInfo.lblImgInfo(7).Caption = ImgAdmin1.PageCount

    'Show the form with the image attributes.

    frmInfo.Show

End Sub


PageNumber Example - VC++
PageNumber Example [image] VC++

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties to request information about a file. Attributes for specific page of a specific file will be displayed.

void CAdmin1Dlg::OnGetimageinfo()

{

    // Load the form where we will display file attributes.

    CFrmInfo frmInfo;

    CString strImgFileType, strImgCompType, strImgPageType;

    // Must specify page number if other than page 1

    ImgAdmin1.SetPageNumber(2);

    // Read the Filetype property and translate the value to

    // a corresponding string.

    switch  (ImgAdmin1.GetFileType())

    {

    case 0:

            strImgFileType = "Unknown";
                        break;

    case 1:

            strImgFileType = "TIF";
                        break;

    case 2:

            strImgFileType = "AWD";
                        break;

    case 3:

            strImgFileType = "BMP";
                        break;

    case 4:

            strImgFileType = "PCX";
                        break;

    case 5:

            strImgFileType = "DCX";
                        break;

    case 6:

            strImgFileType = "JPG";
                     break;

    case 7:

            strImgFileType = "XIF";
                        break;

    case 8:

            strImgFileType = "GIF";
                        break;

    case 9:

            strImgFileType = "WIF";
                       break;

    }

    frmInfo.m_FileType = strImgFileType;

    // Read the CompressionType property and translate the value to
    // a corresponding string.

    switch (ImgAdmin1.GetCompressionType())

    {

    case 0:

            strImgCompType = "Unknown";
                        break;

    case 1:

            strImgCompType = "No Compression";
                        break;

    case 2:

            strImgCompType = "Group3(1D)";
                        break;

    case 3:

            strImgCompType = "Group3(Modified Huffman)";
                        break;

    case 4:

            strImgCompType = "PackBits";
                        break;

    case 5:

            strImgCompType = "Group4(2D)";
                        break;

    case 6:

            strImgCompType = "JPEG";
                        break;

    case 7:

            strImgCompType = "RBA";
                        break;

    case 8:

            strImgCompType = "Group3(2D)";
                        break;

    case 9:

            strImgCompType = "LZW";
                        break;

    }

    frmInfo.m_CompType = strImgCompType;

    // Read the PageType property and translate the value to a
    // corresponding string.

    switch (ImgAdmin1.GetPageType())

    {

    case 0:

            strImgPageType = "Unknown";
                        break;

    case 1:

            strImgPageType = "Black and White";
                        break;

    case 2:

            strImgPageType = "4 bit grayscale";
                        break;

    case 3:

            strImgPageType = "8 bit grayscale";
                        break;

    case 4:

            strImgPageType = "4 bit palettized";
                        break;

    case 5:

            strImgPageType = "8 bit palettized";
                        break;

    case 6:

            strImgPageType = "24 bit RGB";
                        break;

    case 7:

            strImgPageType = "24 bit BGR";
                        break;

    }

    frmInfo.m_PageType = strImgPageType;

    // Determine the dimensions of the image page.

    long lInfo = ImgAdmin1.GetImageHeight();

    frmInfo.m_Height.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageWidth();

    frmInfo.m_Width.Format("%i",lInfo);

    // Determine the X and Y resolution of the image page.

    lInfo = ImgAdmin1.GetImageResolutionX();

    frmInfo.m_XRes.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageResolutionY();

    frmInfo.m_YRes.Format("%i",lInfo);

    // Determine the number of pages in the file.

    lInfo = ImgAdmin1.GetPageCount();

    frmInfo.m_PageCount.Format("%i",lInfo);

    // Show the form with the image attributes.

    frmInfo.DoModal();

}


PageType Property

See Also	Example-VB	Example-VC++
Returns the page type of the specified page.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
Applies To

Image Admin control

Syntax

object.PageType[=value]

Data Type

PageTypeValue (Integer)

Constant	Setting	Description
PageTypeUnk	0	Unknown
PageTypeBW	1	Black and white
PageTypeGray4	2	4-bit gray scale
PageTypeGray8	3	8-bit gray scale
PageTypePal4	4	4-bit palettized
PageTypePal8	5	8-bit palettized
PageTypeRGB24	6	24-bit RGB
PageTypeBGR24	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.


PageType Example - VB
PageType Example [image] VB

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties. Attributes for specific page of a specific file will be displayed.

Private Sub cmdGetInfo_Click()

    Dim strImgFileType, strImgCompType, strImgPageType As String

    ImgAdmin1.Image = "D:\image2\4page.tif"

    'Must specify page number if other than page 1

    ImgAdmin1.PageNumber = 2

    'Load the form where we will display file attributes.

    Load frmInfo

    'Read the Filetype property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.FileType

        Case 0
            strImgFileType = "Unknown"

        Case 1
            strImgFileType = "TIF"

        Case 2
            strImgFileType = "AWD"

        Case 3
            strImgFileType = "BMP"

        Case 4
            strImgFileType = "PCX"

        Case 5
            strImgFileType = "DCX"

        Case 6
            strImgFileType = "JPG"

        Case 7
            strImgFileType = "XIF"

        Case 8
            strImgFileType = "GIF"

        Case 9
            strImgFileType = "WIF"

    End Select

    frmInfo.lblImgInfo(0).Caption = strImgFileType

    'Read the CompressionType property and translate the value to
    'a corresponding string.

    Select Case ImgAdmin1.CompressionType

        Case 0
            strImgCompType = "Unknown"

        Case 1
            strImgCompType = "No Compression"

        Case 2
            strImgCompType = "Group3(1D)"

        Case 3
            strImgCompType = "Group3(Modified Huffman)"

        Case 4
            strImgCompType = "PackBits"

        Case 5
            strImgCompType = "Group4(2D)"

        Case 6
            strImgCompType = "JPEG"

        Case 7
            strImgCompType = "RBA"

        Case 8
            strImgCompType = "Group3(2D)"

        Case 9
            strImgCompType = "LZW"

    End Select

    frmInfo.lblImgInfo(1).Caption = strImgCompType

    'Read the PageType property and translate the value to a
    'corresponding string.

    Select Case ImgAdmin1.PageType

        Case 0
            strImgPageType = "Unknown"

        Case 1
            strImgPageType = "Black and White"

        Case 2
            strImgPageType = "4 bit grayscale"

        Case 3
            strImgPageType = "8 bit grayscale"

        Case 4
            strImgPageType = "4 bit palettized"

        Case 5
            strImgPageType = "8 bit palettized"

        Case 6
            strImgPageType = "24 bit RGB"

        Case 7
            strImgPageType = "24 bit BGR"

End Select

    frmInfo.lblImgInfo(6).Caption = strImgPageType

    'Determine the dimensions of the image page.

    frmInfo.lblImgInfo(2).Caption = ImgAdmin1.ImageHeight

    frmInfo.lblImgInfo(3).Caption = ImgAdmin1.ImageWidth

    'Determine the X and Y resolution of the image page.

    frmInfo.lblImgInfo(4).Caption = ImgAdmin1.ImageResolutionX

    frmInfo.lblImgInfo(5).Caption = ImgAdmin1.ImageResolutionY

    'Determine the number of pages in the file.

    frmInfo.lblImgInfo(7).Caption = ImgAdmin1.PageCount

    'Show the form with the image attributes.

    frmInfo.Show

End Sub


PageType - VC++
PageType Example [image] VC++

This example shows how you can use the CompressionType, FileType, ImageHeight, ImageResolutionX, ImageResolutionY, ImageWidth and PageCount properties to request information about a file. Attributes for specific page of a specific file will be displayed.

void CAdmin1Dlg::OnGetimageinfo()

{

    // Load the form where we will display file attributes.

    CFrmInfo frmInfo;

    CString strImgFileType, strImgCompType, strImgPageType;

    // Must specify page number if other than page 1

    ImgAdmin1.SetPageNumber(2);

    // Read the Filetype property and translate the value to
    // a corresponding string.

    switch  (ImgAdmin1.GetFileType())

    {

    case 0:

            strImgFileType = "Unknown";
                        break;

    case 1:

            strImgFileType = "TIF";
                        break;

    case 2:

            strImgFileType = "AWD";
                        break;

    case 3:

            strImgFileType = "BMP";
                        break;

    case 4:

            strImgFileType = "PCX";
                        break;

    case 5:

            strImgFileType = "DCX";
                        break;

    case 6:

            strImgFileType = "JPG";
                     break;

    case 7:

            strImgFileType = "XIF";
                        break;

    case 8:

            strImgFileType = "GIF";
                        break;

    case 9:

            strImgFileType = "WIF";
                       break;

    }

    frmInfo.m_FileType = strImgFileType;

    // Read the CompressionType property and translate the value to
    // a corresponding string.

    switch (ImgAdmin1.GetCompressionType())

    {

    case 0:

            strImgCompType = "Unknown";
                        break;

    case 1:

            strImgCompType = "No Compression";
                        break;

    case 2:

            strImgCompType = "Group3(1D)";
                        break;

    case 3:

            strImgCompType = "Group3(Modified Huffman)";
                        break;

    case 4:

            strImgCompType = "PackBits";
                        break;

    case 5:

            strImgCompType = "Group4(2D)";
                        break;

    case 6:

            strImgCompType = "JPEG";
                        break;

    case 7:

            strImgCompType = "RBA";
                        break;

    case 8:

            strImgCompType = "Group3(2D)";
                        break;

    case 9:

            strImgCompType = "LZW";
                        break;

    }

    frmInfo.m_CompType = strImgCompType;

    // Read the PageType property and translate the value to a
    // corresponding string.

    switch (ImgAdmin1.GetPageType())

    {

    case 0:

            strImgPageType = "Unknown";
                        break;

    case 1:

            strImgPageType = "Black and White";
                        break;

    case 2:

            strImgPageType = "4 bit grayscale";
                        break;

    case 3:

            strImgPageType = "8 bit grayscale";
                        break;

    case 4:

            strImgPageType = "4 bit palettized";
                        break;

    case 5:

            strImgPageType = "8 bit palettized";
                        break;

    case 6:

            strImgPageType = "24 bit RGB";
                        break;

    case 7:

            strImgPageType = "24 bit BGR";
                        break;

    }

    frmInfo.m_PageType = strImgPageType;

    // Determine the dimensions of the image page.

    long lInfo = ImgAdmin1.GetImageHeight();

    frmInfo.m_Height.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageWidth();

    frmInfo.m_Width.Format("%i",lInfo);

    // Determine the X and Y resolution of the image page.

    lInfo = ImgAdmin1.GetImageResolutionX();

    frmInfo.m_XRes.Format("%i",lInfo);

    lInfo = ImgAdmin1.GetImageResolutionY();

    frmInfo.m_YRes.Format("%i",lInfo);

    // Determine the number of pages in the file.

    lInfo = ImgAdmin1.GetPageCount();

    frmInfo.m_PageCount.Format("%i",lInfo);

    // Show the form with the image attributes.

    frmInfo.DoModal();

}


PrintAnnotations Property

See Also	Example-VB	Example-VC++
Returns or sets the state of the Print Displayed Annotations check box in the Print dialog box.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Admin control

Syntax

object.PrintAnnotations[={True|False}]

Data Type

Boolean

Setting	Description
True (default)	The check box is checked, and visible annotations are printed
False	The check box is not checked and visible annotations are not 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.


PrintAnnotations Example - VB
PrintAnnotations Example [image] VB

This example uses the ShowPrintDialog method to enable the user to specify printing parameters. The image displayed in the Image Edit control is then printed.

Private Sub cmdPrint_Click()

    On Error GoTo PrintErr

    'Display an image

    ImgEdit1.Image = "D:\image2\4page.tif"

    ImgEdit1.Display

    'Reset NumCopies in case user printed multiple copies last time.

    ImgAdmin1.PrintNumCopies = 1

    'If CancelError is true, an error is generated if user presses
    'cancel.  Trap the error to avoid trying to print the file.

    ImgAdmin1.CancelError = True

    'Set filename to be printed to the displayed file. If this
    'property is not set the dialog box will not display.

    ImgAdmin1.Image = ImgEdit1.Image

    ImgAdmin1.ShowPrintDialog Form1.hWnd

    'Print the image using the parameters obtained from the print
    'dialog box (for example, start page, end page, and so on).

    ImgEdit1.PrintImage ImgAdmin1.PrintStartPage,
        ImgAdmin1.PrintEndPage, ImgAdmin1.PrintOutputFormat,
        ImgAdmin1.PrintAnnotations

PrintErr:

    'User pressed the cancel button

        Exit Sub

End Sub


PrintAnnotations Example - VC++
PrintAnnotations Example [image] VC++

This example uses the ShowPrintDialog method to enable the user to specify printing parameters. The image displayed in the Image Edit control is then printed.

void CAdmin1Dlg::OnPrint()

{

    // Display an image

    ImgEdit1.SetImage ("D:\\image2\\4page.tif");

    ImgEdit1.Display();

    // Reset NumCopies in case user printed multiple copies last time.

    ImgAdmin1.SetPrintNumCopies (1);

    // If CancelError is true, an error is generated if user presses
    // cancel.  Trap the error to avoid trying to print the file.

    ImgAdmin1.SetCancelError (TRUE);

    // Set filename to be printed to the displayed file. If this property
    // is not set the dialog box will not display.

    ImgAdmin1.SetImage (ImgEdit1.GetImage());

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowPrintDialog (vhWnd);

    // Print the image using the parameters obtained from the print
    // dialog box (ex. start page, end page etc.).

     VARIANT vStart, vEnd, vOutputFormat, vAnnotations, evt;
     evt.vt = VT_ERROR;      // set to error for optional parameter

     V_I4(&vStart) = ImgAdmin1.GetPrintStartPage();
     V_I4(&vEnd) = ImgAdmin1.GetPrintEndPage();
     V_I4(&vOutputFormat) = ImgAdmin1.GetPrintOutputFormat();
     V_I4(&vAnnotations) = ImgAdmin1.GetPrintAnnotations();

     ImgEdit1.PrintImage (vStart, vEnd, vOutputFormat,
         vAnnotations, evt, evt, evt);

}


PrintCollate Property

See Also	Example-VB
Returns or sets the state of the Collate check box in the the Print dialog box.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.PrintCollate[={True|False}]

Data Type

Boolean

Setting	Description
True	The Collate check box is checked [image] multiple copies are printed and collated
False (default)	The Collate check box is not checked [image] multiple copies are printed but not collated
Remarks

The setting of this property is indicated by the state of the Collate check box when the Print dialog box is first opened. The user can then accept or change the value.

The Print dialog box is created by the ShowPrintDialog method.


PrintCollate Example [image] VB

This example shows ureqwur worrworrw wpvjjv wqrq[iriwqir tiqwriwqrqw qwir[wqir qwr[pi[wqi .

Private Sub xxxxx_Click()

.

.

.

.

End Sub


PrintEndPage Property

See Also	Example-VB	Example-VC++
Returns or sets the number of the last page to be printed, which is displayed in the Print dialog box.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
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).


PrintEndPage Example - VB
PrintEndPage Example [image] VB

This example uses the ShowPrintDialog method to enable the user to specify printing parameters. The image displayed in the Image Edit control is then printed.

Private Sub cmdPrint_Click()

    On Error GoTo PrintErr

    'Display an image

    ImgEdit1.Image = "D:\image2\4page.tif"

    ImgEdit1.Display

    'Reset NumCopies in case user printed multiple copies last time.

    ImgAdmin1.PrintNumCopies = 1

    'If CancelError is true, an error is generated if user presses
    'cancel.  Trap the error to avoid trying to print the file.

    ImgAdmin1.CancelError = True

    'Set filename to be printed to the displayed file. If this property
    'is not set the dialog box will not display.

    ImgAdmin1.Image = ImgEdit1.Image

    ImgAdmin1.ShowPrintDialog Form1.hWnd

    'Print the image using the parameters obtained from the print
    'dialog box (for example, start page, end page, and so on).

    ImgEdit1.PrintImage ImgAdmin1.PrintStartPage,
        ImgAdmin1.PrintEndPage, ImgAdmin1.PrintOutputFormat,
        ImgAdmin1.PrintAnnotations

PrintErr:

    'User pressed the cancel button

        Exit Sub

End Sub


PrintEndPage Example - VC++
PrintEndPage Example [image] VC++

This example uses the ShowPrintDialog method to enable the user to specify printing parameters. The image displayed in the Image Edit control is then printed.

void CAdmin1Dlg::OnPrint()

{

    // Display an image

    ImgEdit1.SetImage ("D:\\image2\\4page.tif");

    ImgEdit1.Display();

    // Reset NumCopies in case user printed multiple copies last time.

    ImgAdmin1.SetPrintNumCopies (1);

    // If CancelError is true, an error is generated if user presses
    // cancel.  Trap the error to avoid trying to print the file.

    ImgAdmin1.SetCancelError (TRUE);

    // Set filename to be printed to the displayed file. If this property
    // is not set the dialog box will not display.

    ImgAdmin1.SetImage (ImgEdit1.GetImage());

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowPrintDialog (vhWnd);

    // Print the image using the parameters obtained from the print
    // dialog box (ex. start page, end page etc.).

    VARIANT vStart, vEnd, vOutputFormat, vAnnotations, evt;
    evt.vt = VT_ERROR;      // set to error for optional parameter

    V_I4(&vStart) = ImgAdmin1.GetPrintStartPage();
    V_I4(&vEnd) = ImgAdmin1.GetPrintEndPage();
    V_I4(&vOutputFormat) = ImgAdmin1.GetPrintOutputFormat();
    V_I4(&vAnnotations) = ImgAdmin1.GetPrintAnnotations();

    ImgEdit1.PrintImage (vStart, vEnd, vOutputFormat ,
        vAnnotations, evt, evt, evt);

}


PrintNumCopies Property

See Also	Example-VB	Example-VC++
Returns or sets the default number of copies to be printed, which is displayed in the Print Dialog box.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Admin control

Syntax

object.PrintNumCopies[=value]

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 value entered by the user is returned by the ShowPrintDialog method.

The default is 1 copy.


PrintNumCopies Example - VB
PrintNumCopies Example [image] VB

This example uses the ShowPrintDialog method to enable the user to specify printing parameters. The image displayed in the Image Edit control is then printed.

Private Sub cmdPrint_Click()

    On Error GoTo PrintErr

    'Display an image

    ImgEdit1.Image = "D:\image2\4page.tif"

    ImgEdit1.Display

    'Reset NumCopies in case user printed multiple copies last time.

    ImgAdmin1.PrintNumCopies = 1

    'If CancelError is true, an error is generated if user presses
    'cancel.  Trap the error to avoid trying to print the file.

    ImgAdmin1.CancelError = True

    'Set filename to be printed to the displayed file. If this property
    'is not set the dialog box will not display.

    ImgAdmin1.Image = ImgEdit1.Image

    ImgAdmin1.ShowPrintDialog Form1.hWnd

    'Print the image using the parameters obtained from the print
    'dialog box (for example, start page, end page, and so on).

    ImgEdit1.PrintImage ImgAdmin1.PrintStartPage,
        ImgAdmin1.PrintEndPage, ImgAdmin1.PrintOutputFormat,
        ImgAdmin1.PrintAnnotations

PrintErr:

    'User pressed the cancel button

        Exit Sub

End Sub


PrintNumCopies Example - VC++
PrintNumCopies Example [image] VC++

This example uses the ShowPrintDialog method to enable the user to specify printing parameters. The image displayed in the Image Edit control is then printed.

void CAdmin1Dlg::OnPrint()

{

    // Display an image

    ImgEdit1.SetImage ("D:\\image2\\4page.tif");

    ImgEdit1.Display();

    // Reset NumCopies in case user printed multiple copies last time.

    ImgAdmin1.SetPrintNumCopies (1);

    // If CancelError is true, an error is generated if user presses
    // cancel.  Trap the error to avoid trying to print the file.

    ImgAdmin1.SetCancelError (TRUE);

    // Set filename to be printed to the displayed file. If this property
    // is not set the dialog box will not display.

    ImgAdmin1.SetImage (ImgEdit1.GetImage());

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowPrintDialog (vhWnd);

    // Print the image using the parameters obtained from the print
    // dialog box (ex. start page, end page etc.).

    VARIANT vStart, vEnd, vOutputFormat, vAnnotations, evt;
    evt.vt = VT_ERROR;      // set to error for optional parameter

    V_I4(&vStart) = ImgAdmin1.GetPrintStartPage();
    V_I4(&vEnd) = ImgAdmin1.GetPrintEndPage();
    V_I4(&vOutputFormat) = ImgAdmin1.GetPrintOutputFormat();
    V_I4(&vAnnotations) = ImgAdmin1.GetPrintAnnotations();

    ImgEdit1.PrintImage (vStart, vEnd, vOutputFormat ,
        vAnnotations, evt, evt, evt);

}


PrintOrientation Property

See Also	Example-VB
Returns or sets the the orientation of the printed page(s), which is displayed in the Print Dialog box.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.PrintOrientation[=value]

Data Type

PrintOrientationValue (Integer)

Constant	Setting	Description
PrintPortrait	0	Portrait
PrintLandscape	1	Landscape
PrintAutomatic	2 (default)	Automatic [image] the best orientation for each page is determined by the PrintImage method (Image Edit control)
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.


PrintOrientation Example [image] VB

This example shows …

Private Sub xxxxx_Click()

.

.

.

.

End Sub


PrintOutputFormat Property

See Also	Example-VB	Example-VC++
Returns or sets the format of the printer output, which is displayed in the Print Dialog box.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Admin control

Syntax

object.PrintOutputFormat[=value]

Data Type

PrintFormatValue (Integer)

Constant	Setting	Description
OutPixel	0	Pixel-to-pixel
OutActualSize	1	Actual size
OutFitPage	2	Fit to page
OutBestFit	3 (default)	Prints actual size if the image fits on the paper; otherwise, prints 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.

The OutBestFit value is only available in Imaging for Windows Professional Edition V2.0 and V2.5.


PrintOutputFormat Example - VB
PrintOutputFormat Example [image] VB

This example uses the ShowPrintDialog method to enable the user to specify printing parameters. The image displayed in the Image Edit control is then printed.

Private Sub cmdPrint_Click()

    On Error GoTo PrintErr

    'Display an image

    ImgEdit1.Image = "D:\image2\4page.tif"

    ImgEdit1.Display

    'Reset NumCopies in case user printed multiple copies last time.

    ImgAdmin1.PrintNumCopies = 1

    'If CancelError is true, an error is generated if user presses
    'cancel.  Trap the error to avoid trying to print the file.

    ImgAdmin1.CancelError = True

    'Set filename to be printed to the displayed file. If this property
    'is not set the dialog box will not display.

    ImgAdmin1.Image = ImgEdit1.Image

    ImgAdmin1.ShowPrintDialog Form1.hWnd

    'Print the image using the parameters obtained from the print
    'dialog box (for example, start page, end page, and so on).

    ImgEdit1.PrintImage ImgAdmin1.PrintStartPage,
        ImgAdmin1.PrintEndPage, ImgAdmin1.PrintOutputFormat,
        ImgAdmin1.PrintAnnotations

PrintErr:

    'User pressed the cancel button

        Exit Sub

End Sub


PrintOutputFormat Example - VC++
PrintOutputFormat Example [image] VC++

This example uses the ShowPrintDialog method to enable the user to specify printing parameters. The image displayed in the Image Edit control is then printed.

void CAdmin1Dlg::OnPrint()

{

    // Display an image

    ImgEdit1.SetImage ("D:\\image2\\4page.tif");

    ImgEdit1.Display();

    // Reset NumCopies in case user printed multiple copies last time.

    ImgAdmin1.SetPrintNumCopies (1);

    // If CancelError is true, an error is generated if user presses
    // cancel.  Trap the error to avoid trying to print the file.

    ImgAdmin1.SetCancelError (TRUE);

    // Set filename to be printed to the displayed file. If this property
    // is not set the dialog box will not display.

    ImgAdmin1.SetImage (ImgEdit1.GetImage());

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowPrintDialog (vhWnd);

    // Print the image using the parameters obtained from the print
    // dialog box (ex. start page, end page etc.).

    VARIANT vStart, vEnd, vOutputFormat, vAnnotations, evt;
    evt.vt = VT_ERROR;      // set to error for optional parameter

    V_I4(&vStart) = ImgAdmin1.GetPrintStartPage();
    V_I4(&vEnd) = ImgAdmin1.GetPrintEndPage();
    V_I4(&vOutputFormat) = ImgAdmin1.GetPrintOutputFormat();
    V_I4(&vAnnotations) = ImgAdmin1.GetPrintAnnotations();

    ImgEdit1.PrintImage (vStart, vEnd, vOutputFormat ,
        vAnnotations, evt, evt, evt);

}


PrintRangeOption Property

See Also	Example-VB
Returns or sets the print range option in the Print Dialog box.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Admin control

Syntax

object.PrintRangeOption[=value]

Data Type

RangeValue (Integer)

Constant	Setting	Description
PrintAll	0 (default)	All pages
PrintRange	1	Range of pages
PrintCurrent	2	Current page
PrintSelection	3	Current selection
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.

The PrintSelection value is only available in Imaging for Windows Professional Edition V2.0.


PrintRangeOption Example [image] VB


PrintStartPage Property

See Also	Example-VB	Example-VC++
Returns or sets, in the Print dialog box, the number of the first page to be printed.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
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).


PrintStartPage Example - VB
PrintStartPage Example [image] VB

This example uses the ShowPrintDialog method to enable the user to specify printing parameters. The image displayed in the Image Edit control is then printed.

Private Sub cmdPrint_Click()

    On Error GoTo PrintErr

    'Display an image

    ImgEdit1.Image = "D:\image2\4page.tif"

    ImgEdit1.Display

    'Reset NumCopies in case user printed multiple copies last time.

    ImgAdmin1.PrintNumCopies = 1

    'If CancelError is true, an error is generated if user presses
    'cancel.  Trap the error to avoid trying to print the file.

    ImgAdmin1.CancelError = True

    'Set filename to be printed to the displayed file. If this property
    'is not set the dialog box will not display.

    ImgAdmin1.Image = ImgEdit1.Image

    ImgAdmin1.ShowPrintDialog Form1.hWnd

    'Print the image using the parameters obtained from the print
    'dialog box (for example, start page, end page, and so on).

    ImgEdit1.PrintImage ImgAdmin1.PrintStartPage,
        ImgAdmin1.PrintEndPage, ImgAdmin1.PrintOutputFormat,
        ImgAdmin1.PrintAnnotations

PrintErr:

    'User pressed the cancel button

        Exit Sub

End Sub


PrintStartPage Example - VC++
PrintStartPage Example [image] VC++

This example uses the ShowPrintDialog method to enable the user to specify printing parameters. The image displayed in the Image Edit control is then printed.

void CAdmin1Dlg::OnPrint()

{

    // Display an image

    ImgEdit1.SetImage ("D:\\image2\\4page.tif");

    ImgEdit1.Display();

    // Reset NumCopies in case user printed multiple copies last time.

    ImgAdmin1.SetPrintNumCopies (1);

    // If CancelError is true, an error is generated if user presses
    // cancel.  Trap the error to avoid trying to print the file.

    ImgAdmin1.SetCancelError (TRUE);

    // Set filename to be printed to the displayed file. If this property
    // is not set the dialog box will not display.

    ImgAdmin1.SetImage (ImgEdit1.GetImage());

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowPrintDialog (vhWnd);

    // Print the image using the parameters obtained from the print
    // dialog box (ex. start page, end page etc.).

    VARIANT vStart, vEnd, vOutputFormat, vAnnotations, evt;
    evt.vt = VT_ERROR;      // set to error for optional parameter

    V_I4(&vStart) = ImgAdmin1.GetPrintStartPage();
    V_I4(&vEnd) = ImgAdmin1.GetPrintEndPage();
    V_I4(&vOutputFormat) = ImgAdmin1.GetPrintOutputFormat();
    V_I4(&vAnnotations) = ImgAdmin1.GetPrintAnnotations();

    ImgEdit1.PrintImage (vStart, vEnd, vOutputFormat ,
        vAnnotations, evt, evt, evt);

}


PrintToFile Property

See Also	Example-VB
Returns or sets the state of the Print to File check box in the Print dialog box.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


PrintToFile Example [image] VB


SaveAsName Property

See Also	Example-VB
Sets the unqualified or qualified file namestring to be used in the Filename edit field of the SaveAs dialog box.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.SaveAsName[=value]

Data Type

String

Remarks

The value set by this property is displayed when the SaveAs dialog (ShowFileDialog method) is first opened.  The user can accept or change this value. The default value is the name of the image defined in the Image property. If none is defined, the filename field is left blank. This property’s value is automatically cleared after the SaveAs dialog is completed.


Subject Property

See Also	Example-VB	Example-VC++
Returns or sets the Subject property of the current image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98 (read only)
Applies To

Image Admin control

Syntax

object.Subject[=value]

Data Type

String

Remarks

This property pertains to local/redirected TIFF files, and 1.x files (not documents).

Setting this property does not write the change to disk. To do so, you must call the SetFileProperties method, or, choose OK in the dialog box created by the ShowFileProperties method.

The current setting of this property can be displayed and changed from the Summary tab on the dialog box created by the ShowFileProperties method.


Subject Example - VB
Subject Example [image] VB

This example shows how you can set several file properties. These properties can also be set by the user at runtime from the UI dialog box created by the ShowFileProperties method.

Private Sub cmdSetProperties_Click()

    'Specify the image you are going to set properties for.

    ImgAdmin1.Image = "D:\image2\hopolicy.tif"

    ImgAdmin1.Title = "HomeOwners Policy"

    ImgAdmin1.Author = "John Q. Agent"

    'Add multiple keywords.

    ImgAdmin1.Keywords = "insurance important house"

    ImgAdmin1.Comments = "1997 Homeowners Policy"

    ImgAdmin1.Subject = "Insurance"

    'Call SetFileProperties to actually write the properties to the file.

    ImgAdmin1.SetFileProperties

End Sub


Subject Example - VC++
Subject Example [image] VC++

This example shows how you can set several file properties. These properties can also be set by the user at runtime from the UI dialog box created by the ShowFileProperties method.

void CAdmin1Dlg::OnFileproperties()

{

    // Specify the image you are going to set properties for.

    ImgAdmin1.SetImage ("D:\\image2\\hopolicy.tif");

    ImgAdmin1.SetTitle ("HomeOwners Policy");

    ImgAdmin1.SetAuthor ("John Q. Agent");

    // Adding multiple keywords.

    ImgAdmin1.SetKeywords ("insurance important house");

    ImgAdmin1.SetComments ("1997 Homeowners Policy");

    ImgAdmin1.SetSubject ("Insurance");

    // Call SetFileProperties to actually write the properties to the file.

    ImgAdmin1.SetFileProperties();

}


Title Property

See Also	Example-VB	Example-VC++
Returns or sets the Title property of the current image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98 (read only)
Applies To

Image Admin control

Syntax

object.Title[=value]

Data Type

String

Remarks

Microsoft Internet Explorer 4.0 reserves for its own use a property named Title. Therefore, you must use the following syntax if you use the Title property of the Image Admin control on an HTML page in Internet Explorer 4.0.

ImgAdmin1.Object.Title = "My Title"

If you do not include the Object property node, the Image Admin control will not read or write the Title property from the TIFF image nor will an error be reported. Note, however, that this syntax will generate an error in non-HTML environments or with Internet Explorer 3.0.

This property pertains to local/redirected TIFF files, and 1.x files (not documents).

Setting this property does not write the change to disk. To do so, you must call the SetFileProperties method, or, choose OK in the dialog box created by the ShowFileProperties method.

The current setting of this property can be displayed and changed from the Summary tab on the dialog box created by the ShowFileProperties method.


Title Example - VB
Title Example [image] VB

This example shows how you can set several file properties. These properties can also be set by the user at runtime from the UI dialog box created by the ShowFileProperties method.

Private Sub cmdSetProperties_Click()

    'Specify the image you are going to set properties for.

    ImgAdmin1.Image = "D:\image2\hopolicy.tif"

    ImgAdmin1.Title = "HomeOwners Policy"

    ImgAdmin1.Author = "John Q. Agent"

    'Add multiple keywords.

    ImgAdmin1.Keywords = "insurance important house"

    ImgAdmin1.Comments = "1997 Homeowners Policy"

    ImgAdmin1.Subject = "Insurance"

    'Call SetFileProperties to actually write the properties to the file.

    ImgAdmin1.SetFileProperties

End Sub


Title Example - VC++
Title Example [image] VC++

This example shows how you can set several file properties. These properties can also be set by the user at runtime from the UI dialog box created by the ShowFileProperties method.

void CAdmin1Dlg::OnFileproperties()

{

    // Specify the image you are going to set properties for.

    ImgAdmin1.SetImage ("D:\\image2\\hopolicy.tif");

    ImgAdmin1.SetTitle ("HomeOwners Policy");

    ImgAdmin1.SetAuthor ("John Q. Agent");

    // Adding multiple keywords.

    ImgAdmin1.SetKeywords ("insurance important house");

    ImgAdmin1.SetComments ("1997 Homeowners Policy");

    ImgAdmin1.SetSubject ("Insurance");

    // Call SetFileProperties to actually write the properties to the file.

    ImgAdmin1.SetFileProperties();

}


Append Method

See Also	Example-VB	Example-VC++
Appends one or more pages to the current image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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. The file can reside on a   local or redirected drive (desktop)   1.x server   Enterprise Imaging server
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. See CompressionType property for allowable values.
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. See CompressionInfo property for allowable values.
Remarks

The current image file is specified by the Image property. If an image does not exist, one will be created.

The current image, if one exists, must be in TIFF or AWD format, as they 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 CompressionInfo argument is 0 (zero), a default JPEG value is used. The default value is 4096 (high resolution, high quality).

If the destination is a 1.x document, and the source page does not reside in the 1.x repository, the FileStgLoc1x property must be set.

For other operations with 1.x documents, the ForceFileLinking1x property can be used.


Append Example - VB
Append Example [image] VB

This example demonstrates how to append 3 image pages to a file.

Private Sub cmdAppend_Click()

    Dim strOrigFile As String, strAppendFile As String

    Dim lngPgCount As Long

    'This is the displayed image to which we are appending.

    ImgAdmin1.Image = "D:\image2\original.tif"

    'Because we are using the dialog box to pick the file for append,
    'we need to save the original file.

    strOrigFile = ImgAdmin1.Image

    ImgAdmin1.DialogTitle = "Select the file to be appended to the
        displayed image"

    ImgAdmin1.ShowFileDialog OpenDlg

    strAppendFile = ImgAdmin1.Image

    'Restore the original filename to the Image property because
    'the property must contain the destination file name.

    ImgAdmin1.Image = strOrigFile

    'Append 3 pages starting with page 1.

    ImgAdmin1.Append strAppendFile, 1, 3

End Sub


Append Example - VC++
Append Example [image] VC++

This example demonstrates how to append 3 image pages to a file.

void CAdmin1Dlg::OnAppend()

{

    CString strOrigFile, strAppendFile;

    // This is the displayed image which we are going to append to

    ImgAdmin1.SetImage ("D:\\image2\\original.tif");

    // We will use the dialog box to pick the file for append
    // so we need to save the original file.

    strOrigFile = ImgAdmin1.GetImage();

    ImgAdmin1.SetDialogTitle ("Select the file to be appended
        to the displayed image");

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowFileDialog (0,vhWnd);   // OpenDlg

    strAppendFile = ImgAdmin1.GetImage();

    // Restore image property to the original filename because
    // this property must contain destination file.

    ImgAdmin1.SetImage (strOrigFile);

    // User wants to append 3 pages starting with page 1

    VARIANT evt;
    evt.vt = VT_ERROR;   // set to error for optional parameter

    ImgAdmin1.Append (strAppendFile, 1, 3, evt, evt);

}


Browse1x Method

See Also	Example-VB
Displays a dialog box that lets the end user select the desired Imaging 1.x path.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.Browse1x Browse1xScope,Title,Caption,hParentWnd

Arguments

Parameter	Data Type	Description
Browse1xScope	Integer	Indicates the hierarchy displayed in the Browse dialog box. BrowseFiles (Literal 0) [image] Browse files (IFS - imaging file system) by displaying directories and subdirectories BrowseDocuments (Literal 1) [image] Browse documents (DM - document management system) by displaying database, cabinet, drawer, or folder. BrowseBoth (Literal 2) [image] Browse both files and documents
Title	String	Specifes the name of the string that appears in the title bar of the Browse dialog box
Caption	String	Specifies a string that is used as the prompt that appears above the tree view in the Browse dialog box
hParentWnd	hWnd	(Optional) Assigns a parent window handle to the displayed dialog box
Remarks

The path selected by the user is set in the Browse1xReturnedPath property when this method returns.

The path type selected by the user is set in the Browse1xReturnedPathType property when this method returns.


ConvertDate Method

See Also	Example-VB
Converts conventional (Gregorian) dates to the date format used when you call the ImgQuery method.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.ConvertDate(Date [, nOption])

Arguments

Parameter	Data Type	Description
Date	String	Specifies the date to be converted. Acceptable formats include: "1/21/98", "January 21, 1998", or "1/21/1998".
nOption	Long	Specifies the type of conversion to perform GregorianToJulian (Literal 1) [image] Gregorian to the date format (default)


CreateDirectory Method

See Also	Example-VB
Creates a user-defined directory.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.

This method can be used to create cabinets, drawers, and folders on the 1.x server. Refer to the following example:

Image://DXCESS/ins_db1:/CABINETNAME/DRAWER/FOLDER

The prefix “Image://” denotes 1.x documents or files, DXCESS is the server name, and ins_db1 the database name. The cabinet, drawer, and folder names, separated by slashes, follow.

The drawer name is optional. If you do not use it, however, you must use two slashes between the cabinet and folder nodes, as shown below.

Image://DXCESS/ins_db1:/CABINETNAME//FOLDER


CreateDirectory Example [image] VB


Delete Method

See Also	Example-VB
Deletes a user-specified object.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 file name or a path.

A file cannot be deleted if it is being used by any Eastman Software/Wang Imaging application or Imaging ActiveX control. Also, a directory or folder cannot be deleted unless it is empty.


DeletePages Method

See Also	Example-VB	Example-VC++
Deletes a user-specified range of pages from the image file.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 Eastman Software/Wang Imaging application or Imaging ActiveX 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.


DeletePages Example - VB
DeletePages Example [image] VB

This example demonstrates how to delete a single page in a file.

Private Sub cmdDeletePage_Click()

    'Delete 1 page, starting with page 4.

    ImgAdmin1.DeletePages 4, 1

End Sub


DeletePages Example - VC++
DeletePages Example [image] VC++

This example demonstrates how to delete a single page in a file.

void CAdmin1Dlg::OnDeletepages()

{

    // Delete 1 page, starting with page 4.

    ImgAdmin1.DeletePages(4, 1 );

}


DoQuery Method

See Also	Example-VB
Performs a query on a 1.x or Enterprise Imaging document repository.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Image Admin control

Syntax

object.DoQuery ()

Remarks

Before calling this method, you must call the SetPath method. After processing the list returned by DoQuery, you must call the EndQuery method to free up associated resources.

This method is one of several [image] EndQuery, Next, Reset, SetPath, and Skip [image] used to perform queries with programming languages such as PowerBuilder that do not support Microsoft’s Ccollection object class.

For languages such as Visual Basic or Visual C++ that support Microsoft’s Ccollection object class, use the IMGQuery method.

Query Results

Query results are BSTR variants that take different forms, depending on the type of query made. In the sample forms shown below, generic names (such as server, cabinet, drawer, and so on) are used as placeholders.

1.x DM document query

If a query is made to a folder contained by a drawer, the result will be in the form:

Image://server\volume:\cabinet\drawer\folder\document

If a query is made to a folder contained by a cabinet, the result will be in the form:

Image://server\volume:\cabinet\folder\document

If a 1.x cabinet, drawer, or folder enumeration is requested, the result will be a fully qualified path describing the item. For example,

Image://server\volume:\cabinet
  or
Image://server\volume:\cabinet\drawer
  or
Image://server\volume:\cabinet\drawer\folder

1.x Filesystem (IFS) query

A 1.x IFS query result is returned in the form:

[f]Image://server\volume:/directory/directory/.../file
  or
[d]Image://server\volume:/directory/directory/.../directory

Where [f] means the item found is a file, and [d] means that it is a directory.

Enterprise Imaging document query

A document query to an Enterprise Imaging server is returned in the form:

Imagex://document


EndQuery Method

See Also	Example-VB
Ends a query session and frees up resources allocated to the DoQuery method.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Image Admin control

Syntax

object.EndQuery ()

Remarks

This method must be called after the DoQuery method has been called.

This method is one of several [image] DoQuery, Next, Reset, SetPath, and Skip [image] used to perform queries with programming languages such as PowerBuilder that do not support Microsoft’s Ccollection object class.


GetVolumeType Method

See Also	Example-VB
Enables you to determine the type of a 1.x server volume.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.GetVolumeType(Server,Volume)

Arguments

Parameter	Data Type	Description
Server	String	The name of the 1.x server that contains the volume:
Volume	String	The name of the volume. Volume names are always terminated with a colon (:).
Return Value

VOLUMETYPE

Constant	Value	Description
typeFILE	0	Volume is a 1.x IFS (imaging file system) volume
typeDOCUMENT	1	Volume is a 1.x DM (document management) volume or database that can contain cabinets, drawers, and folders
typeBADSPEC	2	Reserved
typeUNKNOWN	3	The volume type cannot be determined
typeCANTINT	4	The function cannot initialize due to low memory or because it cannot access the 1.x server


GetSysCompressionInfo Method

See Also	Example-VB
Retrieves the system default compression information for a given page type.

Note: This method is obsolete, and should no longer be used. Use the CompressionInfo property instead. The following information is provided for older applications that may have used it.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Admin control

Syntax

object.GetSysCompressionInfo(PageType)

Arguments

Parameter	Data Type	Description
PageType	Integer	Specifies a page type
Constant	Setting	Description
PageTypeUnk	0	Unknown
PageTypeBW	1	Black and white
PageTypeGray4	2	4-bit gray scale
PageTypeGray8	3	8-bit gray scale
PageTypePal4	4	4-bit palettized
PageTypePal8	5	8-bit palettized
PageTypeRGB24	6	24-bit RGB
PageTypeBGR24	7	24-bit BGR
Return Value

Long

Returns the following bitwise compression information:

Setting	Description
1	EOL [image] include or expect standard end of line bit sequences
2	Packed lines [image] data is not byte aligned
4	Prefixed EOLs [image] 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 [image] reverses black and white on expansion
64	Low resolution, high quality
128	Low resolution, medium quality
256	Low resolution, low quality
512	Medium resolution, high quality
1024	Medium resolution, medium quality
2048	Medium resolution, low quality
4096	High resolution, high quality
8192	High resolution, medium quality
16384	High resolution, low quality


GetSysCompressionType Method

See Also	Example-VB
Retrieves the system default compression type for a given page type.

Note: This method is obsolete, and should no longer be used. Use the CompressionType property instead. The following information is provided for older applications that may have used it.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Admin control

Syntax

object.GetSysCompressionType(PageType)

Arguments

Parameter	Data Type	Description
PageType	Integer	Specifies a page type.
Constant	Setting	Description
PageTypeUnk	0	Unknown
PageTypeBW	1	Black and white
PageTypeGray4	2	4-bit gray scale
PageTypeGray8	3	8-bit gray scale
PageTypePal4	4	4-bit palettized
PageTypePal8	5	8-bit palettized
PageTypeRGB24	6	24-bit RGB
PageTypeBGR24	7	24-bit BGR
Return Value

Integer (enumerated)

Returns one of the following compression types:

Constant	Value	Description
CompTypeUnk	0	Unknown
CompTypeNone	1	No compression
CompTypeGroup3	2	Group 3 1D FAX
CompTypeGroup3Huff	3	Group 3 Modified Huffman
CompTypePacked	4	PackBits
CompTypeGroup4	5	Group 4 2D FAX
CompTypeJPEG	6	JPEG
Reserved	7	Reserved
CompTypeGroup32Dfax	8	Group 3 2D FAX
CompTypeLZW	9	LZW


GetSysFileType Method

See Also	Example-VB
Retrieves the system default file type for a given page type.

Note: This method is obsolete, and should no longer be used. The following information is provided for older applications that may have used it.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Admin control

Syntax

object.GetSysFileType(PageType)

Arguments

Parameter	Data Type	Description
PageType	Integer	Specifies a page type.
Constant	Setting	Description
PageTypeUnk	0	Unknown
PageTypeBW	1	Black and white
PageTypeGray4	2	4-bit gray scale
PageTypeGray8	3	8-bit gray scale
PageTypePal4	4	4-bit palettized
PageTypePal8	5	8-bit palettized
PageTypeRGB24	6	24-bit RGB
PageTypeBGR24	7	24-bit BGR
Return Value

Integer (enumerated)

One of the following file types is returned:

Constant	Value	Description
FileTypeUnk	0	Unknown
FileTypeTIFF	1	TIFF
FileTypeAWD	2	AWD (Windows 95 and 98 only)
FileTypeBMP	3	Bitmap (BMP)
FileTypePCX	4	PCX
FileTypeDCX	5	DCX
FileTypeJPEG	6	JPEG
FileTypeXIF	7	XIF
FileTypeGIF	8	GIF
FileTypeWIFF	9	WIFF


GetUniqueName Method

See Also	Example-VB	Example-VC++
Generates a unique file name.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Admin control

Syntax

object.GetUniqueName(Path,Template,Extension)

Arguments

Parameter	Data Type	Description
Path	String	The name of the existing path to a local or redirected drive, or to a 1.x repository where a unique file name is generated.
Template	String	The initial characters of the generated file name. Up to 4 characters can be used.
Extension	String	The extension added to the generated file name. Up to 3 characters can be used.
Return Value

A string that contains the file name.

Remarks

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


GetUniqueName Example - VB
GetUniqueName Example [image] VB

This example generates a unique filename by using the Admin control for an unattended "Save As" operation in the Image Edit control.

Private Sub cmdUniqueFile_Click()

    Dim strNewfile As String

    Dim strPath As String

    'Pass the directory, template, and file extension for
    'the new file.
    'strPath = “c:\Images” example of local path

    strPath = "Image://Groucho\demo:"

    strNewfile = ImgAdmin1.GetUniqueName(strPath, "test", "tif")

    With ImgEdit1

      .Image = strPath & “\” & strNewfile
      .DisplayBlankImage .Width, .Height
      .SaveAs (strPath & “\” & strNewfile

    End With

End Sub


GetUniqueName Example - VC++
GetUniqueName Example [image] VC++

This example generates a unique filename by using the Admin control for an unattended "Save As" operation in the Image Edit control.

void CAdmin1Dlg::OnUniquefilename()

{

    CString strNewfile;

    Cstring strPath;

    // Pass in the directory, template, and file extension for
    // the new file

    strPath = "D:\\image2"

    strNewfile = ImgAdmin1.GetUniqueName(strPath, "test", "tif");

    VARIANT evt;
    evt.vt = VT_ERROR;   // set to error for optional parameter

    StrPath + = "\\";

    StrPath + = StrNewFile;

    ImgEdit1.SaveAs (strPath, evt, evt, evt, evt, evt);

}


ImgQuery Method

See Also	Example-VB	Example-VC++
Performs a query on a 1.x or Enterprise Imaging document repository.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.ImgQuery(vScope,szQueryTerms,iDispatch)

Arguments

Parameter	Data Type	Description
vScope	Variant	For a 1.x server, vScope is:   a string that identifies a 1.x server and virtual volume   "DMVOLUMES", if all Document Manager (DM) volume names in the 1.x domain are to be returned   "IFSVOLUMES", if all Imaging File System (IFS) volume names in the 1.x domain are to be returned For an Enterprise Imaging server, vScope is a Boolean value that indicates the scope of the query. False = only the Domain will be queried. True = both the Domain and the Archive will be queried
szQueryTerms	String	A pointer to a string containing the query terms, expressed in syntax appropriate to the server being queried
iDispatch	Object	The address of an iDispatch pointer that points to a Collection object which will contain the query results
Remarks

ImgQuery is used to perform queries with programming languages such as Visual Basic or Visual C++ that support Microsoft’s Ccollection object class. For languages such as PowerBuilder that do not support the Ccollection object, use the DoQuery method.

The method ImgQueryEnd must be called after ImgQuery to free up associated resources.

1.x Query Forms

Valid 1.x server query term string forms are:

null or null string

"findIFS path"

where path is a fully qualified path name from the virtual volume to the container to be enumerated

"findcabinets"

"finddrawers cabinet=cabinetname"

where cabinetname is the name of a cabinet

"findfolders cabinet=cabinet"

where cabinet is the name of a cabinet

"findfolders cabinet=cabinetname;drawer=drawername"

Note: If the semicolon does not work as a delimiter, use a space instead.

lists folders that are resident in a drawer, which is contained in a cabinet. You can supply names for the variables cabinetname and drawername

Querying 1.x documents

You can query 1.x documents by name, date modified, location, and/or keywords. The syntax for this type of query is:

“finddocs [NAME_TERM] [DATE_EXPR] [KEYWORD_TERM]”

The syntax used by each parameter is shown below. Reserved words appear in bold.

[NAME_TERM] = <name rel_op qstring | name like qstring |
        name between qstring and qstring>

[DATE_EXPR] = <date_name date_rel_op qdate | date_name between
        qdate and qdate>

[KEYWORD_TERM] = <keyword_expr bool_op keyword_expr>

Variable definitions for these parameters are:

rel_op:  = | eq | < | lt | > | gt | <= | le | >= | ge

date_time:  created | modified

date_rel_op:  before | after | on | rel_op

bool_op:  and | or

qdate:  Date in the format AYYYDDD. A represents this particular date format, YYY represents the number of the year since 1900 (065 = 1965, 099 = 1999, etc.), DDD represents the days in the year, starting with January 1st.

qstring: ASCII string

keyword_expr: keyword rel_op qstring | keyword like qstring | keyword between qstring and qstring

The 1.x reserved words [image] cabinet, drawer, folder, document, and modified [image] can be used only once in a querystring. The reserved word keyword can be used up to two times.

Sample 1.x DM queries

To find all documents with the keyword “insurance”:

finddocs keyword=insurance

To find all documents in a folder named “ROOT DRAWER”:

finddocs drawer=”ROOT DRAWER”

Note that ROOT DRAWER must be enclosed by quotation marks to preserve the space between the two words.

Enterprise Imaging Query Forms

Valid Enterprise Imaging server query term string forms are:

null or null string

returns the names of all documents

NAME=name

where name is the name of the document to be found.

OBJECT_CLASS=class

where class is a valid class name

FIELDS=fieldname:value,fieldname:value,…;

where fieldname is the name of a field defined in the class's form, and value is the value of the field in the documents to be found

Query Results

Query results are BSTR variants that take different forms, depending on the type of query made. In the sample forms shown below, generic names (such as server, cabinet, drawer, and so on) are used as placeholders.

1.x DM document query

IMGQuery returns 4 nodes for document paths, separated by slashes. If there is no drawer, the returned string contains another slash to signify the missing node.

If a query is made to a folder contained by a drawer, the result will be in the form:

Image://server\volume:\cabinet\drawer\folder\document

If a query is made to a folder contained by a cabinet, the result will be in the form:

Image://server\volume:\\cabinet\folder\document

Note the two slashes before "cabinet", which means there is no drawer node.

If a 1.x cabinet, drawer, or folder enumeration is requested, the result will be a fully qualified path describing the item. For example,

Image://server\volume:\cabinet
  or
Image://server\volume:\cabinet\drawer
  or
Image://server\volume:\cabinet\drawer\folder

1.x Filesystem (IFS) query

A 1.x IFS query result is returned in the form:

[f]Image://server\volume:/directory/directory/.../file
  or
[d]Image://server\volume:/directory/directory/.../directory

Where [f] means the item found was a file, and [d] means that it is a directory.

Enterprise Imaging document query

A document query to an Enterprise Imaging server is returned in the form:

Imagex://document


ImgQuery Example - VB
ImgQuery Example [image] VB

The following example performs a query of documents located on a
1.x Server. The query is based upon keywords assigned to the document.

Private Sub cmdQuery_Click()

    Dim objResults As Object

    Dim varItem As Variant

    Dim Msg As String

'Perform the query and put results in objResults.

    On Error GoTo ImgQueryErr

    intRet=ImgAdmin1.ImgQuery("srvrname\test_db:", _

        "finddocs keyword = insurance", _

         objResults)

    'Write results of the query to a listbox

    If intRet = 0 Then

        For Each varItem In objResults

            lb_results.AddItem varItem

        Next

    End if

        'Release memory and resources.

        Set objResults = Nothing

        ImgAdmin1.ImgQueryEnd

    Exit Sub

ImgQueryErr:

    'Display error message

    Msg = "ImgQuery method failed" & vbCrLf & _

          "Error Number: " & Err.Number & vbCrLf & _

          "Error Description: " & Err.Description

    MsgBox Msg, vbExclamation

End Sub


ImgQuery Example - VC++
ImgQuery Example [image] VC++

The following example performs a query of documents located on a
1.x Server. The query is based upon keywords assigned to the document.

Note: To include the IStringCollection object, you must import the Imgadmin.ocx control. Imagadmin.ocx must be located in the Visual C++ Developer’s Studio Tools/Options library files and directories. Use the following code to import the ocx:

#import “Imgadmin.ocx”
using namespace AdminLibCtl;

void CImgQueryView::OnImgquery()

{

    int iReturn;

    // Perform the query and put results in objResults

    CString szDB = /*m_SrvrVolName*/"nqa11/test_db1:";

    //CString szDB = "test_db:";

    VARIANT vDB; vDB.vt = VT_BSTR; V_BSTR(&vDB) = szDB.AllocSysString();

    lbResults.ResetContent();

// Call ImgQuery( ); get a CStringCollect's IDispatch*.

    LPDISPATCH idispStringCollect=NULL;

    TRY

    {

        ImgAdmin1.ImgQuery(vDB, "finddocs document = 4pg",

            &idispStringCollect);

        // Call CStringCollect's Get_NewEnum( );
        // get CEnumVARIANT's IUnknown*

        IUnknownPtr pEnumVarIUnknown = 0;

    IStringCollect *myIfacePtr = (IStringCollect *) idispStringCollect;

        pEnumVarIUnknown = myIfacePtr->Get_NewEnum();

        if (pEnumVarIUnknown)

        {

            // Call CEnumVARIANT IUnknown's QueryInterface;
            // get an IEnumVARIANT*

            IEnumVARIANT* pIEnumVariant = 0;

            pEnumVarIUnknown->QueryInterface(IID_IEnumVARIANT,

                (void**)&pIEnumVariant);

            if(pIEnumVariant)

            {

                // Call the IEnumVARIANT's Next( ) till all strings
                // are retrieved

                VARIANT vName;

                while (S_OK == pIEnumVariant->Next(1, &vName, NULL))

                {

                    lbResults.AddString((CString)V_BSTR(&vName));

                }

                iReturn = 0;

                pIEnumVariant->Release();

             }

             ImgAdmin1.ImgQueryEnd();

}

}

CATCH_ALL (e)

    {

CString msg;

        ImgAdmin1.ImgQueryEnd();

        msg.Format("Unexpected error 0x%lX", ((COleException *)e)->m_sc);

        MessageBox(msg);

    }

    END_CATCH_ALL

}


ImgQueryEnd Method

See Also	Example-VB	Example-VC++
Completes a query and frees any associated resources.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.ImgQueryEnd ()

Arguments

None

Remarks

Use this method with the ImgQuery method.


ImgQueryEnd Example - VB
ImgQueryEnd Example [image] VB

The following example performs a query of documents located on a
1.x Server. The query is based upon keywords assigned to the document.

Private Sub cmdQuery_Click()

    Dim objResults As Object

    Dim varItem As Variant

    Dim Msg As String

    Dim intRet As Integer

    'Perform the query and put results in objResults.

    On Error GoTo ImgQueryErr

    intRet = ImgAdmin1.ImgQuery("srvrname\test_db:", _

        "finddocs keyword = insurance", _

         objResults)

    'Write results of the query to a listbox

    If intRet = 0 Then

        For Each varItem In objResults

            lb_results.AddItem varItem

        Next

        'Release memory and resources.

        Set objResults = Nothing

        ImgAdmin1.ImgQueryEnd

    End If

    Exit Sub

ImgQueryErr:

    'Display error message

    Msg = "ImgQuery method failed" & vbCrLf & _

          "Error Number: " & Err.Number & vbCrLf & _

          "Error Description: " & Err.Description

    MsgBox Msg, vbExclamation

End Sub


ImgQueryEnd Example - VC++
ImgQueryEnd Example [image] VC++

The following example performs a query of documents located on a
1.x Server. The query is based upon keywords assigned to the document.

void CImgQueryView::OnImgquery()

{

    int iReturn;

    // Perform the query and put results in objResults

    CString szDB = /*m_SrvrVolName*/"nqa11/test_db1:";

    //CString szDB = "test_db:";

    VARIANT vDB; vDB.vt = VT_BSTR; V_BSTR(&vDB) = szDB.AllocSysString();

    lbResults.ResetContent();

// Call ImgQuery( ); get a CStringCollect's IDispatch*.

    LPDISPATCH idispStringCollect=NULL;

    TRY

    {

        ImgAdmin1.ImgQuery(vDB, "finddocs document = 4pg",

            &idispStringCollect);

        // Call CStringCollect's Get_NewEnum( );
        // get CEnumVARIANT's IUnknown*

        IUnknownPtr pEnumVarIUnknown = 0;

    IStringCollect *myIfacePtr = (IStringCollect *) idispStringCollect;

        pEnumVarIUnknown = myIfacePtr->Get_NewEnum();

        if (pEnumVarIUnknown)

        {

            // Call CEnumVARIANT IUnknown's QueryInterface;
            // get an IEnumVARIANT*

            IEnumVARIANT* pIEnumVariant = 0;

            pEnumVarIUnknown->QueryInterface(IID_IEnumVARIANT,

                (void**)&pIEnumVariant);

            if(pIEnumVariant)

            {

                // Call the IEnumVARIANT's Next( ) till all strings
                // are retrieved

                VARIANT vName;

                while (S_OK == pIEnumVariant->Next(1, &vName, NULL))

                {

                    lbResults.AddString((CString)V_BSTR(&vName));

                }

                iReturn = 0;

                pIEnumVariant->Release();

             }

             ImgAdmin1.ImgQueryEnd();

}

}

CATCH_ALL (e)

    {

CString msg;

        ImgAdmin1.ImgQueryEnd();

        msg.Format("Unexpected error 0x%lX", ((COleException *)e)->m_sc);

        MessageBox(msg);

    }

    END_CATCH_ALL

}


Insert Method

See Also	Example-VB	Example-VC++
Inserts one or more user-specified pages into the current image file.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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. The file can reside on a   local or redirected drive (desktop)   1.x server   Enterprise Imaging server
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. See the CompressionType property for allowable values.
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. See the CompressionInfo property for allowable values.
Remarks

The current image is specified by the Image property. If an image does not exist, one is created, and the destination page will be 1.

The current image must be a TIFF, AWD, or 1.x server document, because they 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 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 (color) type, the source file’s compression type and compression information is used in place of the arguments.

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

If the destination is a 1.x document, and the source page does not reside in the 1.x repository, the FileStgLoc1x property must be set.

For other operations with 1.x documents, the ForceFileLinking1x property can be used.


Insert Example - VB
Insert Example [image] VB

This example demonstrates how to insert pages into a file.

Private Sub cmdInsert_Click()

    Dim strOrigFile As String, strInsertFile As String

    Dim lngPgCount As Long

    'This is the displayed image into which we insert the page.

    ImgAdmin1.Image = "D:\image2\original.tif"

    strOrigFile = ImgAdmin1.Image

    ImgAdmin1.DialogTitle = "Select the file you want to insert
        into the displayed image"

    ImgAdmin1.ShowFileDialog OpenDlg

    strInsertFile = ImgAdmin1.Image

    'Restore the original filename to the Image property because
    'the property must contain the destination file name.

    ImgAdmin1.Image = strOrigFile

    'Insert 2 pages starting with page 1 of the source file,
    'which will be placed before page 3 in the original file. The
    'compression type of the source file will be retained since a
    'different compression type is not specified.

    ImgAdmin1.Insert strInsertFile, 1, 3, 2

End Sub


Insert Example - VC++
Insert Example [image] VC++

This example demonstrates how to insert pages into a file.

void CAdmin1Dlg::OnInsert()

{

    CString strOrigFile, strInsertFile;

    // This is the displayed image into which we insert the page.

    ImgAdmin1.SetImage ("D:\\image2\\original.tif");

    //Because we will use the dialog box to pick the file to be inserted
    //we need to save the original file.

    strOrigFile = ImgAdmin1.GetImage();

    ImgAdmin1.SetDialogTitle ("Select the file you want to
        insert into the displayed image");

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowFileDialog (0,vhWnd);   // OpenDlg

    strInsertFile = ImgAdmin1.GetImage();

    // Restore image property to the original filename because
    // this property must contain destination file.

    ImgAdmin1.SetImage(strOrigFile);

    //Insert 2 pages starting with page 1 of the source file,
    //which will be placed before page 3 in the original file. The
    //compression type of the source file will be retained since a
    //different compression type is not specified.

    VARIANT evt;

    evt.vt = VT_ERROR;  // set to error for optional parameter

    ImgAdmin1.Insert (strInsertFile, 1, 3, 2 , evt, evt);

}


LoginToServer Method

See Also	Example-VB
Provides the authentication interface to a 1.x or Enterprise Imaging server, enabling a user to log on.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.LoginToServer nServerType,bEnableUI,[lpszUserId],[lpszPassWd]

Arguments

Parameter	Data Type	Description
nServerType	ServerType (Integer)	Indicates the type of server to be accessed Constant Setting Description OneXUnix 1 1.x UNIX server ThreeX 2 Enterprise Imaging server
bEnableUI	AuthUI (Boolean)	Determines if the logon dialog box is displayed Constant Setting Description DisableUI False Disables the dialog box. EnableUI True Enables the dialog box.
lpszUserId	string	(Optional) User logon ID (up to 20 characters for a 1.xserver or 80 characters for an Enterprise Imaging server)
lpszPasswd	string	(Optional) User logon password (up to 36 characters for 1.x server or 80 characters for an Enterprise Imaging server)
Remarks

If nServerType is set to 2, the user is logged on to the Enterprise Imaging server specified by the Domain property.

If nServerType is set to 1, the user is logged on to the Imaging 1.x server specified by the NameServer property.

Note:  Multiple users cannot log on to an Enterprise Imaging server using the same ID.

When a user is logged on to an Enterprise Imaging server, authentication remains current until the application is closed. On a 1.x server, however, authentication remains valid after the application is closed.

If you are logged in to a 1.x server, and then change the NameServer property, you must log off before you attempt to log in under the new server name.

To log a user off, use the LogOffServer method.


LoginToServer Example [image] VB


LogOffServer Method

See Also	Example-VB
Logs a user off the server.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.LogOffServer nServerType

Arguments

Parameter	Data Type	Description
nServerType	ServerType (Integer)	Indicates the server type currently being accessed Constant Setting Description OneXUnix 1 1.x server ThreeX 2 Enterprise Imaging server
Remarks

Calling this method terminates any file or document services that are running.


LogOffServer Example [image] VB


Move Method

See Also	Example-VB
Moves one or more consecutive pages from a source file to a specified location in the current file.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Admin control

Syntax

object.Move Source, SourcePage, DestPage, PageCount [,CompressionType, CompressionInfo]

Arguments

Parameter	Data Type	Description
Source	String	Name of the source file that contains the pages to be moved.
SourcePage	Long	Name of the page that is being moved from the source to the destination file. If several pages are being moved, this is the name of the first page.
DestPage	Long	The name of the page in the destination file before which the moved pages will be inserted.
PageCount	Long	The number of pages being moved.
CompressionType	Integer	(Optional) Specifies the compression type to be used for the moved pages. If a compression type is not specified, the compression type of the source pages is used. See the CompressionType property for allowable values.
CompressionInfo	Long	(Optional) Specifies a bitwise value with additional compression information. If a value is not specified, the compression information for the source pages is used. See the CompressionInfo property for allowable values.


Next Method

See Also	Example-VB
Returns the next item in the query result list returned by the DoQuery method.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Image Admin control

Syntax

object.Next ()

Remarks

This method should be called only after the DoQuery method has been called, and after verifying that the value of the Count property is greater than 1.

This method is one of several [image] DoQuery, EndQuery, Reset, SetPath, and Skip [image] used to perform queries with programming languages such as PowerBuilder that do not support Microsoft’s Ccollection object class.


Rename Method

See Also	Example-VB
Renames a file, a document, or a directory in an Eastman Imaging 1.x Server file or document manager namespace.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.Rename Path,CurrentName,NewName

Arguments

Parameter	Data Type	Description
Path	String	Specifies the path to the object to be renamed
CurrentName	String	Specifies the current name of the object
NewName	String	Specifies the new name of the object


Rename Example [image] VB


Replace Method

See Also	Example-VB	Example-VC++
Replaces one or more user-specified pages in a file specified by the Image property.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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. The file can reside on a   local or redirected drive (desktop)   1.x server   Enterprise Imaging server
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. See the CompressionType property for allowable values.
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. See the CompressionInfo property for allowable values.
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 (color) type, the source file’s compression type and compression information is used in place of the arguments.

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

If the destination is a 1.x document, and the source page does not reside in the 1.x repository, the FileStgLoc1x property must be set.

For other operations with 1.x documents, the ForceFileLinking1x property can be used.


Replace Example - VB
Replace Example [image] VB

This example demonstrates how to replace a single page in a file.

Private Sub cmdReplace_Click()

    Dim strOrigFile As String, strReplaceFile As String

    Dim lngPgCount As Long

    'Use the dialog box to pick the original file.

    ImgAdmin1.DialogTitle = "Select the original file"

    ImgAdmin1.ShowFileDialog OpenDlg

    'Because we are using the dialog box to pick the file to
    'be used for replace, we need to save the original file.

    strOrigFile = ImgAdmin1.Image

    ImgAdmin1.DialogTitle = "Select the file to be used
        for the replace"

    ImgAdmin1.ShowFileDialog OpenDlg

    strReplaceFile = ImgAdmin1.Image

    'Restore the original filename to the Image property because
    'the property must contain the destination file name.

    ImgAdmin1.Image = strOrigFile

    'You are going to replace 1 page [image] page 4 in
    'original file will be replaced by page 2 of the source file.
    'The compression type of the source file will be retained
    'since a different compression type is not specified.

    ImgAdmin1.Replace strReplaceFile, 2, 4, 1

End Sub


Replace Example - VC++
Replace Example [image] VC++

This example demonstrates how to replace a single page in a file.

void CAdmin1Dlg::OnReplace()

{

    CString strOrigFile, strReplaceFile;

    // Use the dialog box to pick the original file.

    ImgAdmin1.SetDialogTitle ("Select the original file");

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowFileDialog (0,vhWnd);   // OpenDlg

    // Because we are using the dialog box to pick the file to
    // be used for replace, we need to save the original file.

    strOrigFile = ImgAdmin1.GetImage();

    ImgAdmin1.SetDialogTitle ("Select the file to be used
        for the replace");

    ImgAdmin1.ShowFileDialog (0,vhWnd);   // OpenDlg

    strReplaceFile = ImgAdmin1.GetImage();

    // Restore the original filename to the Image property because
    // the property must contain the destination file name.

    ImgAdmin1.SetImage (strOrigFile);

    // You are going to replace 1 page [image] page 4
    // in original file will be replaced by page 2 of the source
    // file. The compression type of the source file will be
    // retained since a different compression type is not specified.

    VARIANT evt;

    evt.vt = VT_ERROR; // set to error for optional parameter

    ImgAdmin1.Replace (strReplaceFile, 2, 4, 1, evt, evt);

}


Reset Method

See Also	Example-VB
Sets the pointer to the beginning of the query result list returned by the DoQuery method.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Image Admin control

Syntax

object.Reset ()

Remarks

This method should be called only after the DoQuery method has been called.

Calling the Next method immediately after calling Reset returns the first result in the query result list.

This method is one of several [image] DoQuery, EndQuery, Next, SetPath, and Skip [image] used to perform queries with programming languages such as PowerBuilder that do not support Microsoft’s Ccollection object class.


SetFileProperties Method

See Also	Example-VB	Example-VC++
Sets the Title, Subject, Author, Comments, and Keywords properties for the current image, and writes them to disk.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Admin control

Syntax

object.SetFileProperties

Arguments

None

Remarks

The Image property determines which document is updated.

If the current image is a local or redirected TIFF file, or a 1.x file (not a document) the Title, Subject, Author, Comments, and Keywords properties can be set.

First, you assign the appropriate values to the Title, Subject, Author, Comments, and Keywords properties. Then you call the SetFileProperties method to write them to disk.If the current image is a 1.x document, only the Keywords property can be set.

Note: Keywords assigned to 1.x documents using this method are automatically converted to uppercase characters. The maximum string length for keywords is 20 characters.

After setting file properties, you can use the Find button on the Open dialog box to search for local and redirected files, or the ImgQuery method to search for documents residing on a 1.x server.

Use the ShowFileProperties method to display the dialog box that shows the settings for these properties on the Summary tab.


SetFileProperties Example - VB
SetFileProperties Example [image] VB

This example shows how you can set several file properties. These properties can also be set by the user at runtime from the UI dialog box created by the ShowFileProperties method.

Private Sub cmdSetProperties_Click()

    'Specify the image you are going to set properties for.

    ImgAdmin1.Image = "D:\image2\hopolicy.tif"

    ImgAdmin1.Title = "HomeOwners Policy"

    ImgAdmin1.Author = "John Q. Agent"

    'Add multiple keywords.

    ImgAdmin1.Keywords = "insurance important house"

    ImgAdmin1.Comments = "1997 Homeowners Policy"

    ImgAdmin1.Subject = "Insurance"

    'Call SetFileProperties to actually write the properties to the file.

    ImgAdmin1.SetFileProperties

End Sub


SetFileProperties Example - VC++
SetFileProperties Example [image] VC++

This example shows how you can set several file properties. These properties can also be set by the user at runtime from the UI dialog box created by the ShowFileProperties method.

void CAdmin1Dlg::OnFileproperties()

{

    // Specify the image you are going to set properties for.

    ImgAdmin1.SetImage ("D:\\image2\\hopolicy.tif");

    ImgAdmin1.SetTitle ("HomeOwners Policy");

    ImgAdmin1.SetAuthor ("John Q. Agent");

    // Adding multiple keywords.

    ImgAdmin1.SetKeywords ("insurance important house");

    ImgAdmin1.SetComments ("1997 Homeowners Policy");

    ImgAdmin1.SetSubject ("Insurance");

    // Call SetFileProperties to actually write the properties to the file.

    ImgAdmin1.SetFileProperties();

}


SetPath Method

See Also	Example-VB
Sets up the parameters for a query on a 1.x or Enterprise Imaging document repository. The actual query is performed by the DoQuery method.

Available With

√	Imaging for Windows Professional Edition V2.0, V2.5, and V2.6
Applies To

Image Admin control

Syntax

object.SetPath(vScope,szQueryTerms)

Arguments

Parameter	Data Type	Description
vScope	Variant	For a 1.x server, vScope is:   a string that identifies a 1.x server and virtual volume   "DMVOLUMES", if all Document Manager (DM) volume names in the 1.x domain are to be returned   "IFSVOLUMES", if all Imaging File System (IFS) volume names in the 1.x domain are to be returned For an Enterprise Imaging server, vScope is a Boolean value that indicates the scope of the query. False = only the Domain will be queried. True = both the Domain and the Archive will be queried
szQueryTerms	String	A pointer to a string containing the query terms, expressed in syntax appropriate to the server being queried
Remarks

Use this method only when programming in Visual Basic Script or PowerBuilder. Use the ImgQuery method with Visual Basic or Visual C++.

1.x Query Forms

Valid 1.x server query term string forms are:

null or null string

"findIFS path"

where path is a fully qualified path name from the virtual volume to the container to be enumerated

"findcabinets"

"finddrawers cabinet=cabinetname"

where cabinetname is the name of a cabinet

"findfolders cabinet=cabinet"

where cabinet is the name of a cabinet

"findfolders cabinet=cabinetname;drawer=drawername"

Note: If the semicolon does not work as a delimiter, use a space instead.

lists folders that are resident in a drawer, which is contained in a cabinet. You can supply names for the variables cabinetname and drawername

Querying 1.x documents

You can query 1.x documents by name, date modified, location, and/or keywords. The syntax for this type of query is:

“finddocs [NAME_TERM] [DATE_EXPR] [KEYWORD_TERM]”

The syntax used by each parameter is shown below. Reserved words appear in bold.

[NAME_TERM] = <name rel_op qstring | name like qstring |
        name between qstring and qstring>

[DATE_EXPR] = <date_name date_rel_op qdate | date_name between
        qdate and qdate>

[KEYWORD_TERM] = <keyword_expr bool_op keyword_expr>

Variable definitions for these parameters are:

rel_op:  = | eq | < | lt | > | gt | <= | le | >= | ge

date_time:  created | modified

date_rel_op:  before | after | on | rel_op

bool_op:  and | or

qdate:  Date in the format AYYYDDD. A represents this particular date format, YYY represents the number of the year since 1900 (065 = 1965, 099 = 1999, etc.), DDD represents the days in the year, starting with January 1st.

qstring: ASCII string

keyword_expr: keyword rel_op qstring | keyword like qstring | keyword between qstring and qstring

The 1.x reserved words [image] cabinet, drawer, folder, document, and modified [image] can be used only once in a querystring. The reserved word keyword can be used up to two times.

Sample 1.x DM queries

To find all documents with the keyword “insurance”:

finddocs keyword=insurance

To find all documents in a folder named “ROOT DRAWER”:

finddocs drawer=”ROOT DRAWER”

Note that ROOT DRAWER must be enclosed by quotation marks to preserve the space between the two words.

Enterprise Imaging Query Forms

Valid Enterprise Imaging server query term string forms are:

null or null string

returns the names of all documents

NAME=name

where name is the name of the document to be found.

OBJECT_CLASS=class

where class is a valid class name

FIELDS=fieldname:value,fieldname:value,…;

where fieldname is the name of a field defined in the class's form, and value is the value of the field in the documents to be found


SetPrompt1xFilesAndDocs Method

See Also	Example-VB
Determines if the list item “1.x Files and Documents” is displayed in the “Look for” list box on the Create Image Bookmark File dialog box.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Admin control

Syntax

object.SetPrompt1xFilesAndDocs [={True|False}]

Data Type

Boolean

Setting	Description
True	(Default) The item “1.x Files and Documents” will be displayed in the “Look for” list box.
False	The item “1.x Files and Documents” will not be displayed in the “Look for” list box.
Remarks

This method is available only on computers that have Imaging 1.x Server Access software installed.

Call this method before you call the Image Edit control’s CreateBookMark method.


SetSystemFileAttributes Method

See Also	Example-VB
Allows the user to set how image files will be saved for a given type.

Note: This method is obsolete, and should no longer be used. The following information is provided for older applications that may have used it.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1,and V2.0
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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
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


Show1xServerOptDlg Method

See Also	Example-VB
Displays the 1.x Server Options dialog box.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.Show1xServerOptDlg [hParentWnd]

Arguments

Parameter	Data Type	Description
hParentWnd	hWnd	(Optional)  Assigns a parent window handle to the displayed dialog box
Remarks

The following values are set by the specified properties. A user can accept or change these settings from the dialog box.

The initial value for the “File location for document pages” edit box is set by the FileStgLoc1x property.

The initial state of the checkbox “Force lower-case file names” is set by the ForceLowerCase1x property.

The initial state of the checkbox “Link files on reference” is set by the ForceFileLinking1x property.

The initial state of the checkbox “Delete files with pages” is set by the ForceFileDeletion1x property.

The Browse button displays a list of folders in the Browse dialog box. If a user is not already logged on to a 1.x server, he/she will be prompted to do so before the list is displayed.


Show1xServerOptDlg Example [image] VB


ShowFileDialog Method

See Also	Example-VB	Example-VC++
Enables a user to select a file from a local or redirected drive. Version 2.0and V2.5 of Imaging for Windows Professional Edition supports 1.x server file selection, and queries an Enterprise Imaging document repository.

Depending on the setting of the DialogOption parameter, either an Open or a Save As dialog box is displayed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 Constant Setting Description OpenDlg 0 Open or Select SaveDlg 1 Save As or Save Page
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 the file specified does not exist, one is created.

The value set by the SaveAsName property is displayed when the SaveAs dialog is first opened.  The user can accept or change this value. The default value is the name of the image defined in the Image property. If none is defined, the filename field is left blank. The SaveAsName property value is automatically cleared after the SaveAs dialog is completed.

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.

If a Parent window is not specified, the dialog box will behave as a modeless dialog box.


ShowFileDialog Example - VB
ShowFileDialog Example [image] VB

Example 1 [image] Open

This example shows how to use the ImgAdmin Open dialog box to display a file in the Image Edit and the Thumbnail controls.

Private Sub cmdDisplay_Click()

    'Initialize the Image property to check for Cancel pressed.
    'When the dialog box is shown, check for a value in the
    'Image property.

    ImgAdmin1.Image = ""

    'Specify a dialog title and a list filter rather than using
    'the defaults.

    ImgAdmin1.DialogTitle = "Select Image for Display"

    ImgAdmin1.Filter = "All Image Files |*.bmp; *.jpg; *.tif|
        Bitmap Files(*.bmp)|*. bmp| JPG Files (*.jpg)|*.jpg|
        TIFF Files (*.tif)|*.tif|All Files (*.*)|*.*|"

    ' Default filter will be TIFF (fourth item).

    ImgAdmin1.FilterIndex = 4

    'Set the InitDir property to the preferred directory.

    ImgAdmin1.InitDir = "C:\images"

    ImgAdmin1.CancelError = False

   'Note:  if you have Server Access software installed this
   'will automatically be enabled in the Open dialog box after
   'the user authenticates.

    ImgAdmin1.ShowFileDialog OpenDlg, Form1.hWnd

    'Determine if a file was selected or cancel was pressed

    If ImgAdmin1.Image = "" Then Exit Sub

    'Set the image properties in the Image Edit and Thumbnail controls
    'to the name of the file selected in the dialog box.

    ImgEdit1.Image = ImgAdmin1.Image

    ImgThumbnail1.Image = ImgAdmin1.Image

    'Display the image in the ImgEdit and Thumbnail control.

    ImgEdit1.Display

End Sub

Example 2 [image] SaveAs

This example saves the displayed image with a new filename using the Admin Save dialog and the Image Edit control SaveAs method.

Private Sub cmdSaveAs_Click()

    ImgAdmin1.ShowFileDialog SaveDlg

    ImgEdit1.SaveAs ImgAdmin1.Image

End Sub


ShowFileDialog Example - VC++
ShowFileDialog Example [image] VC++

Example 1 [image] Open

This example shows how to use the ImgAdmin Open dialog box to display a file in the Image Edit and the Thumbnail controls.

void CAdmin1Dlg::OnFileopen()

{

    // Initialize Image property in order to check for Cancel
    // pressed.  After the dialog box is shown, check for a value
    // in the image property.

    ImgAdmin1.SetImage ("" );

    // Specify a dialog title and a list filter rather than using
    // the defaults.

    ImgAdmin1.SetDialogTitle ("Select Image for Display");

    ImgAdmin1.SetFilter ("All Image Files |*.bmp; *.jpg; *.tif|
        Bitmap Files (*.bmp)|*. bmp|JPG Files (*.jpg)|*.jpg|
        TIFF Files (*.tif)|*.tif|All Files (*.*)|*.*|");

    // Default filter will be TIFF (fourth item).

    ImgAdmin1.SetFilterIndex (4);

    // Set the InitDir property to the preferred directory.

    ImgAdmin1.SetInitDir ("C:\\images");

    ImgAdmin1.SetCancelError (FALSE);

   // Note:  if you have Server Access software installed this
   // will automatically be enabled in the Open dialog box after
   // the user authenticates.

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowFileDialog (0,vhWnd);       // OpenDlg

    // Determine if a file was selected or cancel was pressed

    if (ImgAdmin1.GetImage() =="")
            return;

    // Set the image properties in the ImgEdit and Thumbnail control
    // to the name of the file selected in the dialog box.

    ImgEdit1.SetImage (ImgAdmin1.GetImage());

    ImgThumbnail1.SetImage (ImgAdmin1.GetImage());

    // Display the image in the ImgEdit and Thumbnail control.

    ImgEdit1.Display();

}

Example 2 [image] SaveAs

This example saves the displayed image with a new filename using the Admin Save dialog and the Image Edit control SaveAs method.

void CAdmin1Dlg::OnSaveas()

{

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowFileDialog (1,vhWnd);   // OpenDlg

    VARIANT evt;

    evt.vt = VT_ERROR;     // set to error for optional parameter

    ImgEdit1.SaveAs (ImgAdmin1.GetImage(), evt, evt, evt, evt, evt);

}


ShowFindDialog Method

See Also	Example-VB
Displays the Find dialog box,.from which a user specifies search parameters to 1.x and Enterprise Imaging documents.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Admin control

Syntax

object.ShowFindDialog([hParentWnd])

Arguments

Parameter	Data Type	Description
hParentWnd	hWnd	(Optional)  Assigns a parent window handle to the displayed dialog box
Remarks

If a Parent window is not specified, the dialog box will behave as a modeless dialog box.

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


ShowFindDialog Example [image] VB


ShowFileProperties Method

See Also	Example-VB
Displays a dialog box from which a user can view General file properties, and view and change Summary properties for TIFF files.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Admin control

Syntax

object.ShowFileProperties OriginalName[,bShowImageTabForOriginalFile = {True|False},bIsReadOnly = {True|False}]

Arguments

Parameter	Data Type	Description
OriginalName	String	Name of the file to appear in the dialog box’s caption bar. The value must be a fully qualified path name for the file.
BShowImageTabForOriginalFile	Boolean	Optional. Shows or hides the image tab
True	Preview tab is displayed
False  (default)	Preview tab is hidden
bIsReadOnly	Boolean	Optional. Bring up the dialog box in read-only mode.
True	Dialog box comes up in read-only mode
False  (default)	Dialog box comes up in normal mode
Remarks

Properties can be modified on TIFF files only, and only when using Imaging for Windows Professional Edition. Properties are read-only when using Imaging for Windows 98 (the blsReadOnly parameter is always True).

If the current image is a local or redirected TIFF file, or a 1.x file (not a document) the user can modify the Title, Subject, Author, Comments, and Keywords properties by typing new information into the corresponding fields.

If the current image is a 1.x document, only the Keywords property can be set.

When any of these property values are changed, the FilePropertiesClose event is fired, which enables the application to save the original image.

The modified property values are not saved to disk until the OK button in the dialog box is clicked.

Changes to the Image property update the property values displayed in the dialog box.


ShowFileProperties Example [image] VB


ShowPrintDialog Method

See Also	Example-VB	Example-VC++
Presents a dialog box from which a user sets various print options.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.

If a Parent window is not specified, the dialog box will behave as a modeless dialog box.


ShowPrintDialog Example - VB
ShowPrintDialog Example [image] VB

This example uses the ShowPrintDialog method to enable the user to specify printing parameters. The image displayed in the Image Edit control is then printed.

Private Sub cmdPrint_Click()

    On Error GoTo PrintErr

    'Display an image

    ImgEdit1.Image = "D:\image2\4page.tif"

    ImgEdit1.Display

    'Reset NumCopies in case user printed multiple copies last time.

    ImgAdmin1.PrintNumCopies = 1

    'If CancelError is true, an error is generated if user presses
    'cancel.  Trap the error to avoid trying to print the file.

    ImgAdmin1.CancelError = True

    'Set filename to be printed to the displayed file. If this property
    'is not set the dialog box will not display.

    ImgAdmin1.Image = ImgEdit1.Image

    ImgAdmin1.ShowPrintDialog Form1.hWnd

    'Print the image using the parameters obtained from the print
    'dialog box (for example, start page, end page, and so on).

    ImgEdit1.PrintImage ImgAdmin1.PrintStartPage,
        ImgAdmin1.PrintEndPage, ImgAdmin1.PrintOutputFormat,
        ImgAdmin1.PrintAnnotations

PrintErr:

    'User pressed the cancel button

        Exit Sub

End Sub


ShowPrintDialog Example - VC++
ShowPrintDialog Example [image] VC++

This example uses the ShowPrintDialog method to enable the user to specify printing parameters. The image displayed in the Image Edit control is then printed.

void CAdmin1Dlg::OnPrint()

{

    // Display an image

    ImgEdit1.SetImage ("D:\\image2\\4page.tif");

    ImgEdit1.Display();

    // Reset NumCopies in case user printed multiple copies last time.

    ImgAdmin1.SetPrintNumCopies (1);

    // If CancelError is true, an error is generated if user presses
    // cancel.  Trap the error to avoid trying to print the file.

    ImgAdmin1.SetCancelError (TRUE);

    // Set filename to be printed to the displayed file. If this property
    // is not set the dialog box will not display.

    ImgAdmin1.SetImage (ImgEdit1.GetImage());

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowPrintDialog (vhWnd);

    // Print the image using the parameters obtained from the print
    // dialog box (ex. start page, end page etc.).

    VARIANT vStart, vEnd, vOutputFormat, vAnnotations, evt;

    evt.vt = VT_ERROR;    // set to error for optional parameter

    V_I4(&vStart) = ImgAdmin1.GetPrintStartPage();
    V_I4(&vEnd) = ImgAdmin1.GetPrintEndPage();
    V_I4(&vOutputFormat) = ImgAdmin1.GetPrintOutputFormat();
    V_I4(&vAnnotations) = ImgAdmin1.GetPrintAnnotations();

    ImgEdit1.PrintImage (vStart, vEnd, vOutputFormat ,
        vAnnotations, evt, evt, evt);

}


Skip Method

See Also	Example-VB
Skips over nSkip items in the query result list returned by the DoQuery method.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Image Admin control

Syntax

object.Skip (int nSkip)

Arguments

Parameter	Data Type	Description
nSkip	int	The number of items to skip over
Remarks

This method should be called only after the DoQuery method has been called.

Calling Skip immediately after calling the Reset method positions the pointer to reference the nSkip item in the query result list.

This method is one of several [image] DoQuery, EndQuery, Next, Reset, and SetPath [image] used to perform queries with programming languages such as PowerBuilder that do not support Microsoft’s Ccollection object class.


VerifyImage Method

See Also	Example-VB
Determines if the image specified in the Image property exists, and verifies level of access.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Admin control

Syntax

object.VerifyImage(Option)

Arguments

Parameter	Data Type	Description
Option	Long	Specifies the level of access to verify.
		0 = Verify existence 1 = Verify read access 2 = Verify write access 3 = Verify read/write access
Return Value

Boolean

Setting	Description
True	The file exists and has the level of access specified by the Option argument.
False	The file does not exist, or does not have the level of access specified in the Option argument.


VerifyImage Example [image] VB


FilePropertiesClose Event

See Also	Example-VB
This event fires when the end user changes properties on the File Properties dialog box and then closes it (subject to the restrictions in the Remarks section).

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Admin Control

Syntax

Sub object_FilePropertiesClose

Arguments

None

Remarks

You must set the bIsReadOnly parameter in the ShowFileProperties method to False for this event to fire. The end user must also modify one or more of the properties on the File Properties dialog box.


FilePropertiesClose Example [image] VB


File Type argument

Setting	Description
0	Unknown
1	TIFF
2	AWD (Windows 95 and 98 only)
3	Bitmap (BMP)
4	PCX
5	DCX
6	JPEG
7	XIF
8	GIF
9	WIFF


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


CompressionType argument

Setting	Description
0	Unknown
1	No compression
2	Group 3 1D FAX
3	Group 3 Modified Huffman
4	PackBits
5	Group 4 2D FAX
6	JPEG
7	Reserved
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	Low resolution, high quality
128	Low resolution, medium quality
256	Low resolution, low quality
512	Medium resolution, high quality
1024	Medium resolution, medium quality
2048	Medium resolution, low quality
4096	High resolution, high quality
8192	High resolution, medium quality
16384	High resolution, low quality


Image Scan Control

See Also	Properties	Methods	Events
What the Image Scan control lets you do

The Image Scan control lets you [image] the application developer [image] add scanning functions to applications that support 32-bit ActiveX controls.

Applications that you create with the Image Scan control can only work with TWAIN compliant scanners.

Your scanner requires a TWAIN data source (usually supplied by the manufacturer) and the 32-bit TWAIN DLLs provided with Imaging for Windows.

What the Image Scan control lets your users do

The Image Scan control lets your users scan and save image documents as an integral part of your application.  Depending on how you design and code your application, users can scan new single-page and multipage image documents, as well as append and insert scanned pages into existing documents.

The resulting image documents can be viewed, manipulated, annotated, printed, or sent within an e-mail package.

Prerequisites

The Scan control is invisible and can work independently of other controls. However, to display images while they are being scanned, you must link the Scan control to the Image Edit control that will display these images.

To link an Image Scan control to an 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.

These properties are set automatically when you draw an Image Scan control and an Image Edit control on a form.

Obsolete Properties and Methods

The following properties and methods are obsolete, and no longer supported.

 CompressionInfo property. Please use the methods GetPageTypeCompressionInfo and SetPageTypeCompressionOpts instead.

 CompressionType property. Please use the method GetPageTypeCompressionType instead.

 PageType property. Please use the following methods instead:

GetPageTypeCompressionInfo

GetPageTypeCompressionType

GetCompressionPreference

SetPageTypeCompressionOptions

 ResetScanner method.

Note

After installing the latest TWAIN DLLs, you may experience compatibility problems with some previously installed applications. This usually means that your data source is no longer current. Contact the manufacturer of your scanner for the latest data sources and compatibility information.


Extender Properties (Image Scan)
Image Scan Extender Properties

See Also	Example
This topic lists the Extender properties that are available when the Scan control is drawn on a Visual Basic form.

Name	Description
Index	Returns or sets the subscript value of a control in an array of controls
Name	Returns the name of an object
Object	Returns a reference to a property or method of a control that has the same name as a property or method extended to the control
Parent	Returns the form, object, or collection that contains either a control, or another object or collection
Tag	Returns or sets ancillary data
Refer to the Visual Basic on-line help for more information about these properties.


CompressionInfo Property

See Also	Example-VB
Sets the compression options to use when scanning.

Note: This property is obsolete [image] the information provided here is for backward compatability. Please refer to the methods GetPageTypeCompressionInfo and SetPageTypeCompressionOpts.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.CompressionInfo[=value]

Data Type

Long

Setting	Description
Note:  Settings 1 to 32 cannot be 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 (default)	Expanded bit order, left to right
32	Negate - reverses black and white on expansion
Note:  The following settings pertain only to JPEG compression.

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

Using the JPEG compression method, the higher the compression ratio, the more degraded the image quality becomes. The amount of degradation that is acceptable varies with the image and the application. Experimenting with different settings is recommended.

Resolution is independent of the compression ratio. Optimal settings will vary, based on individual requirements.

Be careful when changing these values [image] the compression type could be affected.


CompressionType Property

See Also	Example-VB
Sets the compression type to use when scanning.

Note: This property is obsolete [image] the information provided here is for backward compatability. Please refer to the methods GetPageTypeCompressionType and SetPageTypeCompressionOpts instead.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.CompressionType[=value]

Data Type

Integer (enumerated)

Constant	Setting	Description
NoCompression	1	No compression
CCITTGroup3_1d_Fax	2	Group 3 1D FAX
CCITTGroup3_1d_ModifiedHuffman	3 (default)	Group 3 1D Modified Huffman
PackedBits	4	PackBits
CCITTGroup4_2d_Fax	5	Group 4 2D FAX
JPEG	6	JPEG
LZW	7	LZW
Remarks

The value set for this property determines which settings are available in the CompressionInfo property.


DefaultScanner Property

See Also	Example-VB
Sets or indicates the name of the default scanner.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Scan control

Syntax

object.DefaultScanner[= scannername]

Data Type

String

Remarks

This property stores the name of the last scanner selected by the ShowSelectScanner method. This value can be retrieved and used to set the SelectedScanner property.

In most cases, you should set this property with the ShowSelectScanner method.


DestImageControl Property

See Also	Example-VB	Example-VC++
Returns or sets the name of the destination image/edit control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.DestImageControl[=controlname]

Data Type

String

Remarks

This property links the Image Scan control to a specified Image Edit control, displaying the image that is being scanned.

Use the name of the Image Edit control to which you want to link.


DestImageControl Example - VB
DestImageControl Example [image] VB

If there are multiple Image Edit controls within an application, set the DestImageControl property to specify which control will receive the scan data.

Private Sub cmdDestImage_Click()

    'The DestImageControl property must be set to match
    'the value specified in the ImgEdit's ImageControl property.
    'This would scan to an ImgEdit control referred to as ImgEdit2

    frmMain.ImgScan1.DestImageControl = "ImgEdit2"

    frmMain.ImgScan1.StartScan

End Sub


DestImageControl Example - VC++
DestImageControl Example [image] VC++

If there are multiple Image Edit controls within an application, set the DestImageControl property to specify which control will receive the scan data.

Void CNewscanDlg::OnDestimagecontrol()

{

    // The DestImageControl property must be set to match
    // the value specified in the ImgEdit's ImageControl property.
    // This would scan to an ImgEdit control referred to as ImgEdit2.

    ImgScan1.SetDestImageControl("ImgEdit2")

    ImgScan1.StartScan();

}


FileType Property

See Also	Example-VB	Example-VC++
Returns or sets the type of image file that will be created.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.FileType[=value]

Data Type

Integer (enumerated)

Constant	Setting	Description
TIFF	1 (default)	TIFF
AWD_MicrosoftFax	2	AWD (Windows 95 and 98 only)
BMP_Bitmap	3	BMP
Remarks

Set this value to the file type you want to create when scanning.


FileType Example - VB
FileType Example [image] VB

This example shows how to insert a scanned page before page 1 of an existing image file.

Private Sub cmdInsert_Click()

    'Use the ImgAdmin control to select a file for display
    'in the ImgEdit control.

    ImgAdmin1.ShowFileDialog OpenDlg  '0

    ImgEdit1.Image = ImgAdmin1.Image

    ImgEdit1.Display

    'For insert or append, set the Scan control's
    'Image property.

    ImgScan1.Image = ImgAdmin1.Image

    'MultiPage must be set to True in order to create
    'files with more than one page.

    ImgScan1.MultiPage = True

    ImgScan1.PageOption = InsertPages '3

    ImgScan1.Page = 1

    ImgScan1.FileType = TIFF '1

    'Scan using the Scan Page dialog box.

    ImgScan1.ShowScanPage

End Sub


FileType Example - VC++
FileType Example [image] VC++

This example shows how to insert a scanned page before page 1 of an existing image file.

void CNewscanDlg::OnInsertpage()

{

    // This example shows how to insert a scanned page before
    // page 1 of an existing image.

    // Use the ImgAdmin control to select a file for display
    // in the ImgEdit control.

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowFileDialog(0,vhWnd); // OpenDlg  // 0

    // Check to see if cancel was pressed...

    ImgEdit1.SetImage(ImgAdmin1.GetImage());

    ImgEdit1.Display();

    // For insert or append, set the Scan control's
    // Image property.

    ImgScan1.SetImage(ImgAdmin1.GetImage());

    // Multipage must be set to True in order to create
    // files with more than one page.

    ImgScan1.SetMultiPage(TRUE);

    ImgScan1.SetPageOption(3);  //InsertPages '3

    ImgScan1.SetPage (1);

    ImgScan1.SetFileType(1); // TIFF '1

    // Scan using the Scan Page dialog box.

    VARIANT vModal; V_VT(&vModal) = VT_BOOL;

    V_BOOL(&vModal) = TRUE;

    ImgScan1.ShowScanPage(vModal);

}


Image Property (Image Scan control)
Image Property

See Also	Example-VB	Example-VC++
Returns or sets the name of the object to which you are scanning.

Note: This property is not the same as, or linked to, the Image properties used by the Image Edit and Thumbnail controls.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.Image[=filename]

Data Type

String

Remarks

The object you scan to [image] a file or template [image] must be set in the ScanTo property.

If you point to a file template, image files are generated and incremented as you scan to them. For example, if you use a template named ‘img’, you must specify a path, such as c:\scan\images\img. The template ‘img’ will generate files named img00001.xxx, img00002.xxx, and so on.

If a valid path is not specified, an error is returned.


Image Example (Scan) - VB
Image Example [image] VB

These examples show how to set the Image property when you are scanning to different locations. Single slashes can be forward (/) or backward (\).

Private Sub cmdSetImage_Click()

    'Syntax for setting image property to a local file.

    ImgScan1.Image = "C:/scanimg/contract.tif"

   'Syntax for a 1.x Server document. Single slashes can be forward or
   'back. Note that the prefix Image:// represents the service name for
   'a 1.x server.

    ImgScan1.Image =
        "Image://srvrname\volname:\CABNAME\DRAWERNAME\FOLDERNAME\YOURDOC"

    'Syntax for 1.x Server filename with a volume name mapped.

    ImgScan1.Image = "Image://srvrname/volname:/dirname/temp.tif"

End Sub


Image Example (Scan) - VC++
Image Example [image] VC++

These examples show how to set the Image property when you are scanning to different repositories. Single slashes can be forward (/) or backward (\).

void CNewscanDlg::OnImage()

{

    // Example of setting image property to a local file

    ImgScan1.SetImage ("C:\\scanimg\\contract.tif");

    // Syntax for 1.x Server document (Single slashes can be forward or back)

    // Note: prefix Image:// denotes service name for 1.x server

    ImgScan1.SetImage
        ("Image://srvrname\volname:\\CABNAME\\DRAWERNAME\\FOLDERNAME\\YOUR DOC");

    // Syntax for 1.x Server filename with a volume name mapped.

    ImgScan1.SetImage ("Image://srvrname/volname:/dirname/temp.tif");

}


MultiPage Property

See Also	Example-VB	Example-VC++
Determines if one or more image pages will be scanned to an image file.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.MultiPage[= {True|False}]

Data Type

Boolean

Setting	Description
True	Enables multiple image pages to be scanned to an image file
False (default)	Enables a single image page to be scanned to an image file
Remarks

Use this property when appending or inserting pages into an image file.

This property interacts with the PageCount property when you

 scan to a template

 scan to a file


MultiPage Example - VB
MultiPage Example [image] VB

This example shows how to insert a scanned page before page 1 of an existing image file.

Private Sub cmdInsert_Click()

    'Use the ImgAdmin control to select a file for display
    'in the ImgEdit control.

    ImgAdmin1.ShowFileDialog OpenDlg  '0

    ImgEdit1.Image = ImgAdmin1.Image

    ImgEdit1.Display

    'For insert or append, set the Scan control's
    'Image property.

    ImgScan1.Image = ImgAdmin1.Image

    'MultiPage must be set to True in order to create
    'files with more than one page.

    ImgScan1.MultiPage = True

    ImgScan1.PageOption = InsertPages '3

    ImgScan1.Page = 1

    ImgScan1.FileType = TIFF '1

    'Scan using the Scan Page dialog box.

    ImgScan1.ShowScanPage

End Sub


Multipage Example - VC++
MultiPage Example [image] VC++

This example shows how to insert a scanned page before page 1 of an existing image file.

void CNewscanDlg::OnInsertpage()

{

     // This example shows how to insert a scanned page before
     // page 1 of an existing image.

     // Use the ImgAdmin control to select a file for display
     // in the ImgEdit control.

     VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

     V_I4(&vhWnd) = (long)m_hWnd;

     ImgAdmin1.ShowFileDialog(0,vhWnd); // OpenDlg  // 0

     // Check to see if cancel was pressed...

     ImgEdit1.SetImage(ImgAdmin1.GetImage());

     ImgEdit1.Display();

     // For insert or append, set the Scan control's
     // Image property.

     ImgScan1.SetImage(ImgAdmin1.GetImage());

     // Multipage must be set to True in order to create
     // files with more than one page.

     ImgScan1.SetMultiPage(TRUE);

     ImgScan1.SetPageOption(3);  //InsertPages '3

     ImgScan1.SetPage (1);

     ImgScan1.SetFileType(1); // TIFF '1

     // Scan using the Scan Page dialog box.

     VARIANT vModal; V_VT(&vModal) = VT_BOOL;

     V_BOOL(&vModal) = TRUE;

     ImgScan1.ShowScanPage(vModal);

}


Page Property

See Also	Example-VB	Example-VC++
Returns or sets the starting page for a scanning session.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.Page[=pagenumber]

Data Type

Long

Remarks

Set this property to the current page number.

To append to a file, set the page number to 0 (zero). Also, the PageOption property must be set to 2 (Append Pages).

To insert one or more pages, set the page number to the number of the page you are inserting before. For example, to insert before page 5, enter page number 5.


Page Example - VB
Page Example [image] VB

This example shows how to insert a scanned page before page 1 of an existing image file.

Private Sub cmdInsert_Click()

    'Use the ImgAdmin control to select a file for display
    'in the ImgEdit control.

    ImgAdmin1.ShowFileDialog OpenDlg  '0

    ImgEdit1.Image = ImgAdmin1.Image

    ImgEdit1.Display

    'For insert or append, set the Scan control's
    'Image property.

    ImgScan1.Image = ImgAdmin1.Image

    'MultiPage must be set to True in order to create
    'files with more than one page.

    ImgScan1.MultiPage = True

    ImgScan1.PageOption = InsertPages '3

    ImgScan1.Page = 1

    ImgScan1.FileType = TIFF '1

    'Scan using the Scan Page dialog box.

    ImgScan1.ShowScanPage

End Sub


Page Example - VC++
Page Example [image] VC++

This example shows how to insert a scanned page before page 1 of an existing image file.

void CNewscanDlg::OnInsertpage()

{

     // This example shows how to insert a scanned page before
     // page 1 of an existing image.

     // Use the ImgAdmin control to select a file for display
     // in the ImgEdit control.

     VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

     V_I4(&vhWnd) = (long)m_hWnd;

     ImgAdmin1.ShowFileDialog(0,vhWnd); // OpenDlg  // 0

     // Check to see if cancel was pressed...

     ImgEdit1.SetImage(ImgAdmin1.GetImage());

     ImgEdit1.Display();

     // For insert or append, set the Scan control's
     // Image property.

     ImgScan1.SetImage(ImgAdmin1.GetImage());

     // Multipage must be set to True in order to create
     // files with more than one page.

     ImgScan1.SetMultiPage(TRUE);

     ImgScan1.SetPageOption(3);  //InsertPages '3

     ImgScan1.SetPage (1);

     ImgScan1.SetFileType(1); // TIFF '1

     // Scan using the Scan Page dialog box.

     VARIANT vModal; V_VT(&vModal) = VT_BOOL;

     V_BOOL(&vModal) = TRUE;

     ImgScan1.ShowScanPage(vModal);

}


PageCount Property

See Also	Example-VB	Example-VC++
Returns or sets the number of pages per image file.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.PageCount[=number of pages]

Data Type

Long

Remarks

Valid values are 0 (zero) to 0x7FFF (32767). The default value is 0x7FFF.

This property interacts with the MultiPage property when you

 scan to a template

 scan to a file


PageCount Example - VB
PageCount Example [image] VB

This code segment shows how to scan all the pages in the scanner's automatic document feeder (ADF) to a multipage file using a file template. The example creates three image pages and names them using the prefix "img" (for example, img0001.tif, img0002.tif).

Private Sub cmdTemplate_Click()

    ImgScan1.ScanTo = UseFileTemplateOnly '4

    'Set the image property to a template name.

    ImgScan1.Image = "D:\image2\img"

    'MultiPage must be true in order to create files with
    'more than one page.

    ImgScan1.MultiPage = True

    'Create 3 page image files.

    ImgScan1.PageCount = 3

    'Do not show the scanner's TWAIN UI.

    ImgScan1.ShowSetupBeforeScan = False

    'Scan without using dialog box.

    ImgScan1.StartScan

End Sub


PageCount Example - VC++
PageCount Example [image] VC++

This code segment shows how to scan all the pages in the scanner's automatic document feeder (ADF) to a multipage file using a file template. The example creates three image pages and names them using the prefix "img" (for example, img0001.tif, img0002.tif).

void CNewscanDlg::OnTemplate()

{

    ImgScan1.SetScanTo (4);  // UseFileTemplateOnly // 4

    // Set the image property to a template name.

    ImgScan1.SetImage ("D:\\image2\\img");

    // Multipage must be true in order to create files with
    // more than one page.

    ImgScan1.SetMultiPage(TRUE);

    // Create 3 page image files.

    ImgScan1.SetPageCount(3);

    // Do not show the scanner's TWAIN UI.

    ImgScan1.SetShowSetupBeforeScan(FALSE);

    // Scan without using dialog box.

    ImgScan1.StartScan();

}


PageOption Property

See Also	Example-VB	Example-VC++
Indicates or sets if a scanned page will be Appended or Inserted, or if a page will be overwritten with or without a prompt at scan time.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.PageOption[=value]

Data Type

Integer (enumerated)

Constant	Setting	Description
CreateNewFile	0	Creates a new image file and adds image pages. An error will occur if the file exists. Pages can be added only if an automatic document feeder (ADF) is present.
PromptToCreateNewFile	1 (default)	Creates a new image file and adds image pages. If an image file exists, a prompt is displayed before overwriting. Pages can be added only if an automatic document feeder (ADF) is present.
AppendPages	2	Appends to an existing image file
InsertPages	3	Inserts a page in the existing image file, before the current image page, as specified in the Page property. An error will occur if the file does not exist.
OverwritePages	4	Overwrites an image file on an existing image page. If the image page does not exist, an error will occur.
PromptToOverwritePages	5	Displays a prompt prior to overwriting an existing image page. If the image page does not exist, an error will occur.
OverwriteAllPages	6	Overwrites all pages in an image file
Remarks

The Page property determines the current image page in a selected file.

If you are appending or inserting pages (Settings 2 and 3), you must set the MultiPage property to True. Otherwise, the error message "File already exists" is returned.

If settings 0, 1, 2, or 6 are chosen, a new file is created if the file specified in the Image property does not exist.


PageOption Example - VB
PageOption Example [image] VB

This example shows how to insert a scanned page before page 1 of an existing image file.

Private Sub cmdInsert_Click()

    'Use the ImgAdmin control to select a file for display
    'in the ImgEdit control.

    ImgAdmin1.ShowFileDialog OpenDlg  '0

    ImgEdit1.Image = ImgAdmin1.Image

    ImgEdit1.Display

    'For insert or append, set the Scan control's
    'Image property.

    ImgScan1.Image = ImgAdmin1.Image

    'MultiPage must be set to True in order to create
    'files with more than one page.

    ImgScan1.MultiPage = True

    ImgScan1.PageOption = InsertPages '3

    ImgScan1.Page = 1

    ImgScan1.FileType = TIFF '1

    'Scan using the Scan Page dialog box.

    ImgScan1.ShowScanPage

End Sub


PageOption Example - VC++
PageOption Example [image] VC++

This example shows how to insert a scanned page before page 1 of an existing image file.

void CNewscanDlg::OnInsertpage()

{

     // This example shows how to insert a scanned page before
     // page 1 of an existing image.

     // Use the ImgAdmin control to select a file for display
     // in the ImgEdit control.

     VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

     V_I4(&vhWnd) = (long)m_hWnd;

     ImgAdmin1.ShowFileDialog(0,vhWnd); // OpenDlg  // 0

     // Check to see if cancel was pressed...

     ImgEdit1.SetImage(ImgAdmin1.GetImage());

     ImgEdit1.Display();

     // For insert or append, set the Scan control's
     // Image property.

     ImgScan1.SetImage(ImgAdmin1.GetImage());

     // Multipage must be set to True in order to create
     // files with more than one page.

     ImgScan1.SetMultiPage(TRUE);

     ImgScan1.SetPageOption(3);  //InsertPages '3

     ImgScan1.SetPage (1);

     ImgScan1.SetFileType(1); // TIFF '1

     // Scan using the Scan Page dialog box.

     VARIANT vModal; V_VT(&vModal) = VT_BOOL;

     V_BOOL(&vModal) = TRUE;

     ImgScan1.ShowScanPage(vModal);

}


PageType Property

See Also	Example-VB
Returns or sets the image type for the pages being saved after scanning.

Note: This property is obsolete, and the information provided is for backward compatability. Please use the following methods instead:

GetPageTypeCompressionInfo

GetPageTypeCompressionType

GetCompressionPreference

SetPageTypeCompressionOptions

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.PageType[=value]

Data Type

Integer (enumerated)

Constant	Setting	Description
BlackAndWhite	1 (default)	Black and white
Gray16Shades	2	Gray scale, 4-bit
Gray256Shades	3	Gray scale, 8-bit
Color16Count	4	Palettized, 4-bit (BMP and TIFF)
Color256Count	5	Palettized, 8-bit (BMP and TIFF)
TrueColor24bit	6	RGB, 24-bit
HighColor24bit	7	BGR, 24-bit
Remarks

This property also determines the compression type and compression information required for saving the image file.


ScanTo Property

See Also	Example-VB	Example-VC++
Returns or sets the destination of the image being scanned.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.ScanTo[=value]

Data Type

Integer (enumerated)

Constant	Setting	Description
DisplayOnly	0 (default)	Display the scanned image
DisplayAndFile	1	Display the scanned image and write it to a file
FileOnly	2	Write the scanned image to a file
DisplayAndUseFileTemplate	3	Write the scanned image to a file using a template, and display the image.  Note: DisplayAndUseFileTemplate pertains only to files on local/redirected drives, and not to 1.x server documents.
UseFileTemplateOnly	4	Write the scanned image to a file using a template. This option pertains only to files on local/redirected drives, and to 1.x server documents.
FaxOnly	5	Fax the scanned image
DisplayandBatch	6	Display the images as they are scanned to a batch
BatchOnly	7	Scan images to a batch
Remarks

Ensure that the Image Scan control’s Image property is set correctly.

Settings 1, 2, 3, and 4 [image] you cannot write a file directly to an optical disk. You must write to a magnetic drive first, and then copy the file to the optical drive.

Settings 1, 2, and 5 require a file name.

Settings 3 or 4 require that the Image property points to a file template. Image files are then generated and incremented as you scan to them. For example, if you use a template named ‘img’, you must specify a path, such as c:\scan\images\img. The template ‘img’ will generate files named img00001.xxx, img00002.xxx, and so on.

If a valid path is not provided, an error will be returned.

This property interacts with other properties, depending on the value set.

 scan to a template

 scan to a file

Batch scanning involves scanning multiple documents to multiple files. The application must generate filenames without stopping or pausing the scanning process. Refer to the FileName event for additional information.

When scanning to a batch (options 6 and 7), the values set in several properties may be ignored.

FileType property [image] batch scanning creates only TIFF files

Image Property [image] is ignored until the FileNameRequest event fires. If you do not modify the value of the Image property from the FileNameRequest event, multiple pages will be scanned to the file named in the Image property. If the file name is changed in the Image property, a new file is created.

PageOption property [image] if set to 2 (append pages), a new file will be created, and pages will appended to it until another file name is set. Applications that need to insert a page or overwrite one or more pages should use the File option of the ScanTo property.

Multipage property [image] will always be set to True (allow multiple image pages to be scanned to a file).

Page property [image] will be set to page 1.

PageCount property [image] will be set to the maximum number of pages (32,767).


ScanTo Example - VB
ScanTo Example [image] VB

This code segment scans all pages in the ADF to a multipage file while displaying each page.

Private Sub cmdDisplayAndFile_Click()

    ImgScan1.ScanTo = DisplayAndFile

    'Set the image property to a file name.

    ImgScan1.Image = "D:\image2\newpages.tif"

    'Multipage must be true in order to create files with
    'more than one page.

    ImgScan1.MultiPage = True

    'Do not show the scanner's TWAIN UI.

    ImgScan1.ShowSetupBeforeScan = False

    'Scan without using dialog box.

    ImgScan1.StartScan

End Sub

The following two examples demonstrate how the ScanTo property can be used to specify the destination of the image that is being scanned. In the first example, the image is scanned to the file specified by the Image property. In the second example, the image is scanned to the display and to a filename template specified with the Image property.

Note: You should set the Image property after you set the ScanTo property.

'Example 1

Private Sub cmdScanToFile_Click()

    On Error GoTo ScanError

    ImgScan1.ScanTo = FileOnly      'Scan to a file

    ImgScan1.Image = "c:\scan.tif"  'Destination file

    ImgScan1.StartScan

    Exit Sub

ScanError:

    MsgBox Err.Description, , "Scan Error"

    Exit Sub

End Sub

'Example 2

Private Sub cmdScanToDisplay_Click()

    On Error GoTo ScanError

    ImgScan1.ScanTo = DisplayAndUseFileTemplate   'Scan to display and template

    ImgScan1.Image = "c:\img"                     'Template = imgxxxxx.tif

    ImgScan1.StartScan

    Exit Sub

ScanError:

    MsgBox Err.Description, , "Scan Error"

    Exit Sub

End Sub


ScanTo Example - VC++
ScanTo Example [image] VC++

This code segment scans all pages in the ADF to a multipage file while displaying each page.

void CNewscanDlg::OnDisplayAndFile()

{

   ImgScan1.SetScanTo (1);     // DisplayAndFile

    // Set the image property to a file name.

    ImgScan1.SetImage ("D:\\image2\\newpages.tif");

    // Multipage must be true in order to create files with
    // more than one page.

    ImgScan1.SetMultiPage (TRUE);

    // Do not show the scanner's TWAIN UI.

    ImgScan1.SetShowSetupBeforeScan (FALSE);

    // Scan without using dialog box.

    ImgScan1.StartScan();

}


Scroll Property

See Also	Example-VB
Sets or indicates if a displayed image will be scrolled while it is being scanned. Works only if "Memory" was set as the TWAIN transfer mode

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.Scroll[={True|False}]

Data Type

Boolean

Setting	Description
True (default)	Scanned image is scrolled
False	Scanned image is not scrolled
Remarks

Used in conjunction with the ScanTo property if ScanTo is set to a value of 0, 1, or 3.

The Advanced button on the dialog box created by the ShowScanPreferences method presents a choice between two transfer modes [image] Native and Memory. Users can switch between these modes to see which gives the best performance with their scanner driver. You (the developer) cannot set this mode programmatically.

Note: In Native mode, some scanners (such as the Hewlett Packard ScanJet II C and the Fujitsu 3093 DG) scan the images inverted. To correct this, set the Invert enhancement.


Scroll Example [image] VB


SelectedScanner Property

See Also	Example-VB
Sets or indicates the name of the currently selected scanner.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Scan control

Syntax

object.SelectedScanner[= scannername]

Data Type

String

Remarks

The name of the selected scanner is stored, and will used when the OpenScanner method is called again.


ShowSetupBeforeScan Property

See Also	Example-VB	Example-VC++
Displays the scanner’s user interface (see sample) before starting a scan.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.ShowSetupBeforeScan[={True|False}]

Data Type

Boolean

Setting	Description
True (default)	Displays the user interface before scanning
False	Does not display user interface before scanning
Remarks

Used to set up the scanner before the first scan, and then bypass the setup dialog box for subsequent scans.

Some TWAIN device data sources require that a user interface dialog box be displayed before each scan, because settings from the previous scan are not saved.


ShowSetupBeforeScan Example - VB
ShowSetupBeforeScan Example [image] VB

This code segment shows how to scan all the pages in the scanner's automatic document feeder (ADF) to multipage files using a file template. The example creates three-page image files and names them using the prefix "img" (for example, img0001.tif, img0002.tif).

Private Sub cmdTemplate_Click()

    ImgScan1.ScanTo = UseFileTemplateOnly '4

    'Set the image property to a template name.

    ImgScan1.Image = "D:\image2\img"

    'MultiPage must be true in order to create files with
    'more than one page.

    ImgScan1.MultiPage = True

    'Create 3 page image files.

    ImgScan1.PageCount = 3

    'Do not show the scanner's TWAIN UI.

    ImgScan1.ShowSetupBeforeScan = False

    'Scan without using dialog box.

    ImgScan1.StartScan

End Sub


ShowSetupBeforeScan Example - VC++
ShowSetupBeforeScan Example [image] VC++

This code segment shows how to scan all the pages in the scanner's automatic document feeder (ADF) to multipage files using a file template. The example creates three-page image files and names them using the prefix "img" (for example, img0001.tif, img0002.tif).

void CNewscanDlg::OnTemplate()

{

    ImgScan1.SetScanTo (4);  // UseFileTemplateOnly // 4

    // Set the image property to a template name.

    ImgScan1.SetImage ("D:\\image2\\img");

    // Multipage must be true in order to create files with
    // more than one page.

    ImgScan1.SetMultiPage(TRUE);

    // Create 3 page image files.

    ImgScan1.SetPageCount(3);

    // Do not show the scanner's TWAIN UI.

    ImgScan1.SetShowSetupBeforeScan(FALSE);

    // Scan without using dialog box.

    ImgScan1.StartScan();

}


StopScanBox Property

See Also	Example-VB
Sets or indicates if the Stop Scan dialog box will be displayed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.StopScanBox[={True|False}]

Data Type

Boolean

Setting	Description
True	Displays the Stop Scan dialog box
False (default)	Does not display the Stop Scan dialog box
Remarks

The Stop Scan dialog box enables the user to stop the scanning process.


StopScanBox Example [image] VB


Zoom Property (Image Scan control)
Zoom Property

See Also	Example-VB
Returns or sets the scale at which scanned pages are displayed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.Zoom[=value]

Data Type

Single

Remarks

Used in conjunction with the ScanTo property if ScanTo is set to a value of 0, 1, or 3.

At scan time, the zoom value set is rounded to one of the following values: 6.25%, 12.5%, 25%, 50%, 100%, 200%, 400%, or 800%.

If you are scanning to an Image Edit control, set the Zoom property in that control to the same value that you set here.


Zoom Example [image] VB


CloseScanner Method

See Also	Example-VB
Closes the scanner by unloading the driver.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.CloseScanner

Arguments

None

Return Value

Long

Most errors need to be intercepted by Catch ( ) in C++ or by On Error… in Visual Basic.

A busy condition returns an informational message.

Remarks

When a scanner or application error occurs, close the scanner before you access it again to avoid possible problems.


CloseScanner Example [image] VB


GetCompressionPreference Method

See Also	Example-VB	Example-VC++
Returns the compression preference used by the ShowScanPreference method or the SetPageTypeCompressionOpts method.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Scan control

Syntax

object.GetCompressionPreference(CompPreference)

Return Value

CompPreferenceConstants (Integer)

Constant	Setting	Description
BEST_DISPLAY_QUALITY	0 (default)	Best display quality
GOOD_DISPLAY_SMALL_FILE	1	Good display quality, small file size
SMALL_FILE	2	Smallest file size
SCAN_COMP_CUSTOM	3	Custom settings
Remarks

The information returned by this method can be used as follows:

 To maintain the compression options already set in the registry. (The information returned is read but not interpreted.)

 To interpret compression information, and then use that information to set explicit compression options during runtime.

Predefined compression preferences are shown below.

Best Display

Black and White

CCITT Group 3 1D

Group 3 1D Modified Huffman with reversed bit order

16 Shades of Gray

LZW (Professional Edition only)

LZW (no compression information)

256 Shades of Gray

LZW (Professional Edition only)

LZW (no compression information)

256 Colors

LZW (Professional Edition only)

LZW (no compression information)

True Color (RGB 24 bit)

Uncompressed

No compression information

16 Colors

LZW (Professional Edition only)

LZW (no compression information)

Good Display

Black and White

CCITT Group 3 1D

Group 3 1D Modified Huffman with reversed bit order

16 Shades of Gray

LZW (Professional Edition only)

LZW (no compression information)

256 Shades of Gray

JPEG

JPEG medium resolution, medium quality

256 Colors

LZW (Professional Edition only)

LZW (no compression information)

True Color (RGB 24 bit)

JPEG

JPEG medium resolution, medium quality

16 Colors

LZW (Professional Edition only)

LZW (no compression information)

Smallest File

Black and White

CCITT Group 3 1D

Group 3 1D Modified Huffman with reversed bit order

16 Shades of Gray

LZW (Professional Edition only)

LZW (no compression information)

256 Shades of Gray

JPEG

JPEG medium resolution, low quality

256 Colors

LZW (Professional Edition only)

LZW (no compression information)

True Color (RGB 24 bit)

JPEG

JPEG medium resolution, low quality

16 Colors

LZW (Professional Edition only)

LZW (no compression information)


GetCompressionPreference Example - VB
GetCompressionPreference Example [image] VB

This example demonstrates how to read and retain all current compression settings. In the event that another application makes changes to these settings at runtime, the saved values can be restored.

Private Sub cmdGetCompression_Click()

    'Option Base 1

    Dim lngCompInfo(6) As Long

    Dim intCompType(6) As Integer

    Dim intCompPref, intImgType As Integer

    CompPref = ImgScan1.GetCompressionPreference

    'Using intImgType to loop through 6 times (for each page type)
    'and also as the input parameter to the methods.

    For intImgType = 1 To 6

        intCompType(intImgType) =
            ImgScan1.GetPageTypeCompressionType(intImgType)

        lngCompInfo(intImgType) =
            ImgScan1.GetPageTypeCompressionInfo(intImgType)

    Next intImgType

End Sub


GetCompressionPreference Example - VC++
GetCompressionPreference Example [image] VC++

This example demonstrates how to read and retain all current compression settings. In the event that another application makes changes to these settings at runtime, the saved values can be restored.

void CNewscanDlg::OnGetcompression()

{

    // Option Base 1

    long lCompInfo[6];

    long iCompType[6];

    int iCompPref, iImgType;

    iCompPref = ImgScan1.GetCompressionPreference();

    // Using intImgType to loop through 6 times (for each page type)
    // and also as the input parameter to the methods.

    for(iImgType = 0; iImgType < 6 ; iImgType++)

        {

        iCompType[iImgType] = ImgScan1.GetPageTypeCompressionType(iImgType+1);

        lCompInfo[iImgType] = ImgScan1.GetPageTypeCompressionInfo(iImgType+1);

        }

}


GetCustomData Method

See Also	Example-VB
Retrieves custom data source information.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Image Scan control

Syntax

object.GetCustomData(pInfoLength, PvData)

Arguments

Parameter	Data Type	Description
pInfoLength	Long	Pointer to a Long that contains the length of custom data source information
PvData	VARIANT	Pointer to a Variant that is the handle to the custom data source information
Remarks

This method retrieves the parameters that are available for the selected data source. It is used in conjunction with the ShowScannerSetup method, which puts up a dialog box supplied by the TWAIN data source.

This type of information is available with some data sources that adhere to the TWAIN 1.8 standard.


GetPageTypeCompressionInfo Method

See Also	Example-VB	Example-VC++
Returns the compression information used by the specified image type. Applications can request and save this information for future use.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Scan control

Syntax

object.GetPageTypeCompressionInfo(ImageType)

Arguments

ImageTypeConstants (Integer)

Constant	Setting	Description
BlackAndWhite1Bit	1	Black and white
Gray4Bit	2	16 shades of gray
Gray8Bit	3	256 shades of gray
ColorPal8Bit	4	256 colors
TrueColor24bitRGB	5	True color (RGB 24 bit)
ColorPal4Bit	6	16 Colors
Return Value

CompInfoConstants (Integer)

Constant	Setting	Description
NoCompInfo	0	No compression information
G31DmodifiedHuffman	4096	Group 3 1D Modified Huffman
G31DmodifiedHuffmanRBO	0	Group 3 1D Modified Huffman with reversed bit order
G31Dfax	6400	Group 3 1D Fax
G31DFaxRBO	2304	Group 3 1D Fax with reversed bit order
G42Dfax	4608	Group 4 2D Fax
G42DFaxRBO	512	Group 4 2D Fax with reversed bit order
TIFFPackbitsInfo	0	TIFF Packbits (no compression information)
LZWInfo	0	LZW (no compression information)
JPEGLowLow	11610	JPEG low resolution, high quality
JPEGLowMed	7740	JPEG low resolution, medium quality
JPEGLowHigh	3870	JPEG low resolution, low quality
JPEGMedLow	27994	JPEG medium resolution, high quality
JPEGMedMed	24124	JPEG medium resolution, medium quality
JPEGMedHigh	20254	JPEG medium resolution, low quality
JPEGHighLow	-21158	JPEG high resolution, high quality
JPEGHighMed	-25028	JPEG high resolution, medium quality
JPEGHighHigh	-28898	JPEG high resolution, low quality
Remarks

The information returned by this method can be used as follows.

 To maintain the compression options already set in the registry. (The information returned is read but not interpreted.)

 To interpret compression information, and then use that information to set explicit compression options during runtime.

An error is returned if the ImageType is invalid.


GetPageTypeCompressionInfo Example - VB
GetPageTypeCompressionInfo Example [image] VB

This example demonstrates how to read and retain all current compression settings. In the event that another application makes changes to these settings at runtime, the saved values can be restored.

Private Sub cmdGetCompression_Click()

    'Option Base 1

    Dim lngCompInfo(6) As Long

    Dim intCompType(6) As Integer

    Dim intCompPref, intImgType As Integer

    CompPref = ImgScan1.GetCompressionPreference

    'Using intImgType to loop through 6 times (for each page type)
    and also as the input parameter to the methods.

    For intImgType = 1 To 6

        intCompType(intImgType) =
            ImgScan1.GetPageTypeCompressionType(intImgType)

        lngCompInfo(intImgType) =
            ImgScan1.GetPageTypeCompressionInfo(intImgType)

    Next intImgType

End Sub


GetPageTypeCompressionInfo Example - VC++
GetPageTypeCompressionInfo Example [image] VC++

This example demonstrates how to read and retain all current compression settings. In the event that another application makes changes to these settings at runtime, the saved values can be restored.

void CNewscanDlg::OnGetcompression()

{

    // Option Base 1

    long lCompInfo[6];

    long iCompType[6];

    int iCompPref, iImgType;

    iCompPref = ImgScan1.GetCompressionPreference();

    // Using intImgType to loop through 6 times (for each page type)
    // and also as the input parameter to the methods.

    for(iImgType = 0; iImgType < 6 ; iImgType++)

        {

        iCompType[iImgType] = ImgScan1.GetPageTypeCompressionType(iImgType+1);

        lCompInfo[iImgType] = ImgScan1.GetPageTypeCompressionInfo(iImgType+1);

        }

}


GetPageTypeCompressionType Method

See Also	Example-VB	Example-VC++
Returns the compression information used by the specified image type. Applications can then request and save this information for future use.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Scan control

Syntax

object.GetPageTypeCompressionType(ImageType)

Arguments

ImageTypeConstants (Integer)

Constant	Setting	Description
BlackAndWhite1Bit	1	Black and white
Gray4Bit	2	16 shades of gray
Gray8Bit	3	256 shades of gray
ColorPal8Bit	4	256 colors
TrueColor24bitRGB	5	True color (RGB 24 bit)
ColorPal4Bit	6	16 Colors
Return Value

CompTypeConstants (Integer)

Constant	Setting	Description
Uncompressed	0	uncompressed
CCITTGroup31D	1	CCITT Group 3 1D
CCITTGroup42D	2	CCITT Group 4 2D
TIFFPackbits	4	TIFF Packbits
JPEGCompression	8	JPEG
LZWCompression	21	LZW
Remarks

The information returned by this method can be used as follows.

 To maintain the compression options already set in the registry. (The information returned is read but not interpreted.)

 To interpret compression information, and then use that information to set explicit compression options during runtime.

An error is returned if the ImageType is invalid.


GetPageTypeCompressionType Example - VB
GetPageTypeCompressionType Example [image] VB

This example demonstrates how to read and retain all current compression settings. In the event that another application makes changes to these settings at runtime, the saved values can be restored.

Private Sub Sub cmdGetCompression_Click()

    'Option Base 1

    Dim lngCompInfo(6) As Long

    Dim intCompType(6) As Integer

    Dim intCompPref, intImgType As Integer

    CompPref = ImgScan1.GetCompressionPreference

    'Using intImgType to loop through 6 times (for each page type)
    'and also as the input parameter to the methods.

    For intImgType = 1 To 6

        intCompType(intImgType) =
            ImgScan1.GetPageTypeCompressionType(intImgType)

        lngCompInfo(intImgType) =
            ImgScan1.GetPageTypeCompressionInfo(intImgType)

    Next intImgType

End Sub


GetPageTypeCompressionType Example - VC++
GetPageTypeCompressionType Example [image] VC++

This example demonstrates how to read and retain all current compression settings. In the event that another application makes changes to these settings at runtime, the saved values can be restored.

void CNewscanDlg::OnGetcompression()

{

    // Option Base 1

    long lCompInfo[6];

    long iCompType[6];

    int iCompPref, iImgType;

    iCompPref = ImgScan1.GetCompressionPreference();

    // Using intImgType to loop through 6 times (for each page type)
    // and also as the input parameter to the methods.

    for(iImgType = 0; iImgType < 6 ; iImgType++)

        {

        iCompType[iImgType] = ImgScan1.GetPageTypeCompressionType(iImgType+1);

        lCompInfo[iImgType] = ImgScan1.GetPageTypeCompressionInfo(iImgType+1);

        }

}


GetScanCapability Method

See Also	Example-VB	Example-VC++
Returns scanner capability information or current option settings.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Scan control

Syntax

object.GetScanCapability(Capability_ID)

Arguments

Parameter	Data Type	Description
Capability_ID	Integer	Capability information, current values of options, or Variant for an error or unknown capability
Return Value

A variant containing capability values supported by the scanner.

Capability_ID / Name	Description	Return Value	Data Type
1 Image Types Available	Colors supported	A bit-wise combination of the following values: 1 - black and white 2 - grayscale 16 4 - grayscale 256 8 - color 256 palettized 16 - true color 24-bit RGB 32 - color 16-bit palettized	Integer
2 Maximum Height	Maximum physical page height available on the flatbed.	Inches	Single
3 Maximum Height  (with ADF)	Maximum physical page height supported with an Automatic Document Feeder (ADF).	Inches	Single
4 Maximum Width	Maximum physical page width	Inches	Single
5 Minimum Resolution	Minimum resolution available	Dots-per-inch	Long
6 Maximum Resolution	Maximum resolution available	Dots-per-inch	Long
7 Resolution Step	The steps between maximum and minimum resolutions	Resolution increments, or an array of values	Long, if step is available.  Otherwise, an array of Long or Integer values.
8 Minimum Brightness	Minimum brightness available	Brightness value	Long
9 Maximum Brightness	Maximum brightness available	Brightness value	Long
10 Brightness step	The steps between maximum and minimum brightness values	Brightness increments, or an array of values	Long, if increments are available.  Otherwise, an array of Long or Integers values.
11 Auto Brightness	Determines if an auto brightness feature is available.	True - Auto brightness supported False - Auto brightness not supported	Boolean
12 Minimum Contrast	Minimum contrast available	Minimum contrast value	Long
13 Maximum Contrast	Maximum contrast available	Maximum contrast value	Long
14 Contrast Step	The steps between maximum and minimum contrast values	Contrast increments, or an array of values	Long, if increments are available.  Otherwise, an array of Long or Integer values.
15 Auto Contrast	Determines if an auto contrast feature is available.	True - Auto contrast supported False - Auto contrast not supported	Boolean
16 ADF available	Determines if the scanner supports an automatic document feeder (ADF)	True - ADF is available False - ADF is not available	Boolean
17 Duplex Available	Determines if duplex mode is supported	0 – (default) Scanner does not support duplex 1 – Scanner supports one-pass duplex 2 – Scanner supports two-pass duplex	Integer
18 Disable TWAIN Data Source Progress UI	Determines if the progress indicator dialog box on the current TWAIN data source can be disabled	True - progress indicator dialog box can be disabled False – (default) progress indicator dialog box cannot be disabled	Boolean
20 Minimum Threshold	Determines the minimum threshold supported	Minimum threshold value	Long
21 Maximum Threshold	Determines the maximum threshold supported	Maximum threshold value	Long
22 Threshold Step	The steps between maximum and minimum thresholds	Threshold increments, or an array of values	Long, if step is available.  Otherwise, an array of Long or Integer values.
23 Feeder alignment	Determines the feeder alignment supported	0 – Free.floating. For Applications, frame origin is to the left. 1 – Left-aligned 2 – Center-aligned 3 – Right-aligned	Integer
24 Data Source UI dialog box available	Determines if the data source's user interface can be displayed without acquiring an image Note: This capability pertains to TWAIN 1.8 data sources only.	True – data source UI can be displayed False – (default) data source UI cannot be displayed	Boolean
25 Data Source custom data available	Determines if the data source provides custom data. Note: This capability pertains to TWAIN 1.8 data sources only.	True – custom data is available False – (default) custom data is not available	Boolean

The following option information shows what values are currently set on the scanner.

Capability_ID  / Name	Description	Return Value	Data Type
100 Image Type	Image Type in use	One of the following values: 1 - black and white 2 - grayscale 16 4 - grayscale 256 8 - color 256 palettized 16 - true color 24-bit RGB 32 - color 16-bit palettized	Integer
101 X Resolution	X Resolution in use	A value between maximum and minimum resolution	Long
102 Brightness Mode	Reports if the Brightness Mode is set to Normal or Automatic	One of the following values: 1 - Normal 2 - Automatic	Integer
103 Brightness	If the Brightness Mode is Normal, the brightness level is returned	A brightness value (unit of measure varies with scanner type)	Long
104 Contrast Mode	Reports if the Contrast Mode is set to Normal or Automatic.	One of the following values: 1 - Normal 2 - Automatic	Integer
105 Contrast	If the Contrast Mode is Normal, the contrast level is returned	Contrast value (unit of measure varies with scanner type)	Long
106 Image Layout	Reports four values (in inches) that define the image layout - Left, Top, Height, and Width.	An array of 4 values, listed in the following order:    Left start of scan offset    Top start of scan offset    Width of scan    Height of scan	An array of Single values
107 Scan Mode	Reports if the Scan Mode is set to Flatbed or ADF (Automatic Document Feeder).	One of the following values: 1 - Flatbed 2 - ADF	Short
108 Paper in Feeder	Reports if there is paper in the ADF. The Scanner Mode must be set to 2 (ADF present) for this capability to be valid.	True - Paper is present False - Paper is not present	Boolean
109 Y Resolution	Y Resolution in use	A value between maximum and minimum resolution	Long
110 Duplex scanning	Reports the current state of duplex scanning.	True – Duplex scanning is enabled False – Duplex scanning is disabled	Boolean
111 Data Source Progress Indicator	Reports the current state of the TWAIN Data Source progress indicator. This capability is valid only when the ShowSetupBeforeScan property is False.	True – Data Source progress indicator will always be shown. False - Data Source progress indicator will not be shown if the ShowSetupBeforeScan property is False.	Boolean
114 Get TWAIN Transfer Mode	Report the current transfer mode in use – Native mode or Memory mode. Native mode is faster but requires more memory. Memory mode requires less memory but is not as efficient.	One of the following values: 1 – (default) Native mode 2 – Memory mode	Short
117 Threshold	Reports the current Threshold level	Threshold increments between maximum and minimum	Long
Remarks

The scanner must be open when this call is made, or an error is returned.

If a capability is not supported, a VT_Error is returned.


GetScanCapability Example - VB
GetScanCapability Example [image] VB

This example uses SetScanCapability to specify the Image Type for scanning, without using the scanner's TWAIN dialog box.

Private Sub CmdSetImgType_Click()

   'User is given the option to select an Image Type for scanning
   'of black and white, grayscale or color. The option selected
   'is stored in the global variable ScanType.

    Const IT_BW = 1

    Const IT_GRAY8 = 4

    Const IT_RGB = 16

    Const CAP_SCAN_IMAGE_TYPE = 100

    Const CAP_SCAN_IMAGE_TYPES_SUPPORTED = 1

    Dim varScanImgType As Variant

    'Global Scantype as integer

    'Scanner must be open for Capability check.

    ImgScan1.OpenScanner

    'See what image types the scanner supports.

    varScanImgType =
        ImgScan1.GetScanCapability(CAP_SCAN_IMAGE_TYPES_SUPPORTED)

    If VarType(varScanImgType) = vbError Then

        MsgBox "Unable to get Supported Image Types"

    End If

    'Find out if the type the user selected is supported.
    'if so set the capability to that image type

    Select Case ScanType

    Case 1

        If varScanImgType And IT_BW Then

           ImgScan1.SetScanCapability CAP_SCAN_IMAGE_TYPE, IT_BW

        Else

           MsgBox "Black & White image type is not supported by
               your scanner"

        End If

    Case 2

        If varScanImgType And IT_GRAY8 Then

           ImgScan1.SetScanCapability CAP_SCAN_IMAGE_TYPE, IT_GRAY8

        Else

           MsgBox "Grayscale image type is not supported by your scanner"

        End If

    Case 3

        If varScanImgType And IT_RGB Then

           ImgScan1.SetScanCapability CAP_SCAN_IMAGE_TYPE, IT_RGB

        Else

           MsgBox "Color image type is not supported by your scanner"

        End If

    End Select

End Sub


GetScanCapability Example - VC++
GetScanCapability Example [image] VC++

This example uses SetScanCapability to specify the Image Type for scanning, without using the scanner's TWAIN dialog box.

void CNewscanDlg::OnCapability()

{

// User is given the option to select an Image Type for scanning

// of black and white, grayscale or color. The option selected

// is stored in a global variable ScanType.

#define IT_BW  1

#define IT_GRAY8  4

#define IT_RGB 16

#define CAP_SCAN_IMAGE_TYPE 100

#define CAP_SCAN_IMAGE_TYPES_SUPPORTED 1

    VARIANT vScanImgType;

    VARIANT vCap; V_VT(&vCap) = VT_I2;

    // Global Scantype as integer

    // Scanner must be open for Capability check.

    ImgScan1.OpenScanner();

    // See what image types the scanner supports.

    vScanImgType =
        ImgScan1.GetScanCapability(CAP_SCAN_IMAGE_TYPES_SUPPORTED);

    if(V_VT(&vScanImgType) = VT_ERROR)
        AfxMessageBox ("Unable to get Supported Image Types");

    // Find out if the type the user selected is supported.
    // If so, set the capability to that image type.

    switch (m_iScanType)

        {

    case 1:

        if(V_I4(&vScanImgType) & IT_BW)

                {

                     V_I2(&vCap)= IT_BW;
                     ImgScan1.SetScanCapability (CAP_SCAN_IMAGE_TYPE,vCap);

                }

        else

           AfxMessageBox ("Black & White image type is not supported by your scanner");

                break;

    case 2:

        if(V_I4(&vScanImgType) & IT_GRAY8)

                {

                     V_I2(&vCap)= IT_GRAY8;
                     ImgScan1.SetScanCapability (CAP_SCAN_IMAGE_TYPE,vCap);

                 }

        else

           AfxMessageBox ("Grayscale image type is not supported by your scanner");

                break;

    case 3:

        if(V_I4(&vScanImgType) & IT_RGB)

                {

                    V_I2(&vCap)= IT_RGB;
                    ImgScan1.SetScanCapability( CAP_SCAN_IMAGE_TYPE,vCap);

                }

        else

           AfxMessageBox ("Color image type is not supported by your scanner");

        }

}


OpenScanner Method

See Also	Example-VB	Example-VC++
Opens the scanner by loading the driver.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.OpenScanner

Arguments

None

Return Value

Long

Most errors need to be intercepted by Catch ( ) in C++ or by On Error… in Visual Basic.

A busy condition returns an informational message.

Remarks

When the scan operation is complete, you should call the CloseScanner method. This frees up the scanner so that .dlls and executable files can be unloaded.


OpenScanner Example - VB
OpenScanner Example [image] VB

This example uses SetScanCapability to specify the Image Type for scanning, without using the scanner's TWAIN dialog box.

Private Sub cmdSetImgType_Click()

    'User is given the option to select an Image Type for scanning
    'of black and white, grayscale or color. The option selected
    'is stored in the global variable ScanType.

    Const IT_BW = 1

    Const IT_GRAY8 = 4

    Const IT_RGB = 16

    Const CAP_SCAN_IMAGE_TYPE = 100

    Const CAP_SCAN_IMAGE_TYPES_SUPPORTED = 1

    Dim varScanImgType As Variant

    'Global Scantype as integer

    'Scanner must be open for Capability check.

    ImgScan1.OpenScanner

    'See what image types the scanner supports.

    varScanImgType =
        ImgScan1.GetScanCapability(CAP_SCAN_IMAGE_TYPES_SUPPORTED)

    If VarType(varScanImgType) = vbError Then

        MsgBox "Unable to get Supported Image Types"

    End If

    'Find out if the type the user selected is supported;
    'if so set the capability to that image type

    Select Case ScanType

    Case 1

        If varScanImgType And IT_BW Then

           ImgScan1.SetScanCapability CAP_SCAN_IMAGE_TYPE, IT_BW

        Else

           MsgBox "Black & White image type is not supported by your scanner"

        End If

    Case 2

        If varScanImgType And IT_GRAY8 Then

           ImgScan1.SetScanCapability CAP_SCAN_IMAGE_TYPE, IT_GRAY8

        Else

           MsgBox "Grayscale image type is not supported by your scanner"

        End If

    Case 3

        If varScanImgType And IT_RGB Then

           ImgScan1.SetScanCapability CAP_SCAN_IMAGE_TYPE, IT_RGB

        Else

           MsgBox "Color image type is not supported by your scanner"

        End If

    End Select

End Sub


OpenScanner Example - VC++
OpenScanner Example [image] VC++

This example uses SetScanCapability to specify the Image Type for scanning, without using the scanner's TWAIN dialog box.

void CNewscanDlg::OnCapability()

{

// User is given the option to select an Image Type for scanning

// of black and white, grayscale or color. The option selected

// is stored in a global variable ScanType.

#define IT_BW  1

#define IT_GRAY8  4

#define IT_RGB 16

#define CAP_SCAN_IMAGE_TYPE 100

#define CAP_SCAN_IMAGE_TYPES_SUPPORTED 1

    VARIANT vScanImgType;

    VARIANT vCap; V_VT(&vCap) = VT_I2;

    // Global Scantype as integer

    // Scanner must be open for Capability check.

    ImgScan1.OpenScanner();

    // See what image types the scanner supports.

    vScanImgType =
        ImgScan1.GetScanCapability(CAP_SCAN_IMAGE_TYPES_SUPPORTED);

    if(V_VT(&vScanImgType) = VT_ERROR)
        AfxMessageBox ("Unable to get Supported Image Types");

    // Find out if the type the user selected is supported.
    // If so, set the capability to that image type.

    switch (m_iScanType)

        {

    case 1:

        if(V_I4(&vScanImgType) & IT_BW)

                {

                     V_I2(&vCap)= IT_BW;
                     ImgScan1.SetScanCapability (CAP_SCAN_IMAGE_TYPE,vCap);

                }

        else

           AfxMessageBox ("Black & White image type is not supported by your scanner");

                break;

    case 2:

        if(V_I4(&vScanImgType) & IT_GRAY8)

                {

                     V_I2(&vCap)= IT_GRAY8;
                     ImgScan1.SetScanCapability (CAP_SCAN_IMAGE_TYPE,vCap);

                 }

        else

           AfxMessageBox ("Grayscale image type is not supported by your scanner");

                break;

    case 3:

        if(V_I4(&vScanImgType) & IT_RGB)

                {

                    V_I2(&vCap)= IT_RGB;
                    ImgScan1.SetScanCapability( CAP_SCAN_IMAGE_TYPE,vCap);

                }

        else

           AfxMessageBox ("Color image type is not supported by your scanner");

        }

}


ResetScanner Method

See Also	Example-VB
Resets the scanner hardware and software.

Note: This method is obsolete, as it is not supported by the TWAIN interface. The following information is provided for older applications that used it.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.ResetScanner

Arguments

None

Return Value

Long

Most errors need to be intercepted by Catch ( ) in C++ or by On Error… in Visual Basic.

A busy condition returns an informational message.


ResetScanner Example [image] VB


ScannerAvailable Method

See Also	Example-VB	Example-VC++
Checks to see if any TWAIN-compatible software is available.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.ScannerAvailable

Return Value

Boolean

Setting	Description
True	Support for a TWAIN-compliant scanner is available
False	Support for a TWAIN-compliant scanner is not available
Remarks

This is done by checking the software (drivers and .dlls), not the hardware.


ScannerAvailable Example - VB
ScannerAvailable Example [image] VB

This example shows how to determine if TWAIN Scanning is available before you enable or disable scanning options within the application.

Private Sub Form_Load()

     If ImgScan1.ScannerAvailable Then

        mnuScanNew.Enabled = True

        mnuScanAppendPage.Enabled = True

        mnuScanInsertPage.Enabled = True

    'If ScannerAvailable returns false, disable scanner-related
    'menu options.

     Else

        mnuScanNew.Enabled = False

        mnuScanAppendPage.Enabled = False

        mnuScanInsertPage.Enabled = False

    End If

End Sub


ScannerAvailable Example - VC++
ScannerAvailable Example [image] VC++

This example shows how to determine if TWAIN Scanning is available before you enable or disable scanning options within the application.

void CNewscanDlg::OnEnablescanning()

{

    if(ImgScan1.ScannerAvailable())

        {

        m_mnuScanNewEnabled = TRUE;

        m_mnuScanAppendPageEnabled = TRUE;

        m_mnuScanInsertPageEnabled = TRUE;

        }

    // If ScannerAvailable returns False, disable scanner-related
    // menu options.

    else

        {

        m_mnuScanNewEnabled = FALSE;

        m_mnuScanAppendPageEnabled = FALSE;

        m_mnuScanInsertPageEnabled = FALSE;

        }

}


SetCustomData Method

See Also	Example-VB
Sets custom data source information.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Image Scan control

Syntax

object.SetCustomData(InfoLength, Data)

Arguments

Parameter	Data Type	Description
InfoLength	Long	Length of custom data source information
Data	VARIANT (TYPE VT_HANDLE)	Handle to custom data source information
Remarks

This method enables you to set various parameters that are supported by the selected data source. It is used in conjunction with the ShowScannerSetup method, which puts up a dialog box supplied by the data source.

Data associated with the parameter Data must have been retrieved from the same data source by means of the GetCustomData method.

This type of information is available with some data sources that adhere to the TWAIN 1.8 standard.


SetPageTypeCompressionOpts Method

See Also	Example-VB	Example-VC++
Sets all compression options, based on the input Image type.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98

Note: The ImageType, CompType and CompInfo parameters are ignored unless the CompPreference parameter 3 (Custom) is chosen. Each parameter, however, must have a value set.

Applies To

Image Scan control

Syntax

object.SetPageTypeCompressionOpts CompPreference,ImageType,CompType,CompInfo

Arguments

CompPreferenceConstants (Integer)

Constant	Setting	Description
BestDisplay	0 (default)	Best display quality
GoodDisplay	1	Good display quality, small file size
SmallestFile	2	Smallest file size
CustomSettings	3	Custom settings

ImageTypeConstants (Integer)

Constant	Setting	Description
BlackAndWhite1Bit	1	Black and white
Gray4Bit	2	16 shades of gray
Gray8Bit	3	256 shades of gray
ColorPal8Bit	4	256 colors
TrueColor24bitRGB	5	True color (RGB 24 bit)
ColorPal4Bit	6	16 Colors

CompTypeConstants (Integer)

Constant	Setting	Description
Uncompressed	0	uncompressed
CCITTGroup31D	1	CCITT Group 3 1D
CCITTGroup42D	2	CCITT Group 4 2D
TIFFPackbits	4	TIFF Packbits
JPEGCompression	8	JPEG
LZWCompression	21	LZW

CompInfoConstants (Integer)

Constant	Setting	Description
NoCompInfo	0	No compression information
G31DModifiedHuffman	4096	Group 3 1D Modified Huffman
G31DModifiedHuffmanRBO	0	Group 3 1D Modified Huffman with reversed bit order
G31DFax	6400	Group 3 1D Fax
G31DFaxRBO	2304	Group 3 1D Fax with reversed bit order
G42DFax	4608	Group 4 2D Fax
G42DFaxRBO	512	Group 4 2D Fax with reversed bit order
TIFFPackbitsInfo	0	TIFF Packbits (no compression information)
LZWInfo	0	LZW (no compression information)
JPEGLowLow	11610	JPEG low resolution, high quality
JPEGLowMed	7740	JPEG low resolution, medium quality
JPEGLowHigh	3870	JPEG low resolution, low quality
JPEGMedLow	27994	JPEG medium resolution, high quality
JPEGMedMed	24124	JPEG medium resolution, medium quality
JPEGMedHigh	20254	JPEG medium resolution, low quality
JPEGHighLow	-21158	JPEG high resolution, high quality
JPEGHighMed	-25028	JPEG high resolution, medium quality
JPEGHighHigh	-28898	JPEG high resolution, low quality
Returns

Integer

Possible return values are:

Value	Description
0	Success
1	Invalid compression preference
2	Invalid image type
3	Invalid compression type
4	Invalid compression info
Remarks

An error occurs when

  the Compression Preference is invalid.

  the Image Type is invalid.

  the Compression Type does not match the Image Type.

  the Compression Info does not match the Compression Type.

The relationship between Image Types, Compression Types, and Compression Info is shown below.

Black and White

Uncompressed

No compression information

CCITT Group 3 1D

Group 3 1D Modified Huffman
Group 3 1D Modified Huffman with reversed bit order
Group 3 1D Fax
Group 3 1D Fax with reversed bit order

TIFF Packbits

TIFF Packbits (no compression information)

16 Shades of Gray

Uncompressed

No compression information

LZW (Professional Edition only)

LZW (no compression information)

256 Shades of Gray

Uncompressed

No compression information

LZW (Professional Edition only)

LZW (no compression information)

JPEG

JPEG Low resolution, High quality
JPEG Low resolution, Medium quality
JPEG Low resolution, Low quality
JPEG Medium resolution, High quality
JPEG Medium resolution, Medium quality
JPEG Medium resolution, Low quality
JPEG High resolution, High quality
JPEG High resolution, Medium quality
JPEG High resolution, Low quality

256 Colors

Uncompressed

No compression information

LZW (Professional Edition only)

LZW (no compression information)

True Color (RGB 24-bit)

Uncompressed

No compression information

LZW (Professional Edition only)

LZW (no compression information)

JPEG

JPEG Low resolution, High quality
JPEG Low resolution, Medium quality
JPEG Low resolution, Low quality
JPEG Medium resolution, High quality
JPEG Medium resolution, Medium quality
JPEG Medium resolution, Low quality
JPEG High resolution, High quality
JPEG High resolution, Medium quality
JPEG High resolution, Low quality

16 Colors

Uncompressed

No compression information

LZW (Professional Edition only)

LZW (no compression information)


SetPageTypeCompressionOpts Example - VB
SetPageTypeCompressionOpts Example [image] VB

This example demonstrates how to set up several predefined compressions for black and white, grayscale and color image types.

Private Sub CmdSetCompression_Click()

    ImgScan1.SetPageTypeCompressionOpts CustomSettings, BlackAndWhite1Bit,
        CCITTGroup42D, G42DFaxRBO

    ImgScan1.SetPageTypeCompressionOpts CustomSettings, Gray8Bit,
        JPEGCompression, JPEGHighHigh

    ImgScan1.SetPageTypeCompressionOpts CustomSettings, TrueColor24bitRGB,
        LZWCompression, LZWInfo

End Sub


SetPageTypeCompressionOpts Example - VC++
SetPageTypeCompressionOpts Example [image] VC++

This example demonstrates how to set up several predefined compressions for black and white, grayscale and color image types.

void CNewscanDlg::OnSetcompression()

{

    ImgScan1.SetPageTypeCompressionOpts (3,1,2,512); //CustomSettings,
        BlackAndWhite1Bit, CCITTGroup42D, G42DFaxRBO;

    ImgScan1.SetPageTypeCompressionOpts (3,3,8,28898); //CustomSettings,
        Gray8Bit, JPEGCompression, JPEGHighHigh

    ImgScan1.SetPageTypeCompressionOpts (3,5,21,0); //CustomSettings,
        TrueColor24bitRGB, LZWCompression, LZWInfo

}


SetScanCapability Method

See Also	Example-VB	Example-VC++
Sets various scanner options, based on values retrieved by the GetScanCapability method.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image Scan control

Syntax

object.SetScanCapability Capability_ID,Capability_Value

Arguments

Parameter	Data Type	Description
Capability_ID	Integer	One of the scanner capabilities listed in the table below
Capability_Value	Variant	Sets the following capability values
Capability_ID Name	Description	Capability Value	Data Type
100 Image Type	Sets the Image Type	One of the following values: 1 - black and white 2 - grayscale 16 4 - grayscale 256 8 - color 256 palettized 16 - true color 24-bit RGB 32 - color 16-bit palettized	Integer
101 X Resolution	Sets the X Resolution. Use the Minimum Resolution, Maximum Resolution, and Resolution Step Capability Ids of the GetScanCapability  method to get valid values. Note: This capability also sets the Y resolution, symmetric with the X resolution. If you wish to set X and Y resolutions independently, you must first set the X resolution, and then the Y resolution.	A value between maximum and minimum resolution.	Long
102 Brightness Mode	Sets Brightness Mode to Normal or Automatic. If you set this value to 1 (Normal), you must also set a Brightness value.	One of the following values: 1 - Normal 2 - Automatic	Integer
103 Brightness	Sets the brightness when Brightness mode is 1 (Normal). Use the Minimum Brightness, Maximum Brightness, and Brightness Step Capability Ids of the GetScanCapability  method to obtain valid values.	A value between maximum and minimum brightness	Long
104 Contrast Mode	Sets Contrast Mode to Normal or Automatic. If you set this value to 1 (Normal), you must also set a Contrast value.	One of the following values: 1 - Normal 2 - Automatic	Integer
105 Contrast	Sets the contrast when Contrast mode is 1 (Normal). Use the Minimum Contrast, Maximum Contrast, and Contrast Step Capability Ids of the GetScanCapability  method to obtain valid values.	A value between maximum and minimum contrast.	Long
106 Image Layout	Sets four values (in inches) that define the image layout - Left, Top, Height, and Width. Use the Maximum Height and Maximum width capability Ids of the GetScanCapability  method to obtain valid values.	An array of 4 values (inches), set in the following order:    Left start of scan offset    Top start of scan offset    Width of scan    Height of scan	An array of Single values
107 Scan Mode	Sets the Scan Mode to Flatbed or ADF (Automatic Document Feeder).	One of the following values: 1 - Flatbed 2 - ADF	Short
109 Y Resolution	Sets the Y Resolution. Use the Minimum Resolution, Maximum Resolution, and Resolution Step Capability Ids of the GetScanCapability  method to get valid values. Note: This capability overrides the Y value set by the X Resolution Capability ID. If you wish to set X and Y resolutions independently, you must first set the X resolution, and then the Y resolution.	A value between maximum and minimum resolution	Long
110 Duplex scanning	Defines the current state of duplex scanning.	True – Enable duplex scanning False – Disable duplex scanning	Boolean
111 Data Source Progress Indicator	Defines the state of the TWAIN Data Source progress indicator in use. This capability is valid only when the ShowSetupBeforeScan property is False.	True – Enable Data Source progress indicator. False – Disable Data Source progress indicator. It will not be shown if the ShowSetupBeforeScan property is False.	Boolean
114 Set TWAIN Transfer Mode	Set the transfer mode to Native or Memory. Native mode is faster but requires more memory. Memory mode requires less memory but is not as efficient.	One of the following values: 1 – (default) Native mode 2 – Memory mode	Short
117 Threshold	Define the Threshold level. Use Minimum Threshold, Threshold Contrast, and Threshold Step to set valid values.	Threshold increments between maximum and minimum	Long
Returns

Long

Possible return values are:

Value	Description
0	Success
3	Bad capability
4	Invalid array passed in. Possible problems are: - must be an array of floats - must be a one dimensional array - failed call - must have a lower limit of 0 (zero) - must have an upper limit of 4
5	Bad data value
Remarks

Before you set a capability, you should call the GetScanCapability method.

The scanner must be open when this call is made, or an error is returned.

If a capability is not supported, a VT_Error is returned.


SetScanCapability Example - VB
SetScanCapability Example [image] VB

This example accepts four values from the user to specify the left start, top start, width and height of the area to be scanned in inches. Values are passed via SetScanCapability, which would scan the area specified without displaying the TWAIN UI.

Private Sub CmdSetLayout_Click()

    Const CAP_SCAN_IMAGE_LAYOUT = 106

    Const CAP_SCAN_IMAGE_HEIGHT = 3

    Const CAP_SCAN_IMAGE_WIDTH = 4

    Dim varScanWidth, varScanHeight As Variant

    'Open scanner for capability check.

    ImgScan1.OpenScanner

    'Determine what width and height the scanner can support.

    varScanWidth = ImgScan1.GetScanCapability(CAP_SCAN_IMAGE_WIDTH)

    If VarType(varScanWidth) = vbError Then

        MsgBox "Unable to get maximum width"

    End If

    varScanHeight = ImgScan1.GetScanCapability(CAP_SCAN_IMAGE_HEIGHT)

    If VarType(varScanHeight) = vbError Then

        MsgBox "Unable to get maximum height"

    End If

    'The user enters width and height values in a dialog box.

    Dim sngLayout(4) As Single

        sngLayout(0) = CSng(Text1.Text)  'left start

        sngLayout(1) = CSng(Text2.Text)  'top start

        sngLayout(2) = CSng(Text3.Text)  'width

        sngLayout(3) = CSng(Text4.Text)  'height

    'Validate values the user entered before trying to set them.

    If sngLayout(0) + sngLayout(2) > varScanWidth Then

        MsgBox "Too Wide"

        Exit Sub

    End If

    If sngLayout(1) + sngLayout(3) > varScanHeight Then

        MsgBox "Too Long"

        Exit Sub

    End If

    ImgScan1.SetScanCapability CAP_SCAN_IMAGE_LAYOUT, sngLayout

End Sub


SetScanCapability Example - VC++
SetScanCapability Example [image] VC++

This example accepts four values from the user to specify the left start, top start, width and height of the area to be scanned in inches. Values are passed via SetScanCapability, which would scan the area specified without displaying the TWAIN UI.

void CNewscanDlg::OnLayout()

{

    #define CAP_SCAN_IMAGE_LAYOUT  106

    #define CAP_SCAN_IMAGE_HEIGHT  3

    #define CAP_SCAN_IMAGE_WIDTH  4

    VARIANT vScanWidth, vScanHeight;

    // Open scanner for capability check.

    ImgScan1.OpenScanner();

    // Determine what width and height the scanner can support.

    vScanWidth = ImgScan1.GetScanCapability(CAP_SCAN_IMAGE_WIDTH);

    if(V_VT(&vScanWidth) == VT_ERROR)

        {

        AfxMessageBox ("Unable to get maximum width");

        }

    vScanHeight = ImgScan1.GetScanCapability(CAP_SCAN_IMAGE_HEIGHT);

    if(V_VT(&vScanHeight) == VT_ERROR)

        {

        AfxMessageBox("Unable to get maximum height");

        }

    // The user enters width and height values in a dialog box.

    VARIANT sngLayout[4];

    V_VT(&sngLayout[0]) = VT_R4;  // left start
    V_VT(&sngLayout[1]) = VT_R4;  // top start
    V_VT(&sngLayout[2]) = VT_R4; // width
    V_VT(&sngLayout[3]) = VT_R4; // height
    V_R4(&sngLayout[0]) = 10;  // left start
    V_R4(&sngLayout[1]) = 20;  // top start
    V_R4(&sngLayout[2]) = 400; // width
    V_R4(&sngLayout[3]) = 410; // height

    COleSafeArray  sa;
    sa.CreateOneDim(VT_R4,4,&sngLayout);

    // Validate values the user entered before trying to set them.

    if (V_R4(&sngLayout[0]) + V_R4(&sngLayout[2]) > V_I4(&vScanWidth))
        AfxMessageBox ("Too Wide");

    if (V_R4(&sngLayout[1]) + V_R4(&sngLayout[3]) > V_I4(&vScanHeight))
        AfxMessageBox("Too Long");

    ImgScan1.SetScanCapability (CAP_SCAN_IMAGE_LAYOUT, sa);

}


ShowScanNew Method

See Also	Example-VB	Example-VC++
Displays the Scan New dialog box from which the user can change options and before scanning.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.ShowScanNew[={True|False}]

Arguments

Boolean (optional)

Variant

Setting	Description
True (default)	Modal dialog.
False	Modeless dialog.
Return Value

Long

Most errors need to be intercepted by Catch ( ) in C++ or by On Error... in Visual Basic.

A busy condition or cancel returns an informational message.

Remarks

Provides an interactive method to change scanning options before starting a session.

If you specify a modeless dialog box (Modal = False), the user will not be able to navigate using the keyboard.

The scanner will be opened (if it is not already) and closed again at the end of the scanning session.


ShowScanNew Example - VB
ShowScanNew Example [image] VB

This example illustrates one technique for scanning a new file.

Private Sub cmdScanNew_Click()

    'Use the Admin Control's Save As dialog box to allow the
    'user to specify a filename for the new file.

    ImgAdmin1.ShowFileDialog SaveDlg

    'Set the Scan control's Image property to the new filename.

    ImgScan1.Image = ImgAdmin1.Image

    'Scan a new file using the Scan New Dialog box.

    'Note: You do not need to set the Image property before you
    'call the dialog box. It may be set in the dialog box if desired.

    ImgScan1.ShowScanNew

End Sub


ShowScanNew Example - VC++
ShowScanNew Example [image] VC++

This example illustrates one technique for scanning a new file.

void CNewscanDlg::OnScannew()

{

    // Using the Admin Control Save As dialog box to allow user
    // to specify a filename for the new file.

    VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

    V_I4(&vhWnd) = (long)m_hWnd;

    ImgAdmin1.ShowFileDialog (1,vhWnd);      //SaveDlg

    // Set the Scan control's image property to the new filename.

    ImgScan1.SetImage (ImgAdmin1.GetImage());

    // Scan a new file using the Scan New Dialog box

    // Note: You do not need to set the Image property before you
    // call the dialog box. It may be set in the dialog box if desired.

    VARIANT vModal; V_VT(&vModal) = VT_BOOL;

    V_BOOL(&vModal) = TRUE;

    ImgScan1.ShowScanNew(vModal);

}

void CNewscanDlg::OnFileNameRequestScanctrl1(long PageNumber)

{

    if(PageNumber > m_iPagesPerFile)

        // intPageCount will be used to sequentially increment file names

        m_iPageCount++;

    // Filename is comprised of 4 digit month/day and 4 digit sequential number

    CString  szName;

    szName.Format("D:\\image2\\%n",m_iPageCount);

    szName += ".tif";

    ImgScan1.SetImage (szName);

}


ShowScanPage Method

See Also	Example-VB	Example-VC++
Displays the Scan Page dialog box from which you can change options before scanning.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.ShowScanPage[={True|False}]

Arguments

Boolean (optional)

Variant

Setting	Description
True (default)	Modal dialog.
False	Modeless dialog.
Return Value

Long

Most errors need to be intercepted by Catch ( ) in C++ or by On Error... in Visual Basic.

A busy condition or cancel returns an informational message.

Remarks

This method is used to Insert, Append, or Overwrite pages in an existing image file while scanning.

If you specify a modeless dialog box (Modal = False), the user will not be able to navigate using the keyboard.

The scanner will be opened (if it is not already) and closed again at the end of the scanning session.


ShowScanPage Example - VB
ShowScanPage Example [image] VB

This example shows how to insert a scanned page before page 1 of an existing image.

Private Sub cmdInsert_Click()

     'Use the ImgAdmin control to select a file for display
     'in the ImgEdit control.

     ImgAdmin1.ShowFileDialog OpenDlg  '0

     ImgEdit1.Image = ImgAdmin1.Image

     ImgEdit1.Display

     'For insert or append, set the Scan control's
     'Image property.

     ImgScan1.Image = ImgAdmin1.Image

     'MultiPage property must be set to True in order to
     'create files with more than one page.

     ImgScan1.MultiPage = True

     ImgScan1.PageOption = InsertPages '3

     ImgScan1.Page = 1

     ImgScan1.FileType = TIFF '1

     'Scan using the Scan Page dialog box.

     ImgScan1.ShowScanPage

End Sub


ShowScanPage Example - VC++
ShowScanPage Example [image] VC++

This example shows how to insert a scanned page before page 1 of an existing image file.

void CNewscanDlg::OnInsertpage()

{

     // This example shows how to insert a scanned page before
     // page 1 of an existing image.

     // Use the ImgAdmin control to select a file for display
     // in the ImgEdit control.

     VARIANT vhWnd; V_VT(&vhWnd) =  VT_I4;

     V_I4(&vhWnd) = (long)m_hWnd;

     ImgAdmin1.ShowFileDialog(0,vhWnd); // OpenDlg  // 0

     // Check to see if cancel was pressed...

     ImgEdit1.SetImage(ImgAdmin1.GetImage());

     ImgEdit1.Display();

     // For insert or append, set the Scan control's
     // Image property.

     ImgScan1.SetImage(ImgAdmin1.GetImage());

     // Multipage must be set to True in order to create
     // files with more than one page.

     ImgScan1.SetMultiPage(TRUE);

     ImgScan1.SetPageOption(3);  //InsertPages '3

     ImgScan1.SetPage (1);

     ImgScan1.SetFileType(1); // TIFF '1

     // Scan using the Scan Page dialog box.

     VARIANT vModal; V_VT(&vModal) = VT_BOOL;

     V_BOOL(&vModal) = TRUE;

     ImgScan1.ShowScanPage(vModal);

}


ShowScanPreferences Method

See Also	Example-VB
Sets compression preferences for scanning.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.ShowScanPreferences

Arguments

None

Return Value

Long

Most errors need to be intercepted by Catch ( ) in C++ or by On Error... in Visual Basic.

A busy condition returns an informational message.

Remarks

Displays a dialog box with a list of available compression options.

You can select a custom option that displays a dialog box with a detailed list of compression preferences.

The Advanced button on the dialog box created by the ShowScanPreferences method presents a choice between two transfer modes [image] Native and Memory. Users can switch between these modes to see which gives the best performance with their scanner driver. You (the developer) cannot set this mode programmatically.

Note: In Native mode, some scanners (such as the Hewlett Packard Scan II C and the Fujitsu 3093 DG) scan the images inverted. To correct this, set the Invert enhancement.


ShowScanPreferences Example [image] VB


ShowScannerSetup Method

See Also	Example-VB
Displays the setup dialog box provided by the TWAIN driver.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Image Scan control

Syntax

object.ShowScannerSetup

Arguments

None

Return Value

Long

Most errors need to be intercepted by Catch ( ) in C++ or by On Error… in Visual Basic.

A busy condition returns an informational message.

Remarks

The method displays the data source's user interface without performing a scan.

This method uses the DG_CONTROL/DAT_USERINTERFACE/
MSG_ENABLEDSUIONLY triplet documented in the TWAIN 1.8 specification. If this feature is not supported by the data source, the error IMGSE_NOT_SUPPORTED is thrown.


ShowSelectScanner Method

See Also	Example-VB
Displays a dialog box that shows the installed TWAIN devices. The user selects a device from this list.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.ShowSelectScanner

Arguments

None

Return Value

Long

Most errors need to be intercepted by Catch ( ) in C++ or by On Error… in Visual Basic.

A busy condition or cancel returns an informational message.


ShowSelectScanner Example [image] VB


StartScan Method

See Also	Example-VB	Example-VC++
Starts the scanning process.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.StartScan

Arguments

None

Return Value

Long

Most errors need to be intercepted by Catch ( ) in C++ or by On Error… in Visual Basic.

A busy condition or cancel returns an informational message.

Remarks

If the scanner is closed, it will be opened and closed again at the end of the scanning process.


StartScan Example - VB
StartScan Example [image] VB

This code segment shows how to scan all the pages in the scanner's automatic document feeder (ADF) to a multipage file using a file template. The example creates three image pages and names them using the prefix "img" (for example, img0001.tif, img0002.tif).

Private Sub CmdTemplate_Click()

    ImgScan1.ScanTo = UseFileTemplateOnly '4

    'Set the image property to a template name.

    ImgScan1.Image = "C:\image2\img"

    'MultiPage property must be set to true in order to create
    'files with more than one page.

    ImgScan1.MultiPage = True

    'Create 3 page image files.

    ImgScan1.PageCount = 3

    'Do not show the scanner's TWAIN UI.

    ImgScan1.ShowSetupBeforeScan = False

    'Scan without using dialog box.

    ImgScan1.StartScan

End Sub


StartScan Example - VC++
StartScan Example [image] VC++

This code segment shows how to scan all the pages in the scanner's automatic document feeder (ADF) to a multipage file using a file template. The example creates three image pages and names them using the prefix "img" (for example, img0001.tif, img0002.tif).

void CNewscanDlg::OnTemplate()

{

    ImgScan1.SetScanTo (4);  // UseFileTemplateOnly // 4

    // Set the image property to a template name.

    ImgScan1.SetImage ("D:\\image2\\img");

    // Multipage must be true in order to create files with
    // more than one page.

    ImgScan1.SetMultiPage(TRUE);

    // Create 3 page image files.

    ImgScan1.SetPageCount(3);

    // Do not show the scanner's TWAIN UI.

    ImgScan1.SetShowSetupBeforeScan(FALSE);

    // Scan without using dialog box.

    ImgScan1.StartScan();

}


StopScan Method

See Also	Example-VB
Stops a scanning operation in progress.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

object.StopScan

Arguments

None

Return Value

Long

Most errors need to be intercepted by Catch ( ) in C++ or by On Error... in Visual Basic.

A busy condition returns an informational message.

Remarks

The scan operation will stop on the page that is currently being scanned. Cleanup, including clearing paper and buffers, will be performed.


StopScan Example [image] VB


FileNameRequest Event

See Also	Example-VB
A batch feature used to signal that the image is about to be filed. The application event can then set the Image property to change the filename.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image Scan control

Syntax

Sub object_FileNameRequest

Remarks

This event is fired after each page has been scanned, but before it is compressed and filed.

The ScanTo property must be set to "Batch" (display on or off).

Argument

Long

Integer page number of the current file.


PageDone Event

See Also	Example-VB
Signals the completion of each scanned page.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

Sub object_PageDone

Remarks

This event is triggered after a page is scanned.

Argument

Long

Passes the Number of the page just scanned.


PageDone Example [image] VB


ScanDone Event

See Also	Example-VB
Signals the end of a scanning operation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

Sub object_ScanDone

Remarks

This event is triggered immediately after a scanning operation is completed. Whether the operation completes successfully, or generates an error, the event is fired.


ScanDone Example [image] VB


ScanStarted Event

See Also	Example-VB
Signals the start of a scanning operation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Scan control

Syntax

Sub object_ScanStarted

Remarks

This event is triggered just before the first image page is transfered to the control.


ScanStarted Example [image] VB


ScanUIDone Event

See Also	Example-VB
Signals that the TWAIN user interface is about to come down.

Applies To

Image Scan control

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
Syntax

Sub object_ScanUIDone

Remarks

Enables an application to re-activate its main window after the scan has been performed. Otherwise, if the main window is activated immediately after a call to the StartScan method, it may lose its focus and another open window will be displayed on top of it.


ScanUIDone Example [image] VB


When you scan to a template (ScanTo property set to 3 or 4), the PageCount and MultiPage
properties interact. The following table shows what happens when you set these properties to different
values. All scenarios begin with 20 pages in the scanner’s automatic document feeder.

Settings	Results
PageCount = 5 MultiPage = True	All 20 pages are scanned [image] 4 image files are created, and each file contains 5 pages.
PageCount = 5 MultiPage = False	5 pages are scanned [image] 5 image files are created, and each file contains 1 page.
PageCount = 0 MultiPage = True	All 20 pages are scanned [image] 1 image file is created, which contains 20 pages.
PageCount = 0 MultiPage = False	All 20 pages are scanned [image] 20 image files are created, and each file contains 1 page.


When you scan to a file (ScanTo property set to 1 or 2) and set
MultiPage to True, PageCount determines how many images can be
scanned to a single file.

When you scan to a file and set MultiPage to False, a single document
is scanned, regardless of the value set in PageCount.


Image Thumbnail Control

See Also	Properties	Methods	Events
What the Image Thumbnail control lets you do

The Image Thumbnail control lets you [image] the application developer [image] add thumbnail display and management functions to applications that support 32-bit ActiveX controls.

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 the end user specifies 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 Image Admin control to add or delete pages in the image file.

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

What the Image Thumbnail control lets your users do

Depending on how you design and code your application, the Image Thumbnail control lets your users view thumbnail images, format the appearance of the control, and perform other functions, such as displaying or deleting image pages represented by the thumbnail images.

Prerequisites

You must include at least one Image Admin control and Image Edit control in your application if you want to permit end users to display and manipulate image documents using the Image Thumbnail control.

If your project is going to use 1.x documents, the Image Admin control must be included, and the Admin FileStgLoc1x property set appropriately. You can also use the Admin control ForceFileLinking1x property with 1.x documents, if appropriate.


Extender Properties (Image Thumbnail)
Image Thumbnail Extender Properties

See Also	Example
This topic lists the Extender properties that are available when the Image Thumbnail control is drawn on a Visual Basic form.

Name	Description
Container	Returns the container of an object
DataBindings	Returns the DataBindings collection object containing the available bindable properties
DataChanged	Returns or sets a value indicating that data in the bound control has changed
DateField	Returns or sets a value that binds a control to a field.
DragIcon	Returns or sets the mouse pointer icon in a drag-and-drop operation
DragMode	Returns or sets the drag mode (manual or automatic)
Height	Returns or sets the height of an object
HelpContextID	Returns or sets the Help context ID for an object
Index	Returns or sets the subscript value of a control in an array of controls
Left	Returns or sets the distance between the left edge of an object and the left edge of its container
Name	Returns the name of an object
Object	Returns a reference to a property or method of a control that has the same name as a property or method extended to the control
Parent	Returns the form, object, or collection that contains either a control, or another object or collection
TabIndex	Returns or sets the tab order of an object within its parent
TabStop	Returns or sets whether the Tab key can be used to move focus to an object
Tag	Returns or sets ancillary data
ToolTipText	Returns or sets a ToolTip
Top	Returns or sets the distance between the top edge of an object and the top edge of its container
Visible	Returns or sets whether an object is visible or hidden
WhatsThisHelpID	Returns or sets the context-sensitive help ID for an object
Width	Returns or sets the width of an object
Refer to the Visual Basic on-line help for more information about these properties.


Extender Methods (Image Thumbnail)
Image Thumbnail Extender Methods

See Also	Example
This topic lists the Extender methods that are available when the Image Thumbnail control is drawn on a Visual Basic form.

Name	Description
Drag	Begins, ends, or cancels a drag operation
Move	Moves an object
SetFocus	Gives focus to the object specified
ShowWhatsThis	Displays the help topic corresponding to the value of the WhatsThisHelpID property
Zorder	Places an object at the front or back of the z-order within its graphical level
Refer to the Visual Basic on-line help for more information about these methods.


Extender Events (Image Thumbnail)
Image Thumbnail Extender Events

See Also	Example
This topic lists the Extender events that are available when the Image Thumbnail control is drawn on a Visual Basic form.

Name	Description
DragDrop	Fires when a drag-and-drop operation is completed
DragOver	Fires when a drag-and-drop operation is in progress
Error	Fires when an error occurs
GotFocus	Fires when an object receives focus
KeyDown	Fires when a user presses a key while the object has focus
KeyUp	Fires when a user releases a key while the object has focus
LostFocus	Fires when an object loses focus
Refer to the Visual Basic on-line help for more information about these events.


AutoSelect Property

See Also	Example-VB
Returns or sets whether the thumbnail control or the application selects thumbnails.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Thumbnail control

Syntax

object.AutoSelect[={True|False}]

Data Type

Boolean

Setting	Description
True	Thumbnail control selects thumbnails
False(default)	Calling application selects thumbnails


AutoSelect Example [image] VB

This example shows how to set the highlight color for selected thumbnail boxes using the Common Color dialog.

Private Sub mnuHighLightColor_Click()

    On Error GoTo ErrColor

    'Thumbnails must be selected programmatically

    ImgThumbnail1.AutoSelect = False

    'Properties for the Common color dialog

    CommonDialog1.CancelError = True

    CommonDialog1.Flags = cdlCCRGBInit Or cdlCCPreventFullOpen

    CommonDialog1.ShowColor

    ImgThumbnail1.HighlightColor = CommonDialog1.Color

    'Show first thumb highlighted

    If ImgThumbnail1.ThumbCount > 0 Then ImgThumbnail1.ThumbSelected(1) = True

    ImgThumbnail1.HighlightSelectedThumbs = True

    Exit Sub

ErrColor:

    MsgBox Err.Description, , "Set Colors"

    Exit Sub

End Sub


AutoSelect Example [image] VC++


BackColor Property

See Also	Example-VB
Returns or sets the background color of the entire control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Thumbnail control

Syntax

object.BackColor[=color]

Data Type

Long

Remarks

Use the RGB format. The default value is light gray [image] RGB (192, 192, 192).

The color specified should be different from the color set by the HighlightColor property so that 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.


BackColor Example [image] VB

This example shows how to set the control color using the Common Color dialog.

Private Sub mnuControlColor_Click()

    On Error GoTo ErrColor

    'Properties for the Common color dialog

    CommonDialog1.CancelError = True

    CommonDialog1.Flags = cdlCCRGBInit Or cdlCCPreventFullOpen

    CommonDialog1.ShowColor

    ImgThumbnail1.BackColor = CommonDialog1.Color

    Exit Sub

ErrColor:

    MsgBox Err.Description, , "Set Colors"

    Exit Sub

End Sub


BackColor Example/VC++


BorderStyle Property

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

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


BorderStyle Example [image] VB


BorderStyle Example/VC++


DropFailed Property

See Also	Example-VB
Sets a value to indicate the thumbnail drop operation failed.

Available With

√	Imaging for Windows Professional Edition V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Thumbnail control

Syntax

object.DropFailed[={True|False}]

Data Type

Boolean

Setting	Description
True (default)	Thumbnail drop operation succeeded
False	Thumbnail drop operation failed


DropFailed Example [image] VB

This example demonstrates how the Thumbnail control can be updated when images are dropped onto it. A message box is displayed detailing the source file and pages as well as the insertion thumbnail for each thumbnail droppped onto the control. The source can be a drop from Explorer, Imaging for Windows, or selected thumbnails from another Thumbnail control.

For this example, the EnableDragDrop property has been set to DropFileDropDragLeftRight. The property must have been set prior to performing any drag or drop operation.

Private Sub ImgThumbnail1_ThumbDrop(ByVal InsertBefore As Long, ByVal DropCount As Long, ByVal Shift As Integer)

    Dim DropMsg As String

    On Error GoTo DropError

    'Loop to process each thumb being dropped; index starts at 0

    For InsertCount = 0 To DropCount - 1

        srcFile = ImgThumbnail1.ThumbDropNames(InsertCount)

        srcPage = ImgThumbnail1.ThumbDropPages(InsertCount)

        'Insert page into image file first, then Thumbnail control

        ImgAdmin1.Insert srcFile, srcPage, InsertBefore, 1
       'Image file saved after insert

        ImgThumbnail1.InsertThumbs InsertBefore, 1

        'Provide information regarding dropped page

        DropMsg = "Page " & Str(srcPage) & " from " & srcFile & " was
            inserted before page " & Str(InsertBefore)

        MsgBox DropMsg, , "Drop Page"

    Next InsertCount

    Exit Sub

DropError:

    ImgThumbnail1.DropFailed = True

    MsgBox Err.Description, , "Drop Error"

End Sub


EnableDragDrop Property

See Also	Example-VB
Indicates the drop type allowed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Thumbnail control

Syntax

object.EnableDragDrop

Data Type

Long

Constant	Setting	Description
NoDragDrop	0 (default)	Drag and drop is not allowed
DragLeft	1	Drag from the control using the left mouse button is allowed
DragRight	2	Drag from the control using the right mouse button is allowed
DragLeftRight	3	Drag from the control using the left and right mouse buttons is allowed
Drop	4	Drop into the control is allowed
DropDragLeft	5	Drop into the control is allowed/ Drag from the control using the left mouse button is allowed
DropDragRight	6	Drop into the control is allowed/ Drag from the control using the right mouse button is allowed
DropDragLeftRight	7	Drop into the control is allowed/ Drag from the control using the left and right mouse buttons is allowed
DropFiles	8	Drop image files into the control is allowed
DropFilesDragLeft	9	Drop image files into the control is allowed/Drag from the control using the left mouse button is allowed
DropFilesDragRight	10	Drop image files into the control is allowed/Drag from the control using the right mouse button is allowed
DropFilesDragLeftRight	11	Drop image files into the control is allowed/Drag from the control using the left and right mouse buttons is allowed
DropFilesDrop	12	Drop into the control is allowed/ Drop image files into the control is allowed
DropFilesDropDragLeft	13	Drop into the control is allowed/ Drop image files into the control is allowed/Drag from the control using the left mouse button is allowed
DropFilesDropDragRight	14	Drop into the control is allowed/ Drop image files into the control is allowed/Drag from the control using the right mouse button is allowed
DropFilesDropDragLeftRight	15	Drop into the control is allowed/ Drop image files into the control is allowed/Drag from the control using the left and right mouse buttons is allowed
Remarks

Settings can be combined in bit-wise combinations.

Drops are not accepted until the Image property has been set.


EnableDragDrop Example [image] VB

This example demonstrates how the Thumbnail control can be updated when images are dropped onto it. A message box is displayed detailing the source file and pages as well as the insertion thumbnail for each thumbnail droppped onto the control. The source can be a drop from Explorer, Imaging for Windows, or selected thumbnails from another Thumbnail control.

For this example, the EnableDragDrop property has been set to DropFileDropDragLeftRight. The property must have been set prior to performing any drag or drop operation.

Private Sub ImgThumbnail1_ThumbDrop(ByVal InsertBefore As Long, ByVal DropCount As Long, ByVal Shift As Integer)

    Dim DropMsg As String

    On Error GoTo DropError

    'Loop to process each thumb being dropped; index starts at 0

    For InsertCount = 0 To DropCount - 1

        srcFile = ImgThumbnail1.ThumbDropNames(InsertCount)

        srcPage = ImgThumbnail1.ThumbDropPages(InsertCount)

        'Insert page into image file first, then Thumbnail control

        ImgAdmin1.Insert srcFile, srcPage, InsertBefore, 1
       'Image file saved after insert

        ImgThumbnail1.InsertThumbs InsertBefore, 1

        'Provide information regarding dropped page

        DropMsg = "Page " & Str(srcPage) & " from " & srcFile & " was
            inserted before page " & Str(InsertBefore)

        MsgBox DropMsg, , "Drop Page"

    Next InsertCount

    Exit Sub

DropError:

    ImgThumbnail1.DropFailed = True

    MsgBox Err.Description, , "Drop Error"

End Sub


FirstSelectedThumb Property

See Also	Example-VB
Returns the page number of the first selected thumbnail.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Thumbnail control

Syntax

object.FirstSelectedThumb

Data Type

Long

Remarks

Available at run-time as read-only.

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

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


FirstSelectedThumb Example [image] VB

This example demonstrates how to delete all the currently selected thumbnails. It deletes them one at a time, deleting the page from the source first.

Private Sub cmdDelete_Click()

    Dim iPagesDeleted As Integer

    Dim ThumbsToDelete, ThumbCount As Integer

    iPagesDeleted = 0

    ThumbsToDelete = ImgThumbnail1.SelectedThumbCount  'Get # of selected thumbnails

    TotalThumbs = ImgThumbnail1.ThumbCount

    On Error GoTo ErrDelete

        'Loop until a selected thumbnail is encountered - delete it. Must
        'reset the loop because the thumbcount has changed as well as the
        'index of the next selected thumbnail.

        For i = ImgThumbnail1.LastSelectedThumb To
            ImgThumbnail1.FirstSelectedThumb Step -1

            If ImgThumbnail1.ThumbSelected(i) = True Then

                ImgAdmin1.DeletePages i, 1  'Must delete pages from
                                            'image file first

                ImgThumbnail1.DeleteThumbs i, 1

                iPagesDeleted = iPagesDeleted + 1

            End If

        Next i

        'Display a message regarding the status of the delete attempt

        If iPagesDeleted <> ThumbsToDelete Then

            MsgBox "Error deleting pages - " &
                Str(ImgThumbnail1.StatusCode), , "Thumbnail"

        Else

            MsgBox (Str(ThumbsToDelete) & " of " & Str(TotalThumbs) & " were deleted.")

        End If

    Exit Sub

ErrDelete:

    MsgBox Err.Description, , "Thumbnail"

    Exit Sub

End Sub


HighlightColor Property

See Also	Example-VB
Returns or sets the color of the highlight that is applied to selected thumbnail boxes.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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. The default value is black [image] 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.


HighlightColor Example [image] VB

This example shows how to set the highlight color for selected thumbnail boxes using the Common Color dialog.

Private Sub mnuHighLightColor_Click()

    On Error GoTo ErrColor

    'Thumbnails must be selected programmatically

    ImgThumbnail1.AutoSelect = False

    'Properties for the Common color dialog

    CommonDialog1.CancelError = True

    CommonDialog1.Flags = cdlCCRGBInit Or cdlCCPreventFullOpen

    CommonDialog1.ShowColor

    ImgThumbnail1.HighlightColor = CommonDialog1.Color

    'Show first thumb highlighted

    If ImgThumbnail1.ThumbCount > 0 Then ImgThumbnail1.ThumbSelected(1) = True

    ImgThumbnail1.HighlightSelectedThumbs = True

    Exit Sub

ErrColor:

    MsgBox Err.Description, , "Set Colors"

    Exit Sub

End Sub


HighlightSelectedThumbs Property

See Also	Example-VB
Returns or sets whether a highlight will be displayed around selected thumbnails.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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


HighlightSelectedThumbs Example [image] VB

This example shows how to set the highlight color for selected thumbnail boxes using the Common Color dialog.

Private Sub mnuHighLightColor_Click()

    On Error GoTo ErrColor

    'Thumbnails must be selected programmatically

    ImgThumbnail1.AutoSelect = False

    'Properties for the Common color dialog

    CommonDialog1.CancelError = True

    CommonDialog1.Flags = cdlCCRGBInit Or cdlCCPreventFullOpen

    CommonDialog1.ShowColor

    ImgThumbnail1.HighlightColor = CommonDialog1.Color

    'Show first thumb highlighted

    If ImgThumbnail1.ThumbCount > 0 Then ImgThumbnail1.ThumbSelected(1) = True

    ImgThumbnail1.HighlightSelectedThumbs = True

    Exit Sub

ErrColor:

    MsgBox Err.Description, , "Set Colors"

    Exit Sub

End Sub


Image Property (Thumbnail control)
Image Property

See Also	Example-VB
Returns or sets the filename of the image file/document for which thumbnails are displayed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 (zero).

FirstSelectedThumb property value is reset to 0 (zero).

LastSelectedThumb property value is reset to 0 (zero).

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.


Image Example [image] VB

This example demonstrates how various images can be specifed by the Image property. It also shows how specific pages within the document can be designated for OCRing by the Pages property.

Private Sub SetImage_Click()

    'Showing syntax to display thumbnails of a 1.x Server document
    'Note: prefix Image:// denotes service name for 1.x server

    ImgThumbnail1.Image = "Image://srvrname\volname:\CAB\DRAWER\FOLDER\YOUR DOC"

    'Showing syntax to display thumbnails of a 1.x Server filename

    ImgThumbnail1.Image = "Image://srvrname/volname:/dirname/temp.tif"

    'Showing syntax to display thumbnails of an Enterprise Imaging Server
    'document Note: prefix Imagex:// denotes service name for an
    'Enterprise Imaging server

    ImgThumbnail1.Image = "Imagex://Docid1234"

    'Showing syntax to display thumbnails of a an internet image via URL

    ImgThumbnail1.Image = "http://www.eastmansoftware.com/sbu/sampimg.tif"

    'Showing syntax to display thumbnails of a UNC filename

    ImgThumbnail1.Image = "\\srvrname\shared3\images\bw\thisisa.tif"

End Sub


LastSelectedThumb Property

See Also	Example-VB
Returns the page number of the last selected thumbnail.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Thumbnail control

Syntax

object.LastSelectedThumb

Data Type

Long

Remarks

Available at run-time as read-only.

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

A value of 0 indicates there are no thumbnails selected.


LastSelectedThumb Example [image] VB

This example demonstrates how to delete all the currently selected thumbnails. It deletes them one at a time, deleting the page from the source first.

Private Sub cmdDelete_Click()

    Dim iPagesDeleted As Integer

    Dim ThumbsToDelete, ThumbCount As Integer

    iPagesDeleted = 0

    ThumbsToDelete = ImgThumbnail1.SelectedThumbCount  'Get # of selected thumbnails

    TotalThumbs = ImgThumbnail1.ThumbCount

    On Error GoTo ErrDelete

        'Loop until a selected thumbnail is encountered - delete it. Must
        'reset the loop because the thumbcount has changed as well as the
        'index of the next selected thumbnail.

        For i = ImgThumbnail1.LastSelectedThumb To
            ImgThumbnail1.FirstSelectedThumb Step -1

            If ImgThumbnail1.ThumbSelected(i) = True Then

                ImgAdmin1.DeletePages i, 1  'Must delete pages from
                                            'image file first

                ImgThumbnail1.DeleteThumbs i, 1

                iPagesDeleted = iPagesDeleted + 1

            End If

        Next i

        'Display a message regarding the status of the delete attempt

        If iPagesDeleted <> ThumbsToDelete Then

            MsgBox "Error deleting pages - " &
                Str(ImgThumbnail1.StatusCode), , "Thumbnail"

        Else

            MsgBox (Str(ThumbsToDelete) & " of " & Str(TotalThumbs) & " were deleted.")

        End If

    Exit Sub

ErrDelete:

    MsgBox Err.Description, , "Thumbnail"

    Exit Sub

End Sub


MouseIcon Property

See Also	Example-VB
Returns or sets the cursor displayed when a custom MousePointer is used.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Thumbnail control

Syntax

object.MouseIcon[=Picture]

Data Type

Picture

Remarks

Only ICO and CUR file types are supported.


MouseIcon Example [image] VB

This example shows how to set a custom mouse pointer for the control.

Private Sub cmdChangeMouse_Click()

   Dim strMIcon As String

    strMIcon = "C:\Program Files\DevStudio\VB\samples\PGuide\Optimize\Litening.ico"

    ImgThumbnail1.MouseIcon = LoadPicture(strMIcon)

    ImgThumbnail1.MousePointer = wiMPCustom  'Custom pointer = 99

End Sub


MousePointer Property

See Also	Example-VB
Returns or sets the type of mouse cursor displayed when the cursor is positioned over the control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Thumbnail control

Syntax

object.MousePointer[=integer]

Data Type

Integer (enumerated)

Constant	Setting	Description
Default	0 (Default)	For this control, the default is Arrow
Arrow	1	Arrow
Cross	2	Cross (cross-hair pointer)
I-Beam	3	I-Beam
Icon	4	Arrow
wSize	5	Size (four-pointed arrow pointing North, South, East, and West)
SizeNESW	6	Size NE SW (double arrow pointing NorthEast and SouthWest)
SizeNS	7	Size N S (double arrow pointing North and South)
SizeNWSE	8	Size NW SE (double arrow pointing NorthWest and SouthEast)
SizeWE	9	Size W E (double arrow pointing West and East)
UpArrow	10	Up Arrow
Hourglass	11	Hourglass (wait)
NoDrop	12	No Drop
ArrowandHourglass	13	Arrow and Hourglass
ArrowandQuestionMark	14	Arrow and Question mark
SizeAll	15	Size All
Custom	99	Custom pointer defined by the MouseIcon property.


MousePointer Example [image] VB

This example shows how to set a custom mouse pointer for the control.

Private Sub cmdChangeMouse_Click()

   Dim strMIcon As String

    strMIcon = "C:\Program Files\DevStudio\VB\samples\PGuide\Optimize\Litening.ico"

    ImgThumbnail1.MouseIcon = LoadPicture(strMIcon)

    ImgThumbnail1.MousePointer = wiMPCustom  'Custom pointer = 99

End Sub


ReadyState Property

See Also	Example-VB
Returns the state of the control’s properties before downloading images from a web site.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
Applies To

Image Thumbnail control

Syntax

object.ReadyState

Data Type

Long

Setting	Description
0	Control is initializing and retrieving properties
2	Control is initialized and the download process has started
4	Control is ready for all requests
Remarks

This property is read-only.

You cannot call any methods until a value of 4 is returned.


ReadyState Example [image] VB

This example demonstrates how the ReadyState property can be captured and generate a message box indicating the current state of the control.

When the Thumbnail control completes downloading a file, the file will also be displayed in the Imgedit control.

Private Sub ImgThumbnail1_ReadyStateChange(ReadyState As Long)

    sCaption = "Ready State"

    Select Case ImgThumbnail1.ReadyState

        Case 0

            MsgBox "Control is initializing and retrieving properties.", , sCaption

        Case 2

            MsgBox "Control is initialized; download has started.", , sCaption

            ImgThumbnail1.ClearThumbs   'Clear control during download

        Case 4

            MsgBox "Control is ready.", , sCaption

            ImgEdit1.Image = ImgThumbnail1.Image

    End Select

End Sub


ScrollDirection Property

See Also	Example-VB
Returns or sets the scrolling direction.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Thumbnail control

Syntax

object.ScrollDirection[= {0|1}]

Data Type

Integer (enumerated)

Constant	Setting	Description
Horizontal	0	Displays a horizontal scrollbar
Vertical	1 (default)	Displays a vertical scrollbar
Remarks

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

Note: Either horizontal or vertical scroll can be specified, but not both.


ScrollDirection Example [image] VB

This example demonstrates how to change the default size of the thumbnail width, height, and scroll direction. It will also scroll right the distance of almost a full control screen.

Private Sub cmdSetProps_Click()

    sRet = InputBox("Enter the desired thumbnail height", "Thumbnail Height", ImgThumbnail1.ThumbHeight)

    If sRet <> "" Then ImgThumbnail1.ThumbHeight = Val(sRet)

    sRet = InputBox("Enter the desired thumbnail width", "Thumbnail Width",
        ImgThumbnail1.ThumbWidth)

    If sRet <> "" Then ImgThumbnail1.ThumbWidth = Val(sRet)

    sRet = InputBox("Enter a 0 for horizontal scrolling or" & vbCrLf &
       "enter a 1 for vertical scrolling.", "Scrollig Direction")

    If sRet <> "" Then

        If Val(sRet) = 0 Then

            ImgThumbnail1.ScrollDirection = Horizontal

        Else

            ImgThumbnail1.ScrollDirection = Vertical

        End If

    End If

    ImgThumbnail1.ScrollThumbs 0, 0

End Sub


SelectedThumbCount Property

See Also	Example-VB
Returns the number of thumbnails currently selected.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


SelectedThumbCount Example [image] VB

This example demonstrates how to delete all the currently selected thumbnails. It deletes them one at a time, deleting the page from the source first.

Private Sub cmdDelete_Click()

    Dim iPagesDeleted As Integer

    Dim ThumbsToDelete, ThumbCount As Integer

    iPagesDeleted = 0

    ThumbsToDelete = ImgThumbnail1.SelectedThumbCount  'Get # of selected thumbnails

    TotalThumbs = ImgThumbnail1.ThumbCount

    On Error GoTo ErrDelete

        'Loop until a selected thumbnail is encountered - delete it. Must
        'reset the loop because the thumbcount has changed as well as the
        'index of the next selected thumbnail.

        For i = ImgThumbnail1.LastSelectedThumb To
            ImgThumbnail1.FirstSelectedThumb Step -1

            If ImgThumbnail1.ThumbSelected(i) = True Then

                ImgAdmin1.DeletePages i, 1  'Must delete pages from
                                            'image file first

                ImgThumbnail1.DeleteThumbs i, 1

                iPagesDeleted = iPagesDeleted + 1

            End If

        Next i

        'Display a message regarding the status of the delete attempt

        If iPagesDeleted <> ThumbsToDelete Then

            MsgBox "Error deleting pages - " &
                Str(ImgThumbnail1.StatusCode), , "Thumbnail"

        Else

            MsgBox (Str(ThumbsToDelete) & " of " & Str(TotalThumbs) & " were deleted.")

        End If

    Exit Sub

ErrDelete:

    MsgBox Err.Description, , "Thumbnail"

    Exit Sub

End Sub


ThumbBackColor Property

See Also	Example-VB
Returns or sets the background color of the thumbnail boxes.

Available With

	Note: This property is not supported with Version 2.5 and greater.
√	Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Thumbnail control

Syntax

object.ThumbBackColor[=color]

Data Type

Long

Remarks

Use the RGB format. The default value is dark gray [image] RGB (128, 128, 128).

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


ThumbBackColor Example [image] VB

This example shows how to set the thumbnail background color using the Common Color dialog.

Private Sub mnuBackColor_Click()

    On Error GoTo ErrColor

    'Properties for the Common color dialog

    CommonDialog1.CancelError = True

    CommonDialog1.Flags = cdlCCRGBInit Or cdlCCPreventFullOpen

    CommonDialog1.ShowColor

    ImgThumbnail1.ThumbBackColor = CommonDialog1.Color

    Exit Sub

ErrColor:

    MsgBox Err.Description, , "Set Colors"

    Exit Sub

End Sub


ThumbCaption Property

See Also	Example-VB
Returns or sets the optional custom caption used with the ThumbCaptionStyle property.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Thumbnail control

Syntax

object.ThumbCaption[=caption]

Data Type

String

Remarks

Enables you to 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 a caption string constructed with the following symbols:

#  current thumbnail number
*  number of thumbnails
$  name of current image file
?  total pages in the current image file (manual mode)

For example, 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 *’. (The ThumbCaptionStyle property must be set to 3 or 4 in this case.)


ThumbCaption Example [image] VB

This example demonstrates how a caption might be set. In this case, a custom caption along with a graphic, indicating that a page contains annotations, is applied to the thumbnails. The following characters are mapped to the properties: # indicates current thumbnail, ? indicates the total number of thumbnails, and $ indicates the file name.

Private Sub cmdCaption_Click()

    On Error GoTo Err_Handle

    ImgThumbnail1.ThumbCaptionStyle = CaptionWithAnno 'Display a custom caption

    ImgThumbnail1.ThumbCaption = "Pg #/? in $"        'Ex. Pg 1/4 in test.tif

    ImgThumbnail1.Refresh

    Exit Sub

Err_Handle:

        MsgBox Err.Description, , "Caption error"

        Exit Sub

End Sub


ThumbCaptionColor Property

See Also	Example-VB
Returns or sets the color of caption labels displayed beneath thumbnails.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Thumbnail control

Syntax

object.ThumbCaptionColor[=color]

Data Type

Long

Remarks

Use the RGB format. The default value is black [image] RGB (0, 0, 0).

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


ThumbCaptionColor Example [image] VB

This example shows how the Common Font dialog can be used to set the font characteristics for the thumbnail caption.

Private Sub cmdSetCaptionFont_Click()

    On Error GoTo Err_Handle

    'Display the Font dialog box

    CommonDialog1.CancelError = True

    CommonDialog1.Flags = cdlCFBoth Or cdlCFEffects 'Enable all fonts and effects

    CommonDialog1.ShowFont

    Set cptFont = ImgThumbnail1.ThumbCaptionFont

    'Font characteristics returned from Font dialog

    With cptFont

        .Name = CommonDialog1.FontName

        .Size = CommonDialog1.FontSize

        .Bold = CommonDialog1.FontBold

        .Italic = CommonDialog1.FontItalic

        .Underline = CommonDialog1.FontUnderline

        .Strikethrough = CommonDialog1.FontStrikethru

    End With

    ImgThumbnail1.ThumbCaptionFont = cptFont

    'Caption color is also set in Font dialog

    ImgThumbnail1.ThumbCaptionColor = CommonDialog1.Color

    Exit Sub

Err_Handle:

    MsgBox Err.Description, , "Error"

    Exit Sub

End Sub


ThumbCaptionFont Property

See Also	Example-VB
Returns or sets the font used to display captions.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Thumbnail control

Syntax

object.ThumbCaptionFont[=font]

Data Type

FONT

Remarks

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

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


ThumbCaptionFont Example [image] VB

This example shows how the Common Font dialog can be used to set the font characteristics for the thumbnail caption.

Private Sub cmdSetCaptionFont_Click()

    On Error GoTo Err_Handle

    'Display the Font dialog box

    CommonDialog1.CancelError = True

    CommonDialog1.Flags = cdlCFBoth Or cdlCFEffects 'Enable all fonts and effects

    CommonDialog1.ShowFont

    Set cptFont = ImgThumbnail1.ThumbCaptionFont

    'Font characteristics returned from Font dialog

    With cptFont

        .Name = CommonDialog1.FontName

        .Size = CommonDialog1.FontSize

        .Bold = CommonDialog1.FontBold

        .Italic = CommonDialog1.FontItalic

        .Underline = CommonDialog1.FontUnderline

        .Strikethrough = CommonDialog1.FontStrikethru

    End With

    ImgThumbnail1.ThumbCaptionFont = cptFont

    'Caption color is also set in Font dialog

    ImgThumbnail1.ThumbCaptionColor = CommonDialog1.Color

    Exit Sub

Err_Handle:

    MsgBox Err.Description, , "Error"

    Exit Sub

End Sub


ThumbCaptionStyle Property

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

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Thumbnail control

Syntax

object.ThumbCaptionStyle[=integer]

Data Type

Integer (enumerated)

Constant	Setting	Description
NoCaption	0	No captions beneath the thumbnails
SimpleNoAnno	1 (default)	Page number, left justified, beneath each thumbnail
SimpleWithAnno	2	Same as Setting 1, but also includes a graphic before the caption for those thumbnail pages whose image file pages have annotations present
CaptionNoAnno	3	The string set by the property ThumbCaption is displayed, left justified, beneath the thumbnail.
CaptionWithAnno	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: Any captions displayed are clipped to the width of the thumbnail box.


ThumbCaptionStyle Example [image] VB

This example demonstrates how a caption might be set. In this case, a custom caption along with a graphic, indicating that a page contains annotations, is applied to the thumbnails. The following characters are mapped to the properties: # indicates current thumbnail, ? indicates the total number of thumbnails, and $ indicates the file name.

Private Sub cmdCaption_Click()

    On Error GoTo Err_Handle

    ImgThumbnail1.ThumbCaptionStyle = CaptionWithAnno 'Display a custom caption

    ImgThumbnail1.ThumbCaption = "Pg #/? in $"        'Ex. Pg 1/4 in test.tif

    ImgThumbnail1.Refresh

    Exit Sub

Err_Handle:

        MsgBox Err.Description, , "Caption error"

        Exit Sub

End Sub


ThumbCount Property

See Also	Example-VB
Returns the total number of pages (thumbnails) present in the current image file.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


ThumbCount Example [image] VB

This example demonstrates how thumbnails might be displayed. If the thumbnail count is less than 5, the first thumbnail is displayed at the top of the control.

If the count is between 5 and 20, the 5th thumbnail is placed in the center row of the control. If the count is greater than 20, the last thumbnail is displayed in the last row of the control.

Private Sub cmdDisplayThumbs_Click()

    ImgThumbnail1.ScrollDirection = Vertical  'Set vertical scrolling

    Select Case ImgThumbnail1.ThumbCount

        Case 1 To 4

            ImgThumbnail1.DisplayThumbs 'Default parameters are
                                        'ThumbNumber=1 and Option = 0

        Case 5 To 20

            ImgThumbnail1.DisplayThumbs 5, 1

        Case Is > 20

            ImgThumbnail1.DisplayThumbs ImgThumbnail1.ThumbCount, 2

    End Select

    ImgThumbnail1.Refresh

End Sub


ThumbDropNames Property

See Also	Example-VB
Returns a list of filenames dropped on the Thumbnail control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Thumbnail control

Syntax

object.ThumbDropNames[=item]

Data Type

String array

Remarks

Drag and drop with the Thumbnail control is limited to thumbnail to thumbnail operations, and file drops from the Explorer. Drops onto the Desktop or imaging window in the Imaging for Windows 95 application are not supported.

This property is read-only at run-time, and available only in conjunction with the ThumbDrop event.


ThumbDropNames Example [image] VB

This example demonstrates how the Thumbnail control can be updated when images are dropped onto it. A message box is displayed detailing the source file and pages as well as the insertion thumbnail for each thumbnail droppped onto the control. The source can be a drop from Explorer, Imaging for Windows, or selected thumbnails from another Thumbnail control.

For this example, the EnableDragDrop property has been set to DropFileDropDragLeftRight. The property must have been set prior to performing any drag or drop operation.

Private Sub ImgThumbnail1_ThumbDrop(ByVal InsertBefore As Long, ByVal DropCount As Long, ByVal Shift As Integer)

    Dim DropMsg As String

    On Error GoTo DropError

    'Loop to process each thumb being dropped; index starts at 0

    For InsertCount = 0 To DropCount - 1

        srcFile = ImgThumbnail1.ThumbDropNames(InsertCount)

        srcPage = ImgThumbnail1.ThumbDropPages(InsertCount)

        'Insert page into image file first, then Thumbnail control

        ImgAdmin1.Insert srcFile, srcPage, InsertBefore, 1
        'Image file saved after insert

        ImgThumbnail1.InsertThumbs InsertBefore, 1

        'Provide information regarding dropped page

        DropMsg = "Page " & Str(srcPage) & " from " & srcFile & " was
            inserted before page " & Str(InsertBefore)

        MsgBox DropMsg, , "Drop Page"

    Next InsertCount

    Exit Sub

DropError:

    ImgThumbnail1.DropFailed = True

    MsgBox Err.Description, , "Drop Error"

End Sub


ThumbDropPages Property

See Also	Example-VB
Returns a list of pages for the files dropped on the Thumbnail control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Thumbnail control

Syntax

object.ThumbPagesNames[=item]

Data Type

String array

Remarks

Valid indices for the array are in the range 0 (zero) to DropCount, where DropCount is the value passed in the ThumbDrop event.

This property is read-only at run-time, and available only in conjunction with the ThumbDrop event.


ThumbDropPages Example [image] VB

This example demonstrates how the Thumbnail control can be updated when images are dropped onto it. A message box is displayed detailing the source file and pages as well as the insertion thumbnail for each thumbnail droppped onto the control. The source can be a drop from Explorer, Imaging for Windows, or selected thumbnails from another Thumbnail control.

For this example, the EnableDragDrop property has been set to DropFileDropDragLeftRight. The property must have been set prior to performing any drag or drop operation.

Private Sub ImgThumbnail1_ThumbDrop(ByVal InsertBefore As Long, ByVal DropCount As Long, ByVal Shift As Integer)

    Dim DropMsg As String

    On Error GoTo DropError

    'Loop to process each thumb being dropped; index starts at 0

    For InsertCount = 0 To DropCount - 1

        srcFile = ImgThumbnail1.ThumbDropNames(InsertCount)

        srcPage = ImgThumbnail1.ThumbDropPages(InsertCount)

        'Insert page into image file first, then Thumbnail control

        ImgAdmin1.Insert srcFile, srcPage, InsertBefore, 1
        'Image file saved after insert

        ImgThumbnail1.InsertThumbs InsertBefore, 1

        'Provide information regarding dropped page

        DropMsg = "Page " & Str(srcPage) & " from " & srcFile & " was
            inserted before page " & Str(InsertBefore)

        MsgBox DropMsg, , "Drop Page"

    Next InsertCount

    Exit Sub

DropError:

    ImgThumbnail1.DropFailed = True

    MsgBox Err.Description, , "Drop Error"

End Sub


ThumbHeight Property

See Also	Example-VB
Returns or sets the height of thumbnail boxes.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


ThumbHeight Example [image] VB

This example demonstrates how to change the default size of the thumbnail width, height, and scroll direction. It will also scroll right the distance of almost a full control screen.

Private Sub cmdSetProps_Click()

    sRet = InputBox("Enter the desired thumbnail height",
       "Thumbnail Height", ImgThumbnail1.ThumbHeight)

    If sRet <> "" Then ImgThumbnail1.ThumbHeight = Val(sRet)

    sRet = InputBox("Enter the desired thumbnail width", "Thumbnail Width",
        ImgThumbnail1.ThumbWidth)

    If sRet <> "" Then ImgThumbnail1.ThumbWidth = Val(sRet)

    sRet = InputBox("Enter a 0 for horizontal scrolling or" & vbCrLf &
       "enter a 1 for vertical scrolling.", "Scrollig Direction")

    If sRet <> "" Then

        If Val(sRet) = 0 Then

            ImgThumbnail1.ScrollDirection = Horizontal

        Else

            ImgThumbnail1.ScrollDirection = Vertical

        End If

    End If

    ImgThumbnail1.ScrollThumbs 0, 0

End Sub


ThumbSelected Property

See Also	Example-VB
Returns or sets the selection status of the specified thumbnail.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Thumbnail control

Syntax

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

Data Type

PageNumber [image] Long

ThumbSelected [image] Boolean

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.

This property is run-time only.


ThumbSelected Example [image] VB

This example demonstrates how to delete all the currently selected thumbnails. It deletes them one at a time, deleting the page from the source first.

Private Sub cmdDelete_Click()

    Dim iPagesDeleted As Integer

    Dim ThumbsToDelete, ThumbCount As Integer

    iPagesDeleted = 0

    ThumbsToDelete = ImgThumbnail1.SelectedThumbCount  'Get # of selected thumbnails

    TotalThumbs = ImgThumbnail1.ThumbCount

    On Error GoTo ErrDelete

        'Loop until a selected thumbnail is encountered - delete it. Must
        'reset the loop because the thumbcount has changed as well as the
        'index of the next selected thumbnail.

        For i = ImgThumbnail1.LastSelectedThumb To
            ImgThumbnail1.FirstSelectedThumb Step -1

            If ImgThumbnail1.ThumbSelected(i) = True Then

                ImgAdmin1.DeletePages i, 1  'Must delete pages from
                                            'image file first

                ImgThumbnail1.DeleteThumbs i, 1

                iPagesDeleted = iPagesDeleted + 1

            End If

        Next i

        'Display a message regarding the status of the delete attempt

        If iPagesDeleted <> ThumbsToDelete Then

            MsgBox "Error deleting pages - " &
                Str(ImgThumbnail1.StatusCode), , "Thumbnail"

        Else

            MsgBox (Str(ThumbsToDelete) & " of " & Str(TotalThumbs) & " were deleted.")

        End If

    Exit Sub

ErrDelete:

    MsgBox Err.Description, , "Thumbnail"

    Exit Sub

End Sub


ThumbWidth Property

See Also	Example-VB
Returns or sets the width of the thumbnail boxes.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


ThumbWidth Example [image] VB

This example demonstrates how to change the default size of the thumbnail width, height, and scroll direction. It will also scroll right the distance of almost a full control screen.

Private Sub cmdSetProps_Click()

    sRet = InputBox("Enter the desired thumbnail height",
        "Thumbnail Height", ImgThumbnail1.ThumbHeight)

    If sRet <> "" Then ImgThumbnail1.ThumbHeight = Val(sRet)

    sRet = InputBox("Enter the desired thumbnail width", "Thumbnail Width",
        ImgThumbnail1.ThumbWidth)

    If sRet <> "" Then ImgThumbnail1.ThumbWidth = Val(sRet)

    sRet = InputBox("Enter a 0 for horizontal scrolling or" & vbCrLf &
       "enter a 1 for vertical scrolling.", "Scrollig Direction")

    If sRet <> "" Then

        If Val(sRet) = 0 Then

            ImgThumbnail1.ScrollDirection = Horizontal

        Else

            ImgThumbnail1.ScrollDirection = Vertical

        End If

    End If

    ImgThumbnail1.ScrollThumbs 0, 0

End Sub


ClearThumbs Method

See Also	Example-VB
Clears the buffered thumbnail representations of one or all pages.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 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.


ClearThumbs Example [image] VB


DeleteThumbs Method

See Also	Example-VB
Deletes the thumbnails.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Thumbnail control

Syntax

object.DeleteThumbs DeleteAt,DeleteCount

Arguments

Parameter	Data Type	Description
DeleteAt	Long	The number of the first page (thumbnail) to delete. 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.


DeleteThumbs Example [image] VB

This example demonstrates how to delete all the currently selected thumbnails. It deletes them one at a time, deleting the page from the source first.

Private Sub cmdDelete_Click()

    Dim iPagesDeleted As Integer

    Dim ThumbsToDelete, ThumbCount As Integer

    iPagesDeleted = 0

    ThumbsToDelete = ImgThumbnail1.SelectedThumbCount  'Get # of selected thumbnails

    TotalThumbs = ImgThumbnail1.ThumbCount

    On Error GoTo ErrDelete

        'Loop until a selected thumbnail is encountered - delete it. Must
        'reset the loop because the thumbcount has changed as well as the
        'index of the next selected thumbnail.

        For i = ImgThumbnail1.LastSelectedThumb To
            ImgThumbnail1.FirstSelectedThumb Step -1

            If ImgThumbnail1.ThumbSelected(i) = True Then

                ImgAdmin1.DeletePages i, 1  'Must delete pages from
                                            'image file first

                ImgThumbnail1.DeleteThumbs i, 1

                iPagesDeleted = iPagesDeleted + 1

            End If

        Next i

        'Display a message regarding the status of the delete attempt

        If iPagesDeleted <> ThumbsToDelete Then

            MsgBox "Error deleting pages - " &
                Str(ImgThumbnail1.StatusCode), , "Thumbnail"

        Else

            MsgBox (Str(ThumbsToDelete) & " of " & Str(TotalThumbs) & " were deleted.")

        End If

    Exit Sub

ErrDelete:

    MsgBox Err.Description, , "Thumbnail"

    Exit Sub

End Sub


DeselectAllThumbs Method

See Also	Example-VB
Deselects all thumbnails.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Thumbnail control

Syntax

object.DeselectAllThumbs

Remarks

This method is equivalent to setting each item in the ThumbSelected( ) property array to False.


DeselectAllThumbs Example [image] VB

This example demonstrates the how a menu item can be used to toggle the SelectAllThumbs and DeselectAllThumbs methods. When the menu item gets checked, all thumbnails are selected. They are deselected when the menu item becomes unchecked.

Private Sub mnuSelect_Click()

    If mnuSelect.Checked = True Then

        ImgThumbnail1.DeselectAllThumbs

        mnuSelect.Checked = False

    Else

        ImgThumbnail1.SelectAllThumbs

        mnuSelect.Checked = True

    End If

End Sub


DisplayThumbs Method

See Also	Example-VB
Displays thumbnails using specified options.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 (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), in the 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) in the rightmost column (for horizontal scrolling)
Remarks

This method refreshes the control’s display.

It is not necessary to call this method after setting the Image property to initiate a display of the specified image file’s thumbnails.


DisplayThumbs Example [image] VB

This example demonstrates how thumbnails might be displayed. If the thumbnail count is less than 5, the first thumbnail is displayed at the top of the control.

If the count is between 5 and 20, the 5th thumbnail is placed in the center row of the control. If the count is greater than 20, the last thumbnail is displayed in the last row of the control.

Private Sub cmdDisplayThumbs_Click()

    ImgThumbnail1.ScrollDirection = Vertical  'Set vertical scrolling

    Select Case ImgThumbnail1.ThumbCount

        Case 1 To 4

            ImgThumbnail1.DisplayThumbs 'Default parameters are
                                        'ThumbNumber=1 and Option = 0

        Case 5 To 20

            ImgThumbnail1.DisplayThumbs 5, 1

        Case Is > 20

            ImgThumbnail1.DisplayThumbs ImgThumbnail1.ThumbCount, 2

    End Select

    ImgThumbnail1.Refresh

End Sub


GenerateThumb Method

See Also	Example-VB
Forces the generation or regeneration of the specified image’s thumbnail representation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.
2	Suppresses the regeneration of thumbnails while the Image property is being set. This is useful for creating a temporary file for the current image and setting the Image property to the new file name without regenerating all of the thumbnails. Note: Once the Image property has been updated, reset this value to the previous setting so that thumbnails are updated correctly in future operations.
PageNumber	Long	Optional. The number of the page for which a Thumbnail is generated.  If a value is not specified, a default value of 0 (indicates 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.


GenerateThumb Example [image] VB

This example demonstrates how to regenerate a thumbnail after the source page has been modified. In this case, the page is rotated left.

Private Sub cmdGenerateThumb_Click()

    Dim iPage As Integer

    On Error GoTo Gen_Error

    iPage = 1

    ImgEdit1.Image = ImgThumbnail1.Image

    ImgEdit1.Display

    'Rotate page 1 left 90 degrees

    ImgEdit1.Page = iPage

    ImgEdit1.RotateLeft

    ImgThumbnail1.GenerateThumb 1, iPage 'Regenerate corresponding thumb

    Exit Sub

Gen_Error:

    MsgBox (Err.Description)

End Sub


GetManualThumbFilename Method

See Also	Example-VB
Returns the image filename from the thumbnail definition.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Thumbnail control

Syntax

object.GetManualThumbFilename ThumbNumber

Arguments

Parameter	Data Type	Description
ThumbNumber	Long	Used to specify the index in an array of thumbnails. Each thumbnail defined is associated with a filename. The value must be less than or equal to the ThumbCount parameter passed in a call to the SetManualMode method.
Remarks

Calling SetManualMode initiates an interactive mode, enabling the programmer to identify each thumbnail in the array by using the ThumbNumber parameter.

Call this method to get the name of the image file for each thumbnail used in manual mode.

Setting the Image property returns to the standard mode of operation.


GetManualThumbFilename Example [image] VB

This example demonstrates how to display the source page of a selected thumbnail added to the Thumbnail control while manual mode is active.

Private Sub ImgThumbnail1_Click(ByVal ThumbNumber As Long)

    On Error GoTo Click_Error

    'Get the source and page # of the selected thumb (0-based index)

    iSrcPage = ImgThumbnail1.GetManualThumbPage(ThumbNumber - 1)

    strSrcFile = ImgThumbnail1.GetManualThumbFilename(ThumbNumber - 1)

    'Display the source of the specified manual thumbnail in ImgEdit control.

    ImgEdit1.Image = strSrcFile

    ImgEdit1.Page = iSrcPage

    ImgEdit1.Display

    Exit Sub

Click_Error:

    Exit Sub

End Sub


GetManualThumbPage Method

See Also	Example-VB
Returns the page within the image file from the thumbnail definitions.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Thumbnail control

Syntax

object.GetManualThumbPage(ThumbNumber)

Arguments

Parameter	Data Type	Description
ThumbNumber	Long	Used to specify the index in an array of thumbnails. The value must be less than or equal to the ThumbCount parameter passed in a call to the SetManualMode method.
Remarks

Calling SetManualMode initiates an interactive mode, enabling the programmer to identify each thumbnail in the array by using the ThumbNumber parameter.

Call this method to get the name of the page within an image file for each thumbnail used in manual mode.

Setting the Image property returns to the standard mode of operation.


GetManualThumbPage Example [image] VB

This example demonstrates how to display the source page of a selected thumbnail added to the Thumbnail control while manual mode is active.

Private Sub ImgThumbnail1_Click(ByVal ThumbNumber As Long)

    On Error GoTo Click_Error

    'Get the source and page # of the selected thumb (0-based index)

    iSrcPage = ImgThumbnail1.GetManualThumbPage(ThumbNumber - 1)

    strSrcFile = ImgThumbnail1.GetManualThumbFilename(ThumbNumber - 1)

    'Display the source of the specified manual thumbnail in ImgEdit control.

    ImgEdit1.Image = strSrcFile

    ImgEdit1.Page = iSrcPage

    ImgEdit1.Display

    Exit Sub

Click_Error:

    Exit Sub

End Sub


GetMaximumSize Method

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

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 [image] Allows space for a scroll bar. False [image] 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 can be used to calculate the size required in the scrolling direction to display a specified number of thumbnails.


GetMaximumSize Example [image] VB

This example demonstrates how a call to the GetScrollDirectionSize method can be used to calculate the size needed to display 4 thumbnails in the scrolling direction while displaying 2 thumbnails in the non-scrolling direction.

First, the user is allowed to set the thumbnail width and height. The non-scrolling dimension is then derived from the average of the GetMimimumSize and GetMaximumSize methods. In this particular example, the scrolling direction is horizontal.

Private Sub cmdControlSize_Click()

    Dim lMinSize, lMaxSize, lVSize, lHSize As Long

    Dim bScroll As Boolean

    Dim iNonScrollThumbCount As Long

    bScroll = True

    iNonScrollThumbCount = 2        'Number of thumbnails desired in
                                    'non-scrolling direction

    ImgThumbnail1.ScrollDirection = Horizontal

    ImgThumbnail1.UISetThumbSize    'User sets thumb size interactively

    'Determine min and max control size taking a scrollbar into account

    lMinSize = ImgThumbnail1.GetMinimumSize(iNonScrollThumbCount, bScroll)

    lMaxSize = ImgThumbnail1.GetMaximumSize(iNonScrollThumbCount, bScroll)

    lVSize = (lMinSize + lMaxSize) / 2  'Average of the min & max nonscrolling size

    lHSize = ImgThumbnail1.GetScrollDirectionSize(4, iNonScrollThumbCount, lVSize, True)

    'Prior to resizing the Thumbnail control, it is necessary to ensure
    'the unit of   'measure for the form and Thumbnail control are the
    'same. The thumbnail methods return units in pixels - so the scale
    'mode for the form must be set to pixels.

    Form1.ScaleMode = vbPixel

    ImgThumbnail1.Width = lHSize

    ImgThumbnail1.Height = lVSize

End Sub


GetMinimumSize Method

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

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 [image] Allows space for a scroll bar. False [image] 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 can be used to calculate the size required in the scrolling direction to display a specified number of thumbnails.


GetMinimumSize Example [image] VB

This example demonstrates how a call to the GetScrollDirectionSize method can be used to calculate the size needed to display 4 thumbnails in the scrolling direction while displaying 2 thumbnails in the non-scrolling direction.

First, the user is allowed to set the thumbnail width and height. The non-scrolling dimension is then derived from the average of the GetMimimumSize and GetMaximumSize methods. In this particular example, the scrolling direction is horizontal.

Private Sub cmdControlSize_Click()

    Dim lMinSize, lMaxSize, lVSize, lHSize As Long

    Dim bScroll As Boolean

    Dim iNonScrollThumbCount As Long

    bScroll = True

    iNonScrollThumbCount = 2        'Number of thumbnails desired in
                                    'non-scrolling direction

    ImgThumbnail1.ScrollDirection = Horizontal

    ImgThumbnail1.UISetThumbSize    'User sets thumb size interactively

    'Determine min and max control size taking a scrollbar into account

    lMinSize = ImgThumbnail1.GetMinimumSize(iNonScrollThumbCount, bScroll)

    lMaxSize = ImgThumbnail1.GetMaximumSize(iNonScrollThumbCount, bScroll)

    lVSize = (lMinSize + lMaxSize) / 2  'Average of the min & max nonscrolling size

    lHSize = ImgThumbnail1.GetScrollDirectionSize(4, iNonScrollThumbCount, lVSize, True)

    'Prior to resizing the Thumbnail control, it is necessary to ensure
    'the unit of   'measure for the form and Thumbnail control are the
    'same. The thumbnail methods return units in pixels - so the scale
    'mode for the form must be set to pixels.

    Form1.ScaleMode = vbPixel

    ImgThumbnail1.Width = lHSize

    ImgThumbnail1.Height = lVSize

End Sub


GetScrollDirectionSize Method

See Also	Example-VB
Determines what the control size has to be, in the scrolling dimension, to display a specified number of thumbnails.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 [image] Allows space for a scroll bar False [image] 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.


GetScrollDirectionSize Example [image] VB

This example demonstrates how a call to the GetScrollDirectionSize method can be used to calculate the size needed to display 4 thumbnails in the scrolling direction while displaying 2 thumbnails in the non-scrolling direction.

First, the user is allowed to set the thumbnail width and height. The non-scrolling dimension is then derived from the average of the GetMimimumSize and GetMaximumSize methods. In this particular example, the scrolling direction is horizontal.

Private Sub cmdControlSize_Click()

    Dim lMinSize, lMaxSize, lVSize, lHSize As Long

    Dim bScroll As Boolean

    Dim iNonScrollThumbCount As Long

    bScroll = True

    iNonScrollThumbCount = 2        'Number of thumbnails desired in
                                    'non-scrolling direction

    ImgThumbnail1.ScrollDirection = Horizontal

    ImgThumbnail1.UISetThumbSize    'User sets thumb size interactively

    'Determine min and max control size taking a scrollbar into account

    lMinSize = ImgThumbnail1.GetMinimumSize(iNonScrollThumbCount, bScroll)

    lMaxSize = ImgThumbnail1.GetMaximumSize(iNonScrollThumbCount, bScroll)

    lVSize = (lMinSize + lMaxSize) / 2  'Average of the min & max nonscrolling size

    lHSize = ImgThumbnail1.GetScrollDirectionSize(4, iNonScrollThumbCount, lVSize, True)

    'Prior to resizing the Thumbnail control, it is necessary to ensure
    'the unit of   'measure for the form and Thumbnail control are the
    'same. The thumbnail methods return units in pixels - so the scale
    'mode for the form must be set to pixels.

    Form1.ScaleMode = vbPixel

    ImgThumbnail1.Width = lHSize

    ImgThumbnail1.Height = lVSize

End Sub


InsertThumbs Method

See Also	Example-VB
Informs the Thumbnail control that pages have been inserted into the currently displayed image file.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


InsertThumbs Example [image] VB

This example demonstrates how the Thumbnail control can be updated when images are dropped onto it. A message box is displayed detailing the source file and pages as well as the insertion thumbnail for each thumbnail droppped onto the control. The source can be a drop from Explorer, Imaging for Windows, or selected thumbnails from another Thumbnail control.

For this example, the EnableDragDrop property has been set to DropFileDropDragLeftRight. The property must have been set prior to performing any drag or drop operation.

Private Sub ImgThumbnail1_ThumbDrop(ByVal InsertBefore As Long, ByVal DropCount As Long, ByVal Shift As Integer)

    Dim DropMsg As String

    On Error GoTo DropError

    'Loop to process each thumb being dropped; index starts at 0

    For InsertCount = 0 To DropCount - 1

        srcFile = ImgThumbnail1.ThumbDropNames(InsertCount)

        srcPage = ImgThumbnail1.ThumbDropPages(InsertCount)

        'Insert page into image file first, then Thumbnail control

        ImgAdmin1.Insert srcFile, srcPage, InsertBefore, 1
       'Image file saved after insert

        ImgThumbnail1.InsertThumbs InsertBefore, 1

        'Provide information regarding dropped page

        DropMsg = "Page " & Str(srcPage) & " from " & srcFile & " was
            inserted before page " & Str(InsertBefore)

        MsgBox DropMsg, , "Drop Page"

    Next InsertCount

    Exit Sub

DropError:

    ImgThumbnail1.DropFailed = True

    MsgBox Err.Description, , "Drop Error"

End Sub


Refresh Method

See Also	Example-VB
Repaints the control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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.


Refresh Example [image] VB

This example demonstrates how a caption might be set. In this case, a custom caption along with a graphic, indicating that a page contains annotations, is applied to the thumbnails. The following characters are mapped to the properties: # indicates current thumbnail, ? indicates the total number of thumbnails, and $ indicates the file name.

Private Sub cmdCaption_Click()

    On Error GoTo Err_Handle

    ImgThumbnail1.ThumbCaptionStyle = CaptionWithAnno 'Display a custom caption

    ImgThumbnail1.ThumbCaption = "Pg #/? in $"        'Ex. Pg 1/4 in test.tif

    ImgThumbnail1.Refresh

    Exit Sub

Err_Handle:

        MsgBox Err.Description, , "Caption error"

        Exit Sub

End Sub


SaveAs Method (Thumbnail control)
SaveAs Method

See Also	Example-VB
Enables the programmer to control when thumbnail representations of the pages in the specified object (local/redirected drive, 1.x, or Enterprise Imaging server) are saved to a specified file format.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Thumbnail control

Syntax

object.SaveAs(Filename,SaveOptions,FirstThumb,LastThumb)

Arguments

Parameter	Data Type	Description
Filename	String	Specifies the name of the file that will receive the saved thumbnails
SaveOptions	Integer	Optional. Specifies the format of the file that will receive the saved thumbnails. If no format is specified, TIFF will be used. Valid values are: 1 [image] Contact Sheet image in multipage TIFF format. Thumbnails will be organized by using the current size, on multiple pages based on the range of thumbnails. 2 [image] Contact Sheet image in BMP format with a single page of thumbnails 3 [image] TIFF file with 1 thumbnail per page 4 [image] BMP file with 1 thumbnail  Additive options are: +256 [image] Compressed TIFF contact sheets using LZW compression +512 [image] “Burn in” thumbnail image stamps, backgrounds, and captions into the TIFF contact sheets +1024 [image] Generate thumbnail images with annotations displayed +2048 [image] Create hyperlinks between the thumbnail image stamp annotations on the contact sheet and the source file. This option cannot be ORed with the value of +512 (“burn in” annotations). +4096 [image] Save the currently selected thumbnails. The current image file must be the source image file for the call to the SaveAs method These additive options can be ORed with the main options [image] 1, 2, 3, or 4  [image] as follows: 0x0100 [image] LZW compression (options 1 and 3 only) 0x0200 [image] Burn in annotations 0x0400 [image] Generate thumbnails including annotations 0x0800 [image] Hyperlink image stamps to original image (options 1 and 3 only) 0x1000 [image] Save only sthe selected thumbs
FirstThumb	Long	Optional. Indicates the one (1) relative thumbnail that corresponds to the page of the thumbnail to be generated and saved. (1 relative means the first page that is specified by passing FirstThumb=1). The default value for this parameter is 1.
LastThumb		Optional. Indicates the one (1) relative thumbnail that corresponds to the page of the thumbnail to be generated and saved. If this parameter is not specified, the default value of ThumbCount property is used for TIFF output, and FirstThumb for BMP output.
Remarks

Use the SetSaveAsDimensions method to generate thumbnails of a different size.

In all cases, the aspect ratio of the thumbnail is kept, and the generated thumbnails are centered within the specified dimensions.

If you are saving to a 1.x document, you must include the Admin control in the project and set the FileStgLoc1x. The Admin ForceFileLinking1x property can be used if required, for 1.x document operations.


SaveAs Example [image] VB

This example demonstrates how a contact sheet can be created using various methods to set the image type, caption attributes, backcolor, orientation, dimension, and file type.

Private Sub cmdContactSheet_Click()

    Dim iRet, ContactOption As Long

    On Error GoTo Set_Error

    'Set orientation, backcolor and dimensions

    ImgThumbnail1.SetSaveAsBackColor vbRed

    ImgThumbnail1.SetSaveAsOrientation Vertical

    ImgThumbnail1.SetSaveAsDimensions 200, 200

    'Set caption and its properties

    ImgThumbnail1.SetSaveAsCaption CaptionWithAnno, "Page # of *"

    ImgThumbnail1.SetSaveAsCaptionFont "Courier", 14, vbGreen, 0

    'Save the contact sheet as an RGB24 TIF

    ImgThumbnail1.SetSaveAsThumbType 6

    ContactOption = esiTIFFContactSheet     'Set contact sheet to multipage
                                            'TIFF format

    ContactFile = "c:\contact.tif"

    iRet = ImgThumbnail1.SaveAs(ContactFile, ContactOption, 1)

    'Display the resulting contact sheet

    ImgEdit1.Image = ContactFile

    ImgEdit1.Display

    Exit Sub

Set_Error:

     MsgBox Err.Description, , "Set Error"

     Exit Sub

End Sub


ScrollThumbs Method

See Also	Example-VB
Specifies a direction and amount for scrolling.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Thumbnail control

Syntax

object.ScrollThumbs(Direction,Amount)

Arguments

Parameter	Data Type	Description
Direction	Integer	Specifies the direction of scroll. 0 (zero) -- scrolls the control towards the last thumbnail. 1 -- scrolls the control towards the first thumbnail.
Amount	Integer	Specifies the amount of scroll desired 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). 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).


ScrollThumbs Example [image] VB

This example demonstrates how to change the default size of the thumbnail width, height, and scroll direction. It will also scroll right the distance of almost a full control screen.

Private Sub cmdSetProps_Click()

    sRet = InputBox("Enter the desired thumbnail height", "Thumbnail Height", ImgThumbnail1.ThumbHeight)

    If sRet <> "" Then ImgThumbnail1.ThumbHeight = Val(sRet)

    sRet = InputBox("Enter the desired thumbnail width", "Thumbnail Width",
        ImgThumbnail1.ThumbWidth)

    If sRet <> "" Then ImgThumbnail1.ThumbWidth = Val(sRet)

    sRet = InputBox("Enter a 0 for horizontal scrolling or" & vbCrLf &
       "enter a 1 for vertical scrolling.", "Scrollig Direction")

    If sRet <> "" Then

        If Val(sRet) = 0 Then

            ImgThumbnail1.ScrollDirection = Horizontal

        Else

            ImgThumbnail1.ScrollDirection = Vertical

        End If

    End If

    ImgThumbnail1.ScrollThumbs 0, 0

End Sub


SelectAllThumbs Method

See Also	Example-VB
Selects all thumbnails.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
Applies To

Image Thumbnail control

Syntax

object.SelectAllThumbs

Remarks

This method is equivalent to setting each item in the ThumbSelected( ) property array to True.


SelectAllThumbs Example [image] VB

This example demonstrates how a menu item can be used to toggle the SelectAllThumbs and DeselectAllThumbs methods. When the menu item gets checked, all thumbnails are selected. They are deselected when the menu item becomes unchecked.

Private Sub mnuSelect_Click()

    If mnuSelect.Checked = True Then

        ImgThumbnail1.DeselectAllThumbs

        mnuSelect.Checked = False

    Else

        ImgThumbnail1.SelectAllThumbs

        mnuSelect.Checked = True

    End If

End Sub


SetManualMode Method

See Also	Example-VB
Sets an interactive mode in which the programmer specifies what is displayed in each thumbnail.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Thumbnail control

Syntax

object.SetManualMode ThumbCount

Arguments

Parameter	Data Type	Description
ThumbCount	Long	Specifies the number of thumbnails to be manually added to the control
Remarks

Call this method before you call the SetManualThumb method to initialize the control for the number of thumbnails to be entered.

Set the Image property to return to the standard mode of operation.


SetManualMode Example [image] VB

This example shows how thumbnail pages can be programmatically added to the Thumbnail control. It also demonstrates how the source file and page can be retrieved.

Private Sub cmdManual_Click()

    Dim strThumbFile, strThumbMsg As String

    Dim iSrcPage As Integer

    'Add 2 thumbnails to the control via interactive mode

    ImgThumbnail1.SetManualMode 2

    ImgThumbnail1.SetManualThumb 1, "C:\windows\waves.bmp", 1

    ImgThumbnail1.SetManualThumb 2, "c:\windows\tiles.bmp", 1

End Sub


SetManualThumb Method

See Also	Example-VB
Sets an interactive mode in which the programmer adds thumbnails to an array using the ThumbNumber parameter.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Thumbnail control

Syntax

object.SetManualThumb ThumbNumber,FileName,Page

Arguments

Parameter	Data Type	Description
ThumbNumber	Long	Used to specify the index in an array of thumbnails. Each thumbnail defined is associated with a filename. The value must be less than or equal to the ThumbCount parameter passed in a call to the SetManualMode method.
FileName	String	Specifies the name of an image file from which the specified thumbnail will be generated
Page	Long	Specifies which page in the image file (specified in FileName) will be used to generate the thumbnail
Remarks

Call this method to initialize each thumbnail to be used in the manual mode of the control.

This method does not verify the existence of a file, or of the pages within a file. The method is validated once the thumbnail is actually displayed or saved.

Set the Image property to return to the standard mode of operation.


SetManualThumb Example [image] VB

This example shows how thumbnail pages can be programmatically added to the Thumbnail control. It also demonstrates how the source file and page can be retrieved.

Private Sub cmdManual_Click()

    Dim strThumbFile, strThumbMsg As String

    Dim iSrcPage As Integer

    'Add 2 thumbnails to the control via interactive mode

    ImgThumbnail1.SetManualMode 2

    ImgThumbnail1.SetManualThumb 1, "C:\windows\waves.bmp", 1

    ImgThumbnail1.SetManualThumb 2, "c:\windows\tiles.bmp", 1

End Sub


SetSaveAsBackColor Method

See Also	Example-VB
Sets the background color of thumbnails saved on a contact sheet.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Thumbnail control

Syntax

object.SetSaveAsBackColor Color

Remarks

The default value is light gray [image] RGB (192, 192, 192). Use the RGB format.

This method must be called before the SaveAs method.


SetSaveAsBackColor Example [image] VB

This example demonstrates how a contact sheet can be created using various methods to set the image type, caption attributes, backcolor, orientation, dimension, and file type.

Private Sub cmdContactSheet_Click()

    Dim iRet, ContactOption As Long

    On Error GoTo Set_Error

    'Set orientation, backcolor and dimensions

    ImgThumbnail1.SetSaveAsBackColor vbRed

    ImgThumbnail1.SetSaveAsOrientation Vertical

    ImgThumbnail1.SetSaveAsDimensions 200, 200

    'Set caption and its properties

    ImgThumbnail1.SetSaveAsCaption CaptionWithAnno, "Page # of *"

    ImgThumbnail1.SetSaveAsCaptionFont "Courier", 14, vbGreen, 0

    'Save the contact sheet as an RGB24 TIF

    ImgThumbnail1.SetSaveAsThumbType 6

    ContactOption = esiTIFFContactSheet     'Set contact sheet to multipage
                                            'TIFF format

    ContactFile = "c:\contact.tif"

    iRet = ImgThumbnail1.SaveAs(ContactFile, ContactOption, 1)

    'Display the resulting contact sheet

    ImgEdit1.Image = ContactFile

    ImgEdit1.Display

    Exit Sub

Set_Error:

     MsgBox Err.Description, , "Set Error"

     Exit Sub

End Sub


SetSaveAsCaption Method

See Also	Example-VB
Sets the caption font of thumbnails saved on a contact sheet.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Thumbnail control

Syntax

object.SetSaveAsCaption Style,Caption

Arguments

Parameter	Data Type	Description
Style	Integer	Specifies the type of caption to use when saving thumbnails to a contact sheet 0 [image] No caption 1 [image] Simple caption using thumbnail number. A caption string is not required. 2 [image] Reserved 3 [image] Use a caption string constructed with the following symbols: #  current thumbnail number *  number of thumbnails $  name of current image file ?  total pages in the current image file (manual mode) 4  [image] Reserved
Caption	String	Optional. Specifies the text to appear in the caption
Remarks

This method must be called before the SaveAs method.


SetSaveAsCaption Example [image] VB

This example demonstrates how a contact sheet can be created using various methods to set the image type, caption attributes, backcolor, orientation, dimension, and file type.

Private Sub cmdContactSheet_Click()

    Dim iRet, ContactOption As Long

    On Error GoTo Set_Error

    'Set orientation, backcolor and dimensions

    ImgThumbnail1.SetSaveAsBackColor vbRed

    ImgThumbnail1.SetSaveAsOrientation Vertical

    ImgThumbnail1.SetSaveAsDimensions 200, 200

    'Set caption and its properties

    ImgThumbnail1.SetSaveAsCaption CaptionWithAnno, "Page # of *"

    ImgThumbnail1.SetSaveAsCaptionFont "Courier", 14, vbGreen, 0

    'Save the contact sheet as an RGB24 TIF

    ImgThumbnail1.SetSaveAsThumbType 6

    ContactOption = esiTIFFContactSheet     'Set contact sheet to multipage
                                            'TIFF format

    ContactFile = "c:\contact.tif"

    iRet = ImgThumbnail1.SaveAs(ContactFile, ContactOption, 1)

    'Display the resulting contact sheet

    ImgEdit1.Image = ContactFile

    ImgEdit1.Display

    Exit Sub

Set_Error:

     MsgBox Err.Description, , "Set Error"

     Exit Sub

End Sub


SetSaveAsCaptionFont Method

See Also	Example-VB
Sets the caption font of thumbnails saved on a contact sheet.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Thumbnail control

Syntax

object.SetSaveAsCaptionFont FontName,PointSize,Color,Options

Arguments

Parameter	Data Type	Description
FontName	Long	Specifies the name of the font
PointSize	Integer	Specifies the point size of the font
Color	VT_COLOR (OLE_COLOR)	Specifies text color
Options	Integer	Specifies font attributes 0 [image] no options 1 [image] bold 2 [image] italic 4 [image] strikethrough 8 [image] underline
Remarks

If you do not specify a value for a parameter, the following defaults are applied:

FontName = MS Sans Serif

PointSize = 8

Color = black

Options = 0

This method must be called before the SaveAs method.


SetSaveAsCaptionFont Example [image] VB

This example demonstrates how a contact sheet can be created using various methods to set the image type, caption attributes, backcolor, orientation, dimension, and file type.

Private Sub cmdContactSheet_Click()

    Dim iRet, ContactOption As Long

    On Error GoTo Set_Error

    'Set orientation, backcolor and dimensions

    ImgThumbnail1.SetSaveAsBackColor vbRed

    ImgThumbnail1.SetSaveAsOrientation Vertical

    ImgThumbnail1.SetSaveAsDimensions 200, 200

    'Set caption and its properties

    ImgThumbnail1.SetSaveAsCaption CaptionWithAnno, "Page # of *"

    ImgThumbnail1.SetSaveAsCaptionFont "Courier", 14, vbGreen, 0

    'Save the contact sheet as an RGB24 TIF

    ImgThumbnail1.SetSaveAsThumbType 6

    ContactOption = esiTIFFContactSheet     'Set contact sheet to multipage
                                            'TIFF format

    ContactFile = "c:\contact.tif"

    iRet = ImgThumbnail1.SaveAs(ContactFile, ContactOption, 1)

    'Display the resulting contact sheet

    ImgEdit1.Image = ContactFile

    ImgEdit1.Display

    Exit Sub

Set_Error:

     MsgBox Err.Description, , "Set Error"

     Exit Sub

End Sub


SetSaveAsDimensions Method

See Also	Example-VB
Sets the height and width of thumbnails to be saved.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Thumbnail control

Syntax

object.SetSaveAsDimensions ThumbWidth,ThumbHeight

Arguments

Parameter	Data Type	Description
ThumbWidth	Long	Specifies the width of the thumbnail, in pixels. Values must be in the range of 50 - 500, inclusive. A value of 0 (zero) indicates the current thumbnail width will be used.
ThumbHeight	Long	Specifies the height of the thumbnail, in pixels. Values must be in the range of 50 - 500, inclusive. A value of 0 (zero) indicates the current thumbnail height will be used.
Remarks

This method must be called before the SaveAs method.


SetSaveAsDimensions Example [image] VB

This example demonstrates how a contact sheet can be created using various methods to set the image type, caption attributes, backcolor, orientation, dimension, and file type.

Private Sub cmdContactSheet_Click()

    Dim iRet, ContactOption As Long

    On Error GoTo Set_Error

    'Set orientation, backcolor and dimensions

    ImgThumbnail1.SetSaveAsBackColor vbRed

    ImgThumbnail1.SetSaveAsOrientation Vertical

    ImgThumbnail1.SetSaveAsDimensions 200, 200

    'Set caption and its properties

    ImgThumbnail1.SetSaveAsCaption CaptionWithAnno, "Page # of *"

    ImgThumbnail1.SetSaveAsCaptionFont "Courier", 14, vbGreen, 0

    'Save the contact sheet as an RGB24 TIF

    ImgThumbnail1.SetSaveAsThumbType 6

    ContactOption = esiTIFFContactSheet     'Set contact sheet to multipage
                                            'TIFF format

    ContactFile = "c:\contact.tif"

    iRet = ImgThumbnail1.SaveAs(ContactFile, ContactOption, 1)

    'Display the resulting contact sheet

    ImgEdit1.Image = ContactFile

    ImgEdit1.Display

    Exit Sub

Set_Error:

     MsgBox Err.Description, , "Set Error"

     Exit Sub

End Sub


SetSaveAsOrientation Method

See Also	Example-VB
Sets the orientation (horizontal or vertical) of thumbnails to be saved on a contact sheet.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Thumbnail control

Syntax

object.SetSaveAsOrientation Direction

Arguments

Parameter	Data Type	Description
Direction	Integer	Specifies thumbnail orientation on the contact sheet
		0 [image] Horizontal orientation. Thumbnails are positioned and numbered in rows, from left to right. Rows are arranged from top to bottom .
		1 [image] Vertical orientation. Thumbnails are positioned and numbered in columns, from top to bottom. Columns are arranged from left to right.
Remarks

This method must be called before the SaveAs method.


SetSaveAsOrientation Example [image] VB

This example demonstrates how a contact sheet can be created using various methods to set the image type, caption attributes, backcolor, orientation, dimension, and file type.

Private Sub cmdContactSheet_Click()

    Dim iRet, ContactOption As Long

    On Error GoTo Set_Error

    'Set orientation, backcolor and dimensions

    ImgThumbnail1.SetSaveAsBackColor vbRed

    ImgThumbnail1.SetSaveAsOrientation Vertical

    ImgThumbnail1.SetSaveAsDimensions 200, 200

    'Set caption and its properties

    ImgThumbnail1.SetSaveAsCaption CaptionWithAnno, "Page # of *"

    ImgThumbnail1.SetSaveAsCaptionFont "Courier", 14, vbGreen, 0

    'Save the contact sheet as an RGB24 TIF

    ImgThumbnail1.SetSaveAsThumbType 6

    ContactOption = esiTIFFContactSheet     'Set contact sheet to multipage
                                            'TIFF format

    ContactFile = "c:\contact.tif"

    iRet = ImgThumbnail1.SaveAs(ContactFile, ContactOption, 1)

    'Display the resulting contact sheet

    ImgEdit1.Image = ContactFile

    ImgEdit1.Display

    Exit Sub

Set_Error:

     MsgBox Err.Description, , "Set Error"

     Exit Sub

End Sub


SetSaveAsThumbType Method

See Also	Example-VB
Sets the image type of thumbnails to generated and saved by the SaveAs method.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image Thumbnail control

Syntax

object.SetSaveAsThumbType ImageType

Arguments

Parameter	Data Type	Description
ImageType	Integer	Specifies image type of saved thumbnail
		0 [image] none (BMP and TIFF) (default)
		1 [image] black & white (BMP and TIFF)
		2 [image] 4-bit gray (TIFF)
		3 [image] 8-bit gray (TIFF)
		4 [image] 4-bit palette (Not available)
		5 [image] 8-bit palette (BMP and TIFF)
		6 [image] 24-bit RGB (BMP and TIFF)
		7 [image] 24-bit RGB (Not available)
Remarks

If this method is not called, the default value of 0 (zero) is used.

If ImageType=0, and annotations are being rendered, and there are annotations on the image page, then the thumbnail image type will be set to 6 (24-bit RGB).


SetSaveAsThumbType Example [image] VB

This example demonstrates how a contact sheet can be created using various methods to set the image type, caption attributes, backcolor, orientation, dimension, and file type.

Private Sub cmdContactSheet_Click()

    Dim iRet, ContactOption As Long

    On Error GoTo Set_Error

    'Set orientation, backcolor and dimensions

    ImgThumbnail1.SetSaveAsBackColor vbRed

    ImgThumbnail1.SetSaveAsOrientation Vertical

    ImgThumbnail1.SetSaveAsDimensions 200, 200

    'Set caption and its properties

    ImgThumbnail1.SetSaveAsCaption CaptionWithAnno, "Page # of *"

    ImgThumbnail1.SetSaveAsCaptionFont "Courier", 14, vbGreen, 0

    'Save the contact sheet as an RGB24 TIF

    ImgThumbnail1.SetSaveAsThumbType 6

    ContactOption = esiTIFFContactSheet     'Set contact sheet to multipage
                                            'TIFF format

    ContactFile = "c:\contact.tif"

    iRet = ImgThumbnail1.SaveAs(ContactFile, ContactOption, 1)

    'Display the resulting contact sheet

    ImgEdit1.Image = ContactFile

    ImgEdit1.Display

    Exit Sub

Set_Error:

     MsgBox Err.Description, , "Set Error"

     Exit Sub

End Sub


UISetThumbSize Method

See Also	Example-VB
Displays a dialog box from which a user can set the width and height of the thumbnail box.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 95 and 98
√	Imaging for Windows NT 4.0
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 is not 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.


UISetThumbSize Example [image] VB

This example demonstrates how a call to the GetScrollDirectionSize method can be used to calculate the size needed to display 4 thumbnails in the scrolling direction while displaying 2 thumbnails in the non-scrolling direction.

First, the user is allowed to set the thumbnail width and height. The non-scrolling dimension is then derived from the average of the GetMimimumSize and GetMaximumSize methods. In this particular example, the scrolling direction is horizontal.

Private Sub cmdControlSize_Click()

    Dim lMinSize, lMaxSize, lVSize, lHSize As Long

    Dim bScroll As Boolean

    Dim iNonScrollThumbCount As Long

    bScroll = True

    iNonScrollThumbCount = 2        'Number of thumbnails desired in
                                    'non-scrolling direction

    ImgThumbnail1.ScrollDirection = Horizontal

    ImgThumbnail1.UISetThumbSize    'User sets thumb size interactively

    'Determine min and max control size taking a scrollbar into account

    lMinSize = ImgThumbnail1.GetMinimumSize(iNonScrollThumbCount, bScroll)

    lMaxSize = ImgThumbnail1.GetMaximumSize(iNonScrollThumbCount, bScroll)

    lVSize = (lMinSize + lMaxSize) / 2  'Average of the min & max nonscrolling size

    lHSize = ImgThumbnail1.GetScrollDirectionSize(4, iNonScrollThumbCount, lVSize, True)

    'Prior to resizing the Thumbnail control, it is necessary to ensure
    'the unit of   'measure for the form and Thumbnail control are the
    'same. The thumbnail methods return units in pixels - so the scale
    'mode for the form must be set to pixels.

    Form1.ScaleMode = vbPixel

    ImgThumbnail1.Width = lHSize

    ImgThumbnail1.Height = lVSize

End Sub


Events, standard (Thumbnail control)
Standard Events (Thumbnail control)

The following standard Events are used by the Thumbnail control.

*Click	KeyUp
*DblClick	*MouseDown
Error	*MouseMove
KeyDown	*MouseUp
Events with an asterisk (*) use the additional argument, ThumbNumber.

Arguments

Parameter	Data Type	Description
ThumbNumber	Long	The number of the thumbnail on which the event occurred A 0 (zero) value means an event occurred on the control, but not on a thumbnail.


ReadyStateChange Event

See Also	Example-VB
Signals that the state of the control has changed.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
√	Imaging for Windows 98
Applies To

Image Thumbnail control

Syntax

Sub object_ReadyStateChange (ReadyState)

Arguments

Parameter	Data Type	Description
ReadyState	Long	0 [image] Control is initializing and retrieving properties
		2 [image] Control is initialized and the download process has started
		4 [image] Control is ready for all requests
Remarks

Use this event when the Image property specifies a URL for file location.

When this event is fired, check the ReadyState property for the control’s status.


ReadyStateChange Example [image] VB

This example demonstrates how the ReadyState property can be captured and generate a message box indicating the current state of the control.

When the Thumbnail control completes downloading a file, the file will also be displayed in the Image Edit control.

Private Sub ImgThumbnail1_ReadyStateChange(ReadyState As Long)

    sCaption = "Ready State"

    Select Case ImgThumbnail1.ReadyState

        Case 0

            MsgBox "Control is initializing and retrieving properties.", , sCaption

        Case 2

            MsgBox "Control is initialized; download has started.", , sCaption

            ImgThumbnail1.ClearThumbs   'Clear control during download

        Case 4

            MsgBox "Control is ready.", , sCaption

            ImgEdit1.Image = ImgThumbnail1.Image

    End Select

End Sub


ThumbDrag Event

See Also	Example-VB
Drags a specified number of thumbnails from the control.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Thumbnail Control

Syntax

Sub object_ThumbDrag(DragCount, Shift)

Arguments

Parameter	Data Type	Description
DragCount	Long	Number of thumbnails dragged from the Thumbnail control
Shift	Short	Bit mask that details the state of the Ctrl, Shift, and Alt keys, in addition to mouse key information


ThumbDrag Example [image] VB


ThumbDrop Event

See Also	Example-VB
Drops a specified number of thumbnails before a designated thumbnail.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
√	Imaging for Windows 98
Applies To

Image Thumbnail Control

Syntax

Sub object_ThumbDrop(InsertBefore, DropCount, Shift)

Arguments

Parameter	Data Type	Description
InsertBefore	Long	The page number of the thumbnail image before which the dropped item is inserted  A value that is 1 greater than the value of the ThumbCount property indicates an Append operation
DropCount	Long	The number of thumbnails or image files dropped on the Thumbnail control
Shift	Short	Bit mask that details the state of the Ctrl, Shift, and Alt keys, in addition to mouse key information. Drag operations initiated from the Thumbnail control have a bit value of 0x8000.


ThumbDrop Example [image] VB

This example demonstrates how the Thumbnail control can be updated when images are dropped onto it. A message box is displayed detailing the source file and pages as well as the insertion thumbnail for each thumbnail droppped onto the control. The source can be a drop from Explorer, Imaging for Windows, or selected thumbnails from another Thumbnail control.

For this example, the EnableDragDrop property has been set to DropFileDropDragLeftRight. The property must have been set prior to performing any drag or drop operation.

Private Sub ImgThumbnail1_ThumbDrop(ByVal InsertBefore As Long, ByVal DropCount As Long, ByVal Shift As Integer)

    Dim DropMsg As String

    On Error GoTo DropError

    'Loop to process each thumb being dropped; index starts at 0

    For InsertCount = 0 To DropCount - 1

        srcFile = ImgThumbnail1.ThumbDropNames(InsertCount)

        srcPage = ImgThumbnail1.ThumbDropPages(InsertCount)

        'Insert page into image file first, then Thumbnail control

        ImgAdmin1.Insert srcFile, srcPage, InsertBefore, 1
       'Image file saved after insert

        ImgThumbnail1.InsertThumbs InsertBefore, 1

        'Provide information regarding dropped page

        DropMsg = "Page " & Str(srcPage) & " from " & srcFile & " was
            inserted before page " & Str(InsertBefore)

        MsgBox DropMsg, , "Drop Page"

    Next InsertCount

    Exit Sub

DropError:

    ImgThumbnail1.DropFailed = True

    MsgBox Err.Description, , "Drop Error"

End Sub


 Image OCR Control

See Also	Properties	Methods	Events
What the Image OCR control lets you do

The Image OCR control lets you [image] the application developer [image] add optical character recognition functions to applications that support 32-bit ActiveX controls.

The OCR process analyzes an image and identifies text, pictures, and layout. This information is used to reconstruct the document.

You can design your program to process a document automatically or manually. For manual processing, you would prompt the user for layout details (such as single or multiple columns; text, pictures, or both) of the source document. If TIFF images are used, you can provide an option to define text or picture regions of the document with a selection rectangle. This can be useful for processing a single paragraph in the document.

User-defined dictionaries can be used to complement the standard OCR dictionaries, thereby improving word recognition.

The OCR process can be trained to recognize special characters or words. You can display a dialog box that lists words or symbols that the program is unsure of, and enable the user to provide corrections. The corrections and other information are saved in a training file that can be reused.

What the Image OCR control lets your users do

Depending on how you design and code your application, the Image OCR control lets your users convert scanned image documents to formatted, editable text.

Users can convert image documents to one of the following formats:

MS Word for Windows/RTF

WordPerfect

HTML

ASCII text file


Extender Properties (Image OCR)
Image OCR Extender Properties

See Also	Example
This topic lists the Extender properties that are available when the Image OCR control is drawn on a Visual Basic form.

Name	Description
DataBindings	Returns the DataBindings collection object containing the available bindable properties
DataChanged	Returns or sets a value indicating that data in the bound control has changed
DataField	Returns or sets a value that binds a control to a data field
Index	Returns or sets the subscript value of a control in an array of controls
Name	Returns the name of an object
Object	Returns a reference to a property or method of a control that has the same name as a property or method extended to the control
Parent	Returns the form, object, or collection that contains either a control, or another object or collection
Tag	Returns or sets ancillary data
Refer to the Visual Basic on-line help for more information about these properties.


CopytoClipBoard Property

See Also	Example-VB
Specifies that the OCR results are to be placed on the Windows Clipboard.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.CopytoClipBoard[= {True|False}]

Data Type

Boolean

Setting	Description
True	Place results onto the Clipboard
False  (default)	Do not place results on the Clipboard


CopyToClipBoard Example [image] VB

This example demonstrates how OCR results can be output to the clipboard instead of to an output file of the supported types.

Private Sub cmdCopyToClip_Click()

    'If the output type has been set to Text Document, then copy the
    'output to the clipboard. Else save it to a document and launch the
    'associated application.

    If Imgocr1.OutputType = wiAsciiStandard Then

        Imgocr1.CopyToClipBoard = True

    Else

        Imgocr1.OutputFile = "c:\my documents\instructions"

        Imgocr1.LaunchApplication = True

    End If

        Imgocr1.StartOcr 'Begin OCR process

End Sub


Engine Property

See Also	Example
Specifies which OCR engine to use to process image data.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image OCR control

Syntax

object.Engine[=engine identifier]

Data Type

String


Image Property

See Also	Example-VB
Returns or sets the file name of the current image.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.Image[=filename]

Data Type

String

Remarks

The source image must be a TIFF file located on a local or redirected drive, or on a 1.x or 3.x server.

Unless you are performing an OcrFromClipBoard function, you must set this value before processing can be performed.

The image defined in this property must be stored in a file, or the OCR will fail. For example, if you scan an image to display only, you must save it as a file before you can perform an OCR.


Image Example [image] VB

This example demonstrates how various images can be specified by the Image property. It also shows how specific pages within the document can be designated for OCRing by the Pages property.

Private Sub SetImage_Click()

    'Showing syntax to have page 1 of a 1.x Server document OCRed
    'Note: prefix Image:// denotes service name for 1.x server

    Imgocr1.Image = "Image://srvrname\volname:\CAB\DRAWER\FOLDER\YOURDOC"

    Imgocr1.Pages = "1"

    'Showing syntax to have pages 1 & 4 of a 1.x Server filename OCRed

    Imgocr1.Image = "Image://srvrname/volname:/dirname/temp.tif"

    Imgocr1.Pages = "1,4"

    'Specifying a 3.x Server document to OCR pages 3,4, & 5
    'Note: prefix Imagex:// denotes service name for 3.x server

    Imgocr1.Image = "Imagex://Docid1234"

    Imgocr1.Pages = "3-5"

    'Specify an internet image via URL syntax to OCR pages 1,2, & 5

    Imgocr1.Image = "http://www.eastmansoftware.com/sbu/sampimg.tif"

    Pages = "1-2,5"

    'Specify a UNC filename to OCR pages 1,2,5,6, & 7

    Imgocr1.Image = "\\srvrname\shared3\images\bw\thisisa.tif"

    Imgocr1.Pages = "1-2,5-7"

End Sub


Language Property

See Also	Example-VB
Sets the language identifier for OCR processing.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.Language[=value]

Data Type

Long

Constant	Setting	Description
wiSystemDefault	0 (default)	System default
wiEnglish	1	English
wiSpanish	2	Spanish
wiGerman	3	German
wiItalian	4	Italian
wiFrench	5	French
wiDutch	6	Dutch
wiSwedish	7	Swedish
wiNorwegian	8	Norwegian
wiFinnish	9	Finnish
wiDanish	10	Danish
wiPortugese	11	Portugese
wiRussian	12	Russian
wiJapanese	13	Japanese (not supported with the current OCR engine)
Remarks

Set to the language you want to use. Setting the Language property improves recognition of special characters unique to the specified language.


Language Example [image] VB

This example shows how OCR Options - including dictionary, language, and OCR training - might be set prior to performing OCR on the current image.

Private Sub cmdSetTraining_Click()

    Imgocr1.Language = wiEnglish      'Recognize English characters

    Imgocr1.LoadDictionary ("c:\Program Files\Common Files\Microsoft
        Shared\Proof\custom.dic")

    Imgocr1.TrainingFile = "d:\windows\system\german.trn"

    Imgocr1.TrainingFileOptions = 1  'Indicate training is to be interactive

    Imgocr1.TrainingThreshold = 400  'Prompt user for correction if
                                     'confidence level < 400

    Imgocr1.StartOcr

End Sub


LaunchApplication Property

See Also	Example-VB
Specifies whether the application that supports the output file is launched upon completion of OCR processing.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.LaunchApplication[= {True|False}]

Data Type

Boolean

Setting	Description
True (default)	Launches the application
False	Does not launch the application


LaunchApplication Example [image] VB

This example shows how various OCR input and output properties might be set prior to performing OCR on an image.

Private Sub cmdLayout_Click()

    'Set the OCR input options of the source file

    Imgocr1.Quality = wiAutoDetectQ

    Imgocr1.Layout = wiMultipleWithPictures

    Imgocr1.ProcessingMode = 1       'Process only OCR zones

    Imgocr1.RetainPictures = False   'Do not process pictures

    Imgocr1.RetainPageLayout = True  'Source layout retained in output layout

    'Set the OCR output file to HTML type and open it in the associated application

    Imgocr1.OutputType = wiHTML

    Imgocr1.OutputFile = "d:\My Documents\ArticleText.html"

    Imgocr1.LaunchApplication = True

    Imgocr1.StartOcr

End Sub


Layout Property

See Also	Example-VB
Specifies the layout of the image pages to be processed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.Layout[=value]

Data Type

Integer (enumerated)

Constant	Setting	Description
wiAutoDetectL	0 (default)	Auto detect [image] the layout of the original is used in the output.
wiSingleNoPictures	1	Single column with no pictures
wiSingleWithPictures	2	Single column with pictures
wiMultipleNoPictures	3	Multiple columns with no pictures
wiMultipleWithPictures	4	Multiple columns with pictures
wiVerticalSingleNoPictures	5	Vertical text, single column, no pictures
wiVerticalSingleWithPictures	6	Vertical text, single column, with pictures
wiVerticalMultipleNoPictures	7	Vertical text, multiple columns, no pictures
wiVerticalMultipleWithPictures	8	Vertical text, multiple columns, with pictures
Note: Settings 5, 6, 7, and 8 are not supported with the current OCR engine.


Layout Example [image] VB

This example shows how various OCR input and output properties might be set prior to performing OCR on an image.

Private Sub cmdLayout_Click()

    'Set the OCR input options of the source file

    Imgocr1.Quality = wiAutoDetectQ

    Imgocr1.Layout = wiMultipleWithPictures

    Imgocr1.ProcessingMode = 1       'Process only OCR zones

    Imgocr1.RetainPictures = False   'Do not process pictures

    Imgocr1.RetainPageLayout = True  'Source layout retained in output layout

    'Set the OCR output file to HTML type and open it in the associated application

    Imgocr1.OutputType = wiHTML

    Imgocr1.OutputFile = "d:\My Documents\ArticleText.html"

    Imgocr1.LaunchApplication = True

    Imgocr1.StartOcr

End Sub


OcrFromClipBoard Property

See Also	Example-VB
Specifies that the image data on the Windows Clipboard is the source for OCR processing.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.OcrFromClipBoard[= {True|False}]

Data Type

Boolean

Setting	Description
True	Use data from the Clipboard
False (default)	Do not use data from the Clipboard
Data Type

Clipboard image data must be in vbCF_DIB format.

Setting this property enables the Selection pick on the ShowOCR dialog box.


OcrFromClipBoard Example [image] VB

This example demonstrates how to perform OCR on clipboard data pasted from the currently displayed image.

Private Sub cmdOcrClipBoard_Click()

    'Copy an area from the current image to the clipboard

    ImgEdit1.SelectionRectangle = True

    ImgEdit1.DrawSelectionRect 0, 0, 200, 200

    ImgEdit1.ClipboardCopy

    'OCR the clipboard contents to a Text Document and launch
    'its associated application for viewing.

    Imgocr1.OcrFromClipBoard = True

    Imgocr1.OutputType = wiAsciiStandard

    Imgocr1.OutputFile = "c:\My Documents\sample.txt"

    Imgocr1.LaunchApplication = True

    Imgocr1.StartOcr

End Sub


OutputFile Property

See Also	Example-VB
Specifies the name of the output file to which OCR processing results are written.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.OutputFile[=filename]

Data Type

String

Remarks

Any valid Windows 95 filename can be specified. If the output file specified already exists, it will be overwritten.

If a filename is not provided, the Save As dialog box is displayed when OCR processing is complete.

For best results, the file extension set by this property must match the OutputType property. For example, use the .txt extension if  you set ASCII text as the output type.


OutputFile Example

This example shows how various OCR input and output properties might be set prior to performing OCR on an image.

Private Sub cmdLayout_Click()

    'Set the OCR input options of the source file

    Imgocr1.Quality = wiAutoDetectQ

    Imgocr1.Layout = wiMultipleWithPictures

    Imgocr1.ProcessingMode = 1       'Process only OCR zones

    Imgocr1.RetainPictures = False   'Do not process pictures

    Imgocr1.RetainPageLayout = True  'Source layout retained in output layout

    'Set the OCR output file to HTML type and open it in the associated application

    Imgocr1.OutputType = wiHTML

    Imgocr1.OutputFile = "d:\My Documents\ArticleText.html"

    Imgocr1.LaunchApplication = True

    Imgocr1.StartOcr

End Sub


OutputType Property

See Also	Example-VB
Specifies the format for the output file.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.OutputType[=value]

Data Type

Integer (enumerated)

Constant	Setting	Description
wiWordforWindows	0 (default)	Microsoft Word for Windows(versions 6 and 7) and RTF
wiWordPerfect	1	Corel WordPerfect, version 6.1
wiHTML	2	Hypertext Markup Language (HTML)
wiAsciiSmart	3	Smart ASCII Text
wiAsciiStandard	4	Standard ASCII Text
Remarks

For best results, the file extension set by the OutputFile property must match the OutputType value. For example, use the .txt extension if ASCII text is the output type.

When saving the OCR results to a text file, use the Smart ASCII Text option if the original image contains a complicated text layout such as multiple columns.


OutputType Example [image] VB

This example shows how various OCR input and output properties might be set prior to performing OCR on an image.

Private Sub cmdLayout_Click()

    'Set the OCR input options of the source file

    Imgocr1.Quality = wiAutoDetectQ

    Imgocr1.Layout = wiMultipleWithPictures

    Imgocr1.ProcessingMode = 1       'Process only OCR zones

    Imgocr1.RetainPictures = False   'Do not process pictures

    Imgocr1.RetainPageLayout = True  'Source layout retained in output layout

    'Set the OCR output file to HTML type and open it in the associated application

    Imgocr1.OutputType = wiHTML

    Imgocr1.OutputFile = "d:\My Documents\ArticleText.html"

    Imgocr1.LaunchApplication = True

    Imgocr1.StartOcr

End Sub


Pages Property

See Also	Example-VB
Specifies which pages to OCR.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.Pages[=value]

Data Type

String

Remarks

Single page values (for example, 2 or 5), multiple pages (for example, 1, 3, 9), or page ranges (for example, 2-6 or 1-9) can be used.

The default value is a blank string, which means all pages are processed.


Pages Example [image] VB

This example demonstrates how various images can be specifed by the Image property. It also shows how specifiec pages within the document can be designated for OCRing by the Pages property.

Private Sub SetImage_Click()

    'Showing syntax to have page 1 of a 1.x Server document OCRed
    'Note: prefix Image:// denotes service name for 1.x server

    Imgocr1.Image = "Image://srvrname\volname:\CAB\DRAWER\FOLDER\YOURDOC"

    Imgocr1.Pages = "1"

    'Showing syntax to have pages 1 & 4 of a 1.x Server filename OCRed

    Imgocr1.Image = "Image://srvrname/volname:/dirname/temp.tif"

    Imgocr1.Pages = "1,4"

    'Specifying a 3.x Server document to OCR pages 3,4, & 5
    'Note: prefix Imagex:// denotes service name for 3.x server

    Imgocr1.Image = "Imagex://Docid1234"

    Imgocr1.Pages = "3-5"

    'Specify an internet image via URL syntax to OCR pages 1,2, & 5

    Imgocr1.Image = "http://www.eastmansoftware.com/sbu/sampimg.tif"

    Pages = "1-2,5"

    'Specify a UNC filename to OCR pages 1,2,5,6, & 7

    Imgocr1.Image = "\\srvrname\shared3\images\bw\thisisa.tif"

    Imgocr1.Pages = "1-2,5-7"

End Sub


ProcessingMode Property

See Also	Example-VB
Specifies which OCR processing mode to use.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.ProcessingMode[=value]

Data Type

Long

Constant	Setting	Description
wiManual	0	Manual processing, using OCR Zones for all pages specified
wiAutomatic	1 (default)	Automatic processing of all specified pages
Remarks

You cannot perform manual processing on an image that contains only picture zones. At least one text zone must also be included on the page.


ProcessingMode Example [image] VB

This example shows how various OCR input and output properties might be set prior to performing OCR on an image.

Private Sub cmdLayout_Click()

    'Set the OCR input options of the source file

    Imgocr1.Quality = wiAutoDetectQ

    Imgocr1.Layout = wiMultipleWithPictures

    Imgocr1.ProcessingMode = wiAutomatic  'Process only OCR zones

    Imgocr1.RetainPictures = False   'Do not process pictures

    Imgocr1.RetainPageLayout = True  'Source layout retained in output layout

    'Set the OCR output file to HTML type and open it in the associated application

    Imgocr1.OutputType = wiHTML

    Imgocr1.OutputFile = "d:\My Documents\ArticleText.html"

    Imgocr1.LaunchApplication = True

    Imgocr1.StartOcr

End Sub


ProgressDialogCaption Property

See Also	Example-VB
Provides the text that is displayed in the Progress dialog box.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.ProgressDialogCaption[=text]

Data Type

String

Remarks

If a string is not specified, the name of the TIFF file being processed is used.

The default value contains an empty, Null terminated string.


ProgressDialogCaption Example [image] VB

When the OcrProgress event is fired, the Progress dialog is updated at various intervals to indicate the percent the OCR operation has completed for the current page.

Private Sub Imgocr1_OcrProgress(ByVal Percentage As Integer)

'NOTE: The ProgressNotification property must be set to TRUE in order
'for progress events to be sent to the application.

    Imgocr1.ShowProgress = True   'Show progress dialog

    Select Case Percentage

        Case Is > 95

            Imgocr1.ProgressDialogCaption = "almost complete"

        Case Is > 74

            Imgocr1.ProgressDialogCaption = " ~75% complete"

        Case Is > 49

            Imgocr1.ProgressDialogCaption = " ~50% complete"

        Case Is > 24

            Imgocr1.ProgressDialogCaption = " ~25% complete"

        Case Else

            Imgocr1.ProgressDialogCaption = " mydoc.tif"

        End Select

End Sub


ProgressNotification Property

See Also	Example-VB
Specifies whether progress events are sent to the application.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.ProgressNotification[={True|False}]

Data Type

Boolean

Setting	Description
True	Send progress events
False (default)	Do not send progress events
Remarks

Progress information pertains to the current page being processed.


ProgressNotification Example [image] VB

When the OCRProgress event is fired, the Progress dialog is updated at various intervals to indicate the percent the OCR operation has completed for the current page.

Private Sub Imgocr1_OcrProgress(ByVal Percentage As Integer)

'NOTE: The ProgressNotification property must be set to TRUE in order
'for progress events to be sent to the application.

    Imgocr1.ProgressNotification = True   'Send progress events

    Imgocr1.ShowProgress = True           'Show progress dialog

    Select Case Percentage

        Case Is > 95

            Imgocr1.ProgressDialogCaption = "almost complete"

        Case Is > 74

            Imgocr1.ProgressDialogCaption = " ~75% complete"

        Case Is > 49

            Imgocr1.ProgressDialogCaption = " ~50% complete"

        Case Is > 24

            Imgocr1.ProgressDialogCaption = " ~25% complete"

        Case Else

            Imgocr1.ProgressDialogCaption = " mydoc.tif"

        End Select

End Sub


Quality Property

See Also	Example-VB
Specifies the resolution quality of the pages to be processed.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.Quality[=value]

Data Type

Long

Constant	Setting	Description
wiAutoDetectQ	0  (default)	Auto detect
wiFax	1	FAX
wiDotMatrix	2	Dot matrix printer
wiNormal	3	Normal


Quality Example [image] VB

This example shows how various OCR input and output properties might be set prior to performing OCR on an image.

Private Sub cmdLayout_Click()

    'Set the OCR input options of the source file

    Imgocr1.Quality = wiAutoDetectQ

    Imgocr1.Layout = wiMultipleWithPictures

    Imgocr1.ProcessingMode = 1       'Process only OCR zones

    Imgocr1.RetainPictures = False   'Do not process pictures

    Imgocr1.RetainPageLayout = True  'Source layout retained in output layout

    'Set the OCR output file to HTML type and open it in the associated application

    Imgocr1.OutputType = wiHTML

    Imgocr1.OutputFile = "d:\My Documents\ArticleText.html"

    Imgocr1.LaunchApplication = True

    Imgocr1.StartOcr

End Sub


ReadyState Property

See Also	Example-VB
Returns the state of the OCR control’s properties.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image OCR control

Syntax

object.ReadyState[=value]

Data Type

Long

Setting	Description
0	Control is initializing and retrieving properties
2	Control is initialized and the download process has started
4	Control is ready for all requests
Remarks

This property is read-only.

Used for asynchronous downloading of images from a Web site (Image property set to a URL).

When downloading images from a Web site, you cannot call the StartOcr method until the ReadyState property is set to 4.

If the image file specified is not a URL, the ReadyState property will always have a default value of 4.


ReadyState Example [image] VB

This example demonstrates how the ReadyState property can be captured and generate a message box indicating the current state of the control.

Private Sub Imgocr1_ReadyStateChange(ReadyState As Long)

    sCaption = "Ready State"

    Select Case ReadyState

        Case 0

            MsgBox "Control is initializing and retrieving properties.", , sCaption

        Case 2

            MsgBox "Control is initialized; download has started.", , sCaption

        Case 4

            MsgBox "Control is ready.", , sCaption

    End Select

End Sub


RetainPageLayout Property

See Also	Example-VB
Specifies whether the column layout of the image document being processed is retained in the output.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.RetainPageLayout[={True|False}]

Data Type

Boolean

Setting	Description
True (default)	Retain column layout
False	Do not retain column layout
Remarks

This property does not apply to .txt format.

Columns are not retained in HTML, but this property affects the placement of pictures in the HTML file (if applicable).


RetainPageLayout Example [image] VB

This example shows how various OCR input and output properties might be set prior to performing OCR on an image.

Private Sub cmdLayout_Click()

    'Set the OCR input options of the source file

    Imgocr1.Quality = wiAutoDetectQ

    Imgocr1.Layout = wiMultipleWithPictures

    Imgocr1.ProcessingMode = 1       'Process only OCR zones

    Imgocr1.RetainPictures = False   'Do not process pictures

    Imgocr1.RetainPageLayout = True  'Source layout retained in output layout

    'Set the OCR output file to HTML type and open it in the associated application

    Imgocr1.OutputType = wiHTML

    Imgocr1.OutputFile = "d:\My Documents\ArticleText.html"

    Imgocr1.LaunchApplication = True

    Imgocr1.StartOcr

End Sub


RetainPictures Property

See Also	Example-VB
Specifies whether pictures from the image document being processed are retained in the output.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.RetainPictures[={True|False}]

Data Type

Boolean

Setting	Description
True (default)	Retain pictures
False	Do not retain pictures
Remarks

This property does not apply to .txt format.


RetainPictures Example [image] VB

This example shows how various OCR input and output properties might be set prior to performing OCR on an image.

Private Sub cmdLayout_Click()

    'Set the OCR input options of the source file

    Imgocr1.Quality = wiAutoDetectQ

    Imgocr1.Layout = wiMultipleWithPictures

    Imgocr1.ProcessingMode = 1       'Process only OCR zones

    Imgocr1.RetainPictures = False   'Do not process pictures

    Imgocr1.RetainPageLayout = True  'Source layout retained in output layout

    'Set the OCR output file to HTML type and open it in the associated application

    Imgocr1.OutputType = wiHTML

    Imgocr1.OutputFile = "d:\My Documents\ArticleText.html"

    Imgocr1.LaunchApplication = True

    Imgocr1.StartOcr

End Sub


ShowProgress Property

See Also	Example-VB
Specifies if an OCR progress dialog box is displayed during the OCR process.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.ShowProgress[={True|False}]

Data Type

Boolean

Setting	Description
True (default)	Display dialog box
False	Do not display dialog box


ShowProgress Example [image] VB

When the OCRProgress event is fired, the Progress dialog is updated at various intervals to indicate the percent the OCR operation has completed for the current page.

Private Sub Imgocr1_OcrProgress(ByVal Percentage As Integer)

'NOTE: The ProgressNotification property must be set to TRUE in order
'for progress events to be sent to the application.

    Imgocr1.ShowProgress = True   'Show progress dialog

    Select Case Percentage

        Case Is > 95

            Imgocr1.ProgressDialogCaption = "almost complete"

        Case Is > 74

            Imgocr1.ProgressDialogCaption = " ~75% complete"

        Case Is > 49

            Imgocr1.ProgressDialogCaption = " ~50% complete"

        Case Is > 24

            Imgocr1.ProgressDialogCaption = " ~25% complete"

        Case Else

            Imgocr1.ProgressDialogCaption = " mydoc.tif"

        End Select

End Sub


StatusCode Property

See Also	Example-VB
Reports the error code that occurred after a property was set or a method called.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.StatusCode[=value]

Data Type

Integer (enumerated)

Value	Description
0 (default)	Success
1	OCR results cannot be converted to the format specified
2	Unable to start OCR processing
3	The OCR server cannot be initialized – it may already be running
4	An invalid converter name was specified
5	An invalid filename was specified
6	An invalid OCR property was specified
7	The OCR dictionaries cannot be loaded
8	OCR language support cannot be loaded
9	OCR processing canceled due to an unrecoverable recognition error
10	Unable to shut down the OCR server
11	Image filename not found
12	Unable to perform processing because the OCR server was not started
13-17	Reserved
18	Cannot create the OCR output file
19	OCR cannot open or read the image file
20	OCR cannot preprocess the image page
21	OCR cannot recognize the image
22	OCR settings, or the OCR dialog box was canceled
23	Reserved
24	OCR cannot turn on page layout support
25	Unable to set the internal timer for OCR processing
26	Cannot open, read, or save Training File information
27	An error occurred while accessing the Windows clipboard
28	OCR processing was canceled by the user
29	Reserved
30	An error occurred while converting to a bi-tonal image
31	An error occurred while converting to a bi-tonal image
32	A Windows error was received while converting to a bi-tonal image
33	A TextBridge error was received while converting to a bi-tonal image
34	The OCR server task is no longer running
35	The pages specified contain no valid pages to OCR
36	An Output Document name was not specified in the SaveAs dialog
37	Unable to delete ICR output document
38	OCR style sheet could not be created
39	Text was not found,or not recognized
40	Unsupported image resolution
Remarks

This is a read-only property.


StatusCode Example [image] VB

This example demonstrates how the OcrComplete event may be used to inform the user of the outcome of the OCR process.

Private Sub Imgocr1_OcrComplete(ByVal Status As Integer)

    If Status = 100 Then

        'Display successful OCR message

        MsgBox "OCR completed successfully.", , "OCR Status"

    Else

        'Display message indication OCR was unsuccessful and an error code

        MsgBox "OCR unsuccesful; Status code = " & Str(Imgocr1.StatusCode), , "OCR Status"

    End If

End Sub


TrainingFile Property

See Also	Example-VB
Specifies the name of the training file.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.TrainingFile[=filename]

Data Type

String

Remarks

This property must be set before any training functions can be performed.

The default value is an empty string, which means training is not performed.


TrainingFile Example [image] VB

This example shows how OCR Options - including dictionary, language, and OCR training - might be set prior to performing OCR on the current image.

Private Sub cmdSetTraining_Click()

    Imgocr1.Language = wiEnglish      'Recognize English characters

    Imgocr1.LoadDictionary ("c:\Program Files\Common Files\Microsoft
        Shared\Proof\custom.dic")

    Imgocr1.TrainingFile = "d:\windows\system\german.trn"

    Imgocr1.TrainingFileOptions = 1  'Indicate training is to be interactive

    Imgocr1.TrainingThreshold = 400  'Prompt user for correction if
                                     'confidence level < 400

    Imgocr1.StartOcr

End Sub


TrainingFileOptions Property

See Also	Example-VB
Specifies how the training file is used.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.TrainingFileOptions[=value]

Data Type

Long

Constant	Setting	Description
wiSave	0 (default)	The training file specified in the TrainingFile property is used without interactive training
wiInteractiveSave	1	The training file specified is used, interactive training occurs, and the data is saved to the file specified by the TrainingFile property.
Remarks

If the TrainingFile property is not set, this property is ignored.


TrainingFileOptions Example [image] VB

This example shows how OCR Options - including dictionary, language, and OCR training - might be set prior to performing OCR on the current image.

Private Sub cmdSetTraining_Click()

    Imgocr1.Language = wiEnglish      'Recognize English characters

    Imgocr1.LoadDictionary ("c:\Program Files\Common Files\Microsoft
        Shared\Proof\custom.dic")

    Imgocr1.TrainingFile = "d:\windows\system\german.trn"

    'Indicate training is to be interactive

    Imgocr1.TrainingFileOptions = wiInteractiveSave

    Imgocr1.TrainingThreshold = 400  'Prompt user for correction if
                                     'confidence level < 400

    Imgocr1.StartOcr

End Sub


TrainingThreshold Property

See Also	Example-VB
Specifies a threshold value that is used by the interactive training mode.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.TrainingThreshold[=value]

Data Type

Long

Remarks

Any character with a confidence value less than the specified threshold value causes the program to prompt the user for correction.

Valid values can be 0 to 999, inclusive. The default value is 200.


TrainingThreshold Example [image] VB

This example shows how OCR Options - including dictionary, language, and OCR training - might be set prior to performing OCR on the current image.

Private Sub cmdSetTraining_Click()

    Imgocr1.Language = wiEnglish    'Recognize English characters

    Imgocr1.LoadDictionary ("c:\Program Files\Common Files\Microsoft
        Shared\Proof\custom.dic")

    Imgocr1.TrainingFile = "d:\windows\system\german.trn"

    Imgocr1.TrainingFileOptions = 1  'Indicate training is to be interactive

    Imgocr1.TrainingThreshold = 400  'Prompt user for correction if
                                     'confidence level < 400

    Imgocr1.StartOcr

End Sub


UnsupportedIsError Property

See Also	Example
Specifies if an error is generated when setting/getting a property, or calling a method that is not supported (that is, the result of a GetCapability query is False).

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image OCR control

Syntax

object.ShowProgress[={True|False}]

Data Type

Boolean

Setting	Description
True (default)	If the requested property or method is not supported, an error is thrown
False	If the requested property or method is not supported, the operation is ignored


GetCapability Property
GetCapability Method

See Also	Example
Queries the OCR engine specified by the Engine property to see if it supports a specified capability.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image OCR control

Syntax

object.GetCapability(capability, option)

Data Type

Long

Capability Constant	Setting	Item Supported
wiCapRecomposition	0	recomposition feature
wiCapImageZones	1	image zones feature
wiCapLanguage	2	language feature
wiCapOutputType	3	output type feature
wiCapInputType	4	input type feature
wiCapInputLayout	5	input layout feature
wiCapProgressDialogCaption	100 (&H64)	ProgressDialogCaption property
wiCapProgressNotification	101 (&H65)	ProgressNotification property
wiCapQuality	102 (&H66)	Quality property
wiCapRetainPageLayout	103 (&H67)	RetainPageLayout property
wiCapTrainingFile	104 (&H68)	TrainingFile property
wiCapTrainingFileOptions	105 (&H69)	TrainingFileOptions property
wiCapTrainingThreshold	106 (&H6A)	TrainingThreshold property
wiCapLoadDictionary	200 (&HC8)	LoadDictionary method
wiCapShowOcr	201 (&HC9)	ShowOcr method
wiCapShowOcrOptions	202 (&HCA)	ShowOcrOptions method
wiCapStopOcr	203 (&HCB)	StopOcr method
wiOCRProgress	300 (&H12C	OcrProgress event
Data Type

Long

Note: Several Capability values [image] Language, OutputType, InputType, and InputLayout [image] require a value for the Option parameter. For all other Capability values, Option should be zero.

Language Constants	Setting	Description
wiSystemDefault	0	default value
wiEnglish	1	English
wiSpanish	2	Spanish
wiGerman	3	German
wiItalian	4	Italian
wiFrench	5	French
wiDutch	6	Dutch
wiSwedish	7	Swedish
wiNorwegian	8	Norwegian
wiFinnish	9	Finnish
wiDanish	10	Danish
wiPortugese	11	Portugese
wiRussian	12	Russian
wiJapanese	13	Japanese
OutputType Constants	Setting	Description
wiWordforWindows	0 (default)	Microsoft Word for Windows (versions 6 and 7) and RTF
wiWordPerfect	1	Corel WordPerfect, version 6.1
wiHTML	2	Hypertext Markup Language (HTML)
wiAsciiSmart	3	Smart ASCII Text
wiAsciiStandard	4	Standard ASCII Text
InputType Constants	Setting	Description
wiOCRInBMP	0	Windows BMP
wiOCRInTiffUncompressed	1	uncompressed TIFF file
wiOCRInPackBits	2	TIFF file using Pack Bits compression
wiOCRInTiffG3	3	TIFF file using G3 compression
wiOCRInTiffG3MH	4	TIFF file using G3MH compression
InputLayout Constants	Setting	Description
wiAutoDetectL	0 (default)	Auto detect [image] the layout of the original is used in the output.
wiSingleNoPictures	1	Single column with no pictures
wiSingleWithPictures	2	Single column with pictures
wiMultipleNoPictures	3	Multiple columns with no pictures
wiMultipleWithPictures	4	Multiple columns with pictures
wiVerticalSingleNoPictures	5	Vertical text, single column, no pictures
wiVerticalSingleWithPictures	6	Vertical text, single column, with pictures
wiVerticalMultipleNoPictures	7	Vertical text, multiple columns, no pictures
wiVerticalMultipleWithPictures	8	Vertical text, multiple columns, with pictures
Note: Settings 5, 6, 7, and 8 are not supported with the current OCR engine.

Return Value

Boolean

The return value indicates if the capability specified is available on the current OCR engine.

Setting	Description
True	The feature/property/method/event is available.
False	The feature/property/method/event is not available.


GetEngineDescription Method

See Also	Example-VB
Returns the description associated with the specified OCR engine.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image OCR control

Syntax

object.GetEngineDescription(szEngine)

Arguments

Parameter	Data Type	Description
szEngine	String	The name of an OCR engine
Return Value

String describing the engine.


GetEngineList Method

See Also	Example-VB
Returns the identifiers of installed OCR engines. If more than one engine is installed, the identifiers returned are delimited by carriage returns.

Available With

√	Imaging for Windows Professional Edition V2.5
Applies To

Image OCR control

Syntax

object.GetEngineList

Arguments

None

Return Value

String


LoadDictionary Method

See Also	Example-VB
Loads a user-defined dictionary for the OCR server to use.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.LoadDictionary DictionaryFile

Arguments

Parameter	Data Type	Description
DictionaryFile	String	The name of a dictionary
Return Value

Boolean

The return value indicates if a dictionary was loaded.

Setting	Description
True	The dictionary specified was loaded.
False	The dictionary was not loaded.
Remarks

If you want to use a dictionary, this method must be called before the StartOcr method is called.

If a dictionary is specified, it is loaded.


LoadDictionary Example [image] VB

This example shows how OCR Options - including dictionary, language, and OCR training - might be set prior to performing OCR on the current image.

Private Sub cmdSetTraining_Click()

    Imgocr1.Language = wiEnglish      'Recognize English characters

    Imgocr1.LoadDictionary ("c:\Program Files\Common Files\Microsoft
        Shared\Proof\custom.dic")

    Imgocr1.TrainingFile = "d:\windows\system\german.trn"

    Imgocr1.TrainingFileOptions = 1  'Indicate training is to be interactive

    Imgocr1.TrainingThreshold = 400  'Prompt user for correction if
                                     'confidence level < 400

    Imgocr1.StartOcr

End Sub


SetDefaultValues Method

See Also	Example-VB
 Sets all property values to their defaults.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.SetDefaultValues [UseSystemSettings]

Arguments

Parameter	Data Type	Description
UseSystemSettings	Boolean	Optional.  False [image] (default) restore to original OCR default values True [image] restore to defaults in the registration database
Return Value

None


SetDefaultValues Example [image] VB

Prior to starting OCR process, this example prompts the user to

set layout, output and page properties

set OCR options - language, dictionary, and training

Private Sub cmdOcrOptions_Click()

    Imgocr1.SetDefaultValues (True)         'Return OCR properties
                                            'to system defaults

    ret1 = Imgocr1.ShowOcr                  'Display OCR layout and
                                            'output dialog

    If ret1 = CancelDialog Then Exit Sub    'Do not OCR if user pressed Cancel

    ret2 = Imgocr1.ShowOcrOptions           'Display OCR Options dialog

    If ret2 = CancelDialog Then Exit Sub    'Do not OCR if user pressed Cancel

    Imgocr1.StartOcr

End Sub


ShowOcr Method

See Also	Example-VB
Displays a dialog box for OCR settings.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.ShowOcr

Arguments

None

Return Value

Long

Setting	Description
0	Dialog box was canceled.
1	OK was pressed.
Remarks

The dialog box contains the following fields:

OCR Input	OCR Output	Page Range
Quality Layout Recognize	Output Format Page layout Retain/discard pictures	All Current Page Specified pages Selection
The following properties are used to set the initial values when the dialog box is opened.

Layout	Pages	RetainPageLayout
OcrFromClipboard	Processing Mode	RetainPictures
OutputType	Quality
If OcrFromClipboard is set to true, the selection field is enabled and selected.

Entries made to dialog box fields change the values of the properties listed above.

The Pages property is set to zero if Current Page is selected, and to a blank string if All is selected.

Before you call the StartOcr method, the Pages property must reflect the current page number.

The Options button open the Options dialog box. Refer to the ShowOcrOptions method.


ShowOcr Example [image] VB

Prior to starting OCR process, this example prompts the user to

set layout, output and page properties

set OCR options - language, dictionary, and training

Private Sub cmdOCROptions_Click()

    Imgocr1.SetDefaultValues (True)         'Return training file options
                                            'to system defaults

    ret1 = Imgocr1.ShowOcr                  'Display OCR layout and
                                            'output dialog

    If ret1 = CancelDialog Then Exit Sub    'Do not OCR if user pressed Cancel

    ret2 = Imgocr1.ShowOcrOptions           'Display OCR Options dialog

    If ret2 = CancelDialog Then Exit Sub    'Do not OCR if user pressed Cancel

    Imgocr1.StartOcr

End Sub


ShowOcrOptions Method

See Also	Example-VB
Displays the OCR Options dialog box for selecting OCR processing options.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.ShowOcrOptions

Return Value

Boolean

Setting	Description
0	Dialog box was canceled
1	OK was pressed
Remarks

The dialog box contains the following fields:

OCR Training	Custom Dictionaries	Language
Training file Interactive training	list box of available dictionaries	list box of available languages
If Interactive training is selected, a training dialog box is displayed while the OCR process is running. If the training dialog box is closed, OCR processing continues, but the Training process stops.

The following properties are used to set the initial values when the dialog box is opened.

Language	TrainingFile	TrainingFileOptions
Changing the values in the dialog box also changes the values for the properties listed above, and for the LoadDictionary method.

Any dictionaries that are selected are loaded when the user chooses the OK button.


ShowOcrOptions Example [image] VB

Prior to starting OCR process, this example prompts the user to

set layout, output and page properties

set OCR options - language, dictionary, and training

Private Sub cmdOCROptions_Click()

    Imgocr1.SetDefaultValues (True)         'Return training file options
                                            'to system defaults

    ret1 = Imgocr1.ShowOcr                  'Display OCR layout and
                                            'output dialog

    If ret1 = CancelDialog Then Exit Sub    'Do not OCR if user pressed Cancel

    ret2 = Imgocr1.ShowOcrOptions           'Display OCR Options dialog

    If ret2 = CancelDialog Then Exit Sub    'Do not OCR if user pressed Cancel

    Imgocr1.StartOcr

End Sub


StartOcr Method

See Also	Example-VB
Perform character recognition and recomposition.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.StartOcr

Arguments

None

Return Value

Boolean

Setting	Description
True	OCR recognition completed and recomposition is in progress
False	Recognition process halted
Remarks

The image is specified by the Image property.


StartOcr Example [image] VB

Prior to starting OCR process, this example prompts the user to

set layout, output and page properties

set OCR options - language, dictionary, and training

Private Sub cmdOCROptions_Click()

    Imgocr1.SetDefaultValues (True)         'Return training file options
                                            'to system defaults

    ret1 = Imgocr1.ShowOcr                  'Display OCR layout and
                                            'output dialog

    If ret1 = CancelDialog Then Exit Sub    'Do not OCR if user pressed Cancel

    ret2 = Imgocr1.ShowOcrOptions           'Display OCR Options dialog

    If ret2 = CancelDialog Then Exit Sub    'Do not OCR if user pressed Cancel

    Imgocr1.StartOcr

End Sub


StopOcr Method

See Also	Example-VB
Cancels the OCR recomposition process.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

object.StopOcr

Arguments

None

Return Value

Boolean

Setting	Description
True	Recomposition processing is canceled
False	Recomposition cannot be canceled


StopOcr Example [image] VB

This example demonstrates how the StopOCR method can be invoked via a Cancel button. This might be the code behind the command button on a user-defined progress dialog.

Note: The standard OCR progress dialog is presented when the ProgressNotification property is set to TRUE.)

Private Sub cmdCancelOCR_Click()

    'Stop the OCr process and close the progress dialog

    Imgocr1.StopOcr

    Unload frmProgress

End Sub


OcrComplete Event

See Also	Example-VB
Signals the completion of OCR processing.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

Sub object_OCRComplete(status)

Argument

Parameter	Data Type	Setting
status	Short	100 [image] OCR completed sucessfully -1 [image] An error occurred and recognition was terminated
Remarks

This event is triggered when processing is finished.


OcrComplete Example [image] VB

This example demonstrates how the OcrComplete event can be used to inform the user of the outcome of the OCR process.

Private Sub Imgocr1_OcrComplete(ByVal Status As Integer)

    If Status = 100 Then

        'Display successful OCR message

        MsgBox "OCR completed successfully.", , "OCR Status"

    Else

        'Display message indication OCR was unsuccessful and an error code

        MsgBox "OCR unsuccessful; Status code = " & Str(Imgocr1.StatusCode), , "OCR Status"

    End If

End Sub


OcrProgress Event

See Also	Example-VB
Indicates the degree of completion of the OCR processing operation.

Available With

√	Imaging for Windows Professional Edition V1.0, V1.1, V2.0, and V2.5
Applies To

Image OCR control

Syntax

Sub object_OCRProgress(percentage)

Argument

Parameter	Data Type	Setting
percentage	Short	Percentage of completion from 0 to 100.
Remarks

When this event is fired, the percent of the OCR operation completed for an image file is indicated.

The ProgressNotification property must be set to True for this event to occur.


OcrProgress Example [image] VB

When the OCRProgress event is fired, the Progress dialog is updated at various intervals to indicate the percent the OCR operation has completed for the current page.

Private Sub Imgocr1_OcrProgress(ByVal Percentage As Integer)

'NOTE: The ProgressNotification property must be set to TRUE in order
'for progress events to be sent to the application.

    Imgocr1.ShowProgress = True   'Show progress dialog

    Select Case Percentage

        Case Is > 95

            Imgocr1.ProgressDialogCaption = "almost complete"

        Case Is > 74

            Imgocr1.ProgressDialogCaption = " ~75% complete"

        Case Is > 49

            Imgocr1.ProgressDialogCaption = " ~50% complete"

        Case Is > 24

            Imgocr1.ProgressDialogCaption = " ~25% complete"

        Case Else

            Imgocr1.ProgressDialogCaption = " mydoc.tif"

        End Select

End Sub


ReadyStateChange Event

See Also	Example-VB
Signals that the state of the control has changed.

Available With

√	Imaging for Windows Professional Edition V2.0 and V2.5
Applies To

Image OCR control

Syntax

Sub object_ReadyStateChange()

Remarks

Use this event when the Image property specifies a URL for file location.

When this event is fired, check the ReadyState property for status.


ReadyStateChange Example [image] VB

This example demonstrates how the ReadyState property can be captured and generate a message box indicating the current state of the control.

Private Sub Imgocr1_ReadyStateChange(ReadyState As Long)

    sCaption = "Ready State"

    Select Case ReadyState

        Case 0

            MsgBox "Control is initializing and retrieving properties.", , sCaption

        Case 2

            MsgBox "Control is initialized; download has started.", , sCaption

        Case 4

            MsgBox "Control is ready.", , sCaption

    End Select

End Sub


Server Access Object

What the Server Access Object lets you do

Imaging for Windows Professional Edition limits how you can manipulate 1.x server images using file or document access. The Server Access Object (SAO) is a COM object that provides enhanced 1.x server access capabilities. Using the SAO, you can write applications that use the 1.x server as both a file server and an image server.

The Server Access Object implements 4 read-write properties, which include Get and Put capabilities, and 23 methods. Using these properties and methods, you can copy 1.x files from client to server, server to client, and from server to server. You can insert server-resident files, regardless of file type, into 1.x documents, and you can retrieve certain important characteristics of server storage volumes.

The Server Access Object works with the existing image controls, but is independent of them. For example, setting the properties and calling the methods of the Server Access Object will not affect the properties and methods of the other controls. You can create 1x documents that are partially or completely inaccessible via the existing controls, and also from Imaging for Windows applications.

Server-resident object names

The Server Access Object requires that pathnames of all server-resident objects be specified according to the convention adopted by the existing controls. These pathnames must then be of the form:

Image://ServerName/VolumeName:PathToObject

The object can be one of the following:

volume, file directory, file, cabinet, drawer, folder, or document.

In the prefix string "Image://", the slashes must be forward slashes. In the rest of the pathname, either forward or backward slashes can be used to delimit pathname components. The colon (:) character is required to delimit the volume name.

Note: In the descriptions of Server Access Object properties and methods, the term "current" refers to the object set by the related property. For example, "current file" means the file set by the File property, and "current document" means the document set by the Document property.


Document Property

Sets or returns the name of a 1.x document, using a fully-qualified path.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.Document[=DocumentPath]

Data Type

String

Remarks

Because it is not necessary for a document specified by the Document property to exist, the property does not verify the existence of that document. The Document property does, however, verify that the specified document path follows the convention used by other Eastman Software imaging controls. That is, it must include the 1.x name prefix "Image://". Also, if the cabinet referenced contains folders rather than drawers, the cabinet name and folder name must be separated by 2 delimiters (for example, slashes), as shown below.

Image://server\volume:\cabinet\\folder\document


DocumentPage Property

Sets or returns a page number contained in the current document.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.DocumentPage[=DocumentPageNumber]

Data Type

Long

Remarks

The document page does not have to exist when this property is set.

It is not necessary to set the Document property before setting the DocumentPage property.


File Property

Sets or returns a current server-resident file name using a fully-qualified path.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.File[=FilePath]

Data Type

String

Remarks

Because a file set by the File property does not have to exist, the property does not verify the existence of that file. The File property does, however, verify that the specified file path follows the convention used by other Eastman Software imaging controls. That is, it includes the 1.x name prefix "Image://".


FilePage Property

Sets or returns a page number in the current file.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.FilePage[=FilePageNumber]

Data Type

Long

Remarks

The page number does not have to exist when the FilePage property is set. If the file exists, no verification performed on the number of pages that it contains.

It is not necessary to set the File property before setting the FilePage property.


CopyDocument Method

Copies the source document to the destination document. You can specify whether to overwrite or retain the destination document.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Server Access Object

object.CopyDocument(BSTR SourceDocument, BSTR DestDocument, BOOL OverwriteDest)

Parameters

Parameter	Data Type	Description
SourceDocument	String	Full path to the source document to copy.
DestDocument	String	Full path to the destination document location
OverwriteDest	Boolean	True - overwrite the destination document False - do not overwrite the destination document
Remarks

The document paths specified must reside on a 1.x server. A sample document path is shown below:

Image://server/volume:\cabinet\drawer\folder\document

If either the source or destination path is NULL (empty string), the current document value is used.

If the destination document does not exist, this method will create it.

This method does not recognize the “Link files on reference” flag set by the Image Admin control.

Although 1.x documents can include references to pages in other documents, this method does not verify the existence or accessibility of those pages.


CopyFile Method

Copies the source file to the destination file, and, optionally overwrites the destination file.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.CopyFile(BSTR SourceFilePath, BSTR DestFilePath, BOOL OverwriteDest)

Parameters

Parameter	Data Type	Description
SourceFilePath	String	Full path to the source file copy
DestFilePath	String	Full path to the destination file location
OverwriteDest	Boolean	True - overwrite the destination file False - do not overwrite the destination file
Remarks

The specified file paths can either be local or reside on a server. If either file path is NULL (that is, an empty string), the current will be used. This method recognizes the "Force lower-case file names" flag, set by either the Server Access Object or the Image Admin Control. The default is FALSE (names are not forced to lower-case) if the flag is not set.


CreateDocument Method

Creates an empty document (that is, a document with no pages).

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.CreateDocument(BSTR DocumentPath)

Parameters

Parameter	Data Type	Description
DocumentPath	String	Full path to the document to be created


DeleteMapping Method

Deletes a number (PageCount) of pages from the page map of the current document. Deletion begins with the current document page.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.DeleteMapping(long PageCount)

Parameters

Parameter	Data Type	Description
PageCount	Long	Number of pages to be deleted from the document page map
Remarks

The Document and DocumentPage properties must each be set before DeleteMapping is called.

If there are fewer than PageCount pages between the current document page and the end of the document, all pages, starting at the current page, will be removed from the page map.

The files that are referenced by the entries being removed from the map are not affected by this operation. In other words, this method does not recognize the "Delete files with pages" flag set by the Image Admin Control. To delete these files, use the Delete method of the Image Admin Control.


DoesObjectExist Method

Verifies the existence of the specified object, which can be a file directory, file, cabinet, drawer, folder, or document.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.DoesObjectExist(BSTR ObjectPath)

Parameters

Parameter	Data Type	Description
ObjectPath	String	Full path to object
Return Value

Value	Description
0	object does not exist
1	object exists, and is a file or document
2	object exists, and is a container (file directory, cabinet, drawer, or folder)


FindFirstFile Method

Opens the specified 1.x file directory and returns the name and attributes of the first directory entry.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.FindFirstFile(BSTR DirectoryPath, BSTR *DirectoryEntry, long *EntryAttrs)

Parameters

Parameter	Data Type	Description
DirectoryPath	String	Full path to the directory
*DirectoryEntry	String	Name of the first directory entry returned
*EntryAttrs	Long	Attributes of the first directory entry returned. Possible values are: 0 - normal file 1 - read-only file 16 - subdirectory
Return Value

Int

Remarks

The int value returned by the method is a directory ID, required for subsequent access to the directory. If the directory is empty, the directory entry returned will be blank ("").

The directory is left open for subsequent access by the FindNextFile method.

See Also

FindNextFile method

FindClose method


FindNextFile Method

Returns the name and attributes of the next directory entry (file or sub-directory).

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.FindNextFile(int DirID, BSTR *DirectoryEntry, long *EntryAttrs)

Parameters

Parameter	Data Type	Description
DirID	Integer	The directory ID returned by the FindFirstFile method
*DirectoryEntry	String	Name of the first directory entry returned.
*EntryAttrs	Long	Attributes of the first directory entry returned. Possible values are: 0 - normal file 1 - read-only file 16 - subdirectory
Remarks

If there are no more entries in the directory, the directory entry returned will be blank ("").

The directory is left open for subsequent access by this method.

See Also

FindFirstFile method

FindClose method


FindClose Method

Closes the open 1.x file directory.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.FindClose(int DirID)

Parameters

Parameter	Data Type	Description
DirID	Integer	The directory ID returned by the FindFirstFile method
See Also

FindFirstFile method

FindNextFile method


ForceLowerCase1x Method

Specifies whether file paths and file names are converted to lower-case before being passed to the 1.x file service.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.ForceLowerCase1x(BOOL ForceLowerCase)

Parameters

Parameter	Data Type	Description
ForceLowerCase	Boolean	True - all file paths and names are converted to lower-case False - file paths and names are left as-is


GetDocumentDates Method

Returns the creation and modification dates of the current document.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Server Access Object

Syntax

object.GetDocumentDates(Variant *CreationDate, Variant *ModDate)

Parameters

Parameter	Data Type	Description
*CreationDate	Variant	Date the document was created
*ModDate	Variant	Date the document was modified
Remarks

Because the Variant return values are of type VT_DATE, the variant data values are COleDateTime (MFC).

The dates returned are determined by the server. If the server has rewritten a file for any reason, it modifies the creation date.

If you are not sure if the document exists, call the SAO DoesObjectExist method before calling GetDocumentDates.


GetDocumentPageCount Method

Returns the count of pages in the current document. This count is simply an enumeration of all the pages in the document page map.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.GetDocumentPageCount( )

Return Value

Long


GetFileDates Method

Returns the creation and modification dates of the current directory entry, (that is, the entry most recently returned by the FindFirstFile or FindNextFile methods.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.GetFileDates(VARIANT *CreationDate, VARIANT *ModDate)

Parameters

Parameter	Data Type	Description
*CreationDate	Variant	File creation date returned
*ModDate	Variant	File modification date returned
Remarks

The variant return values are of type VT_DATE; therefore, the variant data values are COleDateTime (MFC).


GetKeywords Method

Returns a list of keywords associated with the current document, and the number of keywords in the list.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Server Access Object

Syntax

object.GetKeywords(BSTR* pKeys, int* NumKeys)

Parameters

Parameter	Data Type	Description
pKeys	String	Pointer to the list of keywords, which are separated by commas.
NumKeys	Int	Number of keywords found
Remarks

The buffer returned by this function must be freed by the application.


GetMapping Method

Sets the File and FilePage properties to the file and page-in-file mapped to the current page of the current document.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.GetMapping( )

Remarks

The Document and DocumentPage properties must be set before GetMapping is called.


GetUniqueName Method

Creates a unique file name in the specified directory. Optionally, a template and name extension can be specified.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.GetUniqueName(BSTR DirectoryPath, BSTR NameTemplate, BSTR NameExtension, BSTR* FileName)

Parameters

Parameter	Data Type	Description
DirectoryPath	String	Full path to the directory in which the unique name will be created
NameTemplate	String	Template string to be used in creating the unique name
NameExtension	String	File extension to be used in creating the unique name
FileName	String*	Unique file name returned
Remarks

The template is a string of 4 or less valid filename characters. The resulting filename will be the template string, with, if specified, a random number appended.

Because this method creates the name and not the file, it is possible that the name will not be "unique" by the time it is actually used.

Because GetUniqueName does not verify that the NameTemplate and NameExtension strings contain valid filename characters, it is possible for an invalid filename to be returned.


GetVersion Method

Returns the product version number of the Server Access Object.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Server Access Object

Syntax

object.GetVersion(void)

Return Value

String

Remarks

The value is returned in the form:

A.B.CCCC

where CCCC is the build label


GetVolumeCapacity Method

This method returns the capacity, in kilobytes, of the specified volume.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.GetVolumeCapacity(BSTR Volume)

Parameters

Parameter	Data Type	Description
Volume	String	Full path to the volume
Remarks

Because volumes are "logical" constructs, it is possible to define volumes that share physical storage space. In such a case, volume capacity statistics could be misleading, because the shared physical space will appear as capacity under each of the logical volumes.

The Volume input parameter is of the form

"Image://ServerName/VolumeName:"


GetVolumeFreeSpace Method

This method returns the amount of space availble, in kilobytes, on the specified volume.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.GetVolumeFreeSpace(BSTR Volume)

Parameters

Parameter	Data Type	Description
Volume	String	Full path to the volume
Remarks

Because volumes are "logical" constructs, it is possible to define volumes that share physical storage space. In such a case, volume free space statistics could be misleading, because the shared available physical space will appear as free space under each of the logical volumes.

The Volume input parameter is of the form

"Image://ServerName/VolumeName:"


GetVolumeMediaType Method

Returns the media type for the specified file volume.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.GetVolumeMediaType(BSTR Volume)

Parameters

Parameter	Data Type	Description
Volume	String	Full path to the volume
Return

0 indicates magnetic media

1 indicates optical media

Remarks

The Volume input parameter is of the form

"Image://ServerName/VolumeName:".


InsertMapping Method

This method inserts a number (PageCount) of pages into the page map of the current document, starting immediately before the current document page. If the FilePath parameter is present, the pages are mapped into the document from that file, starting at FileStartingPage. Otherwise, the pages are mapped in from the current file, starting from the current file page.

Available With

√	Imaging for Windows Professional Edition V2.5 and V2.6
Applies To

Server Access Object

Syntax

object.InsertMapping(long PageCount, BSTR FilePath, long FileStartingPage)

Parameters

Parameter	Data Type	Description
PageCount	Long	Count of pages to be inserted into the document page map
FilePath	String	Full path to the file to be inserted into the document page map
FileStartingPage	Long	First file page to be inserted into the document page map
Remarks

If the current document page setting is greater than the actual count of pages in the document, the new pages are appended to the page map.

This method does not recognize the "Link files on reference" flag set by the Image Admin Control.  If you wish to have the current file copied, and the copy inserted into the page map, the copying must be done explicitly by the calling application (see the CopyFile method).

If the current document does not exist when this method is called, InsertMapping will create it.

InsertMapping does not verify the existence or accessibility of the file being inserted into the page map.

Because the Server Access Object works with files of arbitrary type, it makes no attempt to verify that there are actually PageCount pages in the file in question. The validity and interpretation of these count values are entirely the responsibility of the calling application.


LoginToServer Method

Logs the user on to a 1.x server.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Server Access Object

Syntax

object.LoginToServer(BSTR LoginID, BSTR Password)

Parameters

Parameter	Data Type	Description
LoginID	String	The user’s 1.x login ID
Password	String	The user’s password
Remarks

There is no user interface for this function [image] you must provide the login and password when you call it.


LogOffServer Method

Logs the user off the 1.x server.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Server Access Object

Syntax

object.LogOffServer(void)


SetKeywords Method

Sets the keyword list for the current document.

Available With

√	Imaging for Windows Professional Edition V2.6
Applies To

Server Access Object

Syntax

object.SetKeywords(BSTR pKeys)

Parameters

Parameter	Data Type	Description
pKeys	String	Points to the list containing keyword(s)
Remarks

The keywords in the list must be separated by either commas or spaces -- you cannot mix these delimiters. This enables the application to input 1.x document keywords without removing spaces.

The maximum length of a keyword is 20 characters.

Keywords previously associated with a document are replaced by a new list of keywords when you call this method.


File Types

Imaging ActiveX controls support the following file types:

AWD [image] The AWD (At Work Document) file type is used by Microsoft Fax.  AWD supports the black-and-white page type only; its image documents can contain multiple image pages.  AWD image documents are compressed using Microsoft's RBA compression.

BMP [image] The BMP (bitmap) file type is used by many Windows applications.  A Bitmap image is a representation of a graphic image, displayed by setting individual pixels to white, black, or a color.  BMP supports all page types; its image documents can contain only a single image page.  Compression of BMP image document files is not supported.

DCX (read-only) [image] The DCX file type was made popular by ZSoft Corporation's PC Paintbrush program and continues to be used by many graphics programs.  DCX supports all page types; its image documents can contain multiple image pages.  DCX image document files are compressed using PCX compression.

GIF (read-only) [image] The GIF (Graphics Interchange Format) file type was made popular by CompuServe and continues to be used by many graphics programs.  GIF supports the following page types: Gray4, Gray8, Palettized4, and Palettized8.  Its image documents can contain only a single image page.  GIF image document files are compressed using LZW compression.

JPG [image] The file format for Joint Photographics Experts Group (JPEG) images.  JPG supports the following page types: Palettized8 and RGB24.  Its image documents can contain only a single image page. JPG image document files are compressed using JPEG compression.

PCX (read-only) [image] The PCX file type was made popular by ZSoft Corporation's PC Paintbrush program and continues to be used by many graphics programs.  PCX supports all page types; its image documents can contain only a single image page.  PCX image document files are compressed using PCX compression.

TIFF [image] The TIFF (Tagged Image File Format) file type is used by many applications.  TIFF supports all page types.  Its image documents can contain multiple image pages, and can store Summary property information and image annotation data separate from the actual image data.  TIFF supports several compression types.

WIFF (read-only) [image] The WIFF (Wang Image File Format) file type is used by Wang Integrated Image Systems.  WIFF supports the black-and-white page type; its image documents can contain multiple image pages.  WIFF supports several compression types.

XIF (read-only) [image] XIF is the file type for Xerox image documents.  When read by Imaging, XIF supports the black-and-white page type; its image documents can contain multiple image pages.  XIF image document files are compressed using Xerox-proprietary compression.


Image Edit Control


Fires when a user presses a key while the object has focus.


Fires when a user releases a key while the object has focus.


Fires when a user presses and then releases a key while the object has focus.


Fires when a user presses a mouse button.


Fires when a user moves the mouse.


Fires when a user releases a mouse button.


Fires when a user presses and then releases a mouse button over an object.


Fires when a user presses and releases a mouse button twice over an object.


Thumbnail Control


Fires when a user presses a key while the object has focus.


Fires when a user releases a key while the object has focus.


Fires when an error occurs.