Anda di halaman 1dari 967

East man Sof t ware

Imaging
Prof essional Developers Guide
East man Sof t ware, Inc.
Tel. (978) 967-8000 s ht t p://www.kodak.com and www.east mansof t ware.com
Copyright Kodak, 1998
715-B017
Disclaimer of Warrant ies and Limit at ion of Liabilit ies
Nothing contained herein modifies or alters in any way the standard terms and conditions of the purchase, lease, or license
agreement by which the product was acquired, nor increases in any way the liability of the supplier of the software, its affiliates or
suppliers (the Supplier). In no event shall the Supplier be liable for incidental or consequential damages in connection with or
arising from the use of the product, the accompanying manual, or any related materials.
Sof t ware Not ice
All software must be licensed to customers in accordance with the terms and conditions of any approved and authorized license.
No title or ownership of the software is transferred, and any use of the software beyond the terms of the aforesaid license, without
written authorization of the publisher, is prohibited.
Rest rict ed Right s Legend
Use, duplication, or disclosure by the Government of this manual/ documentation is subject to the restrictions and protections
under paragraph (b)(2) or DoD FAR 252.227- 7015, Technical Data- Commercial Items (Nov. 1995) or, as applicable,
FAR 52.227- 19, Commercial Computer Software- R estricted R ights (June 1987). Use, duplication or disclosure by the
Government of this Software is subject to the restrictions and protections set forth in Eastman Software, Inc.s standard commercial
license for such Software as prescribed in DoD FAR 227.7202- 4 or, as applicable, FAR 52.227- 19, Commercial Computer
Software- R estricted R ights (June 1987).
Import ant Not ice Concerning t he Use of LZW Compression
This product uses LZW, a compression/ decompression technology that is covered by U.S. Patent 4,558,302 and its foreign
counterparts, issued or pending, held by the Unisys Corporation. Eastman Softwares grant of license from Unisys does not permit
you to use the LZW compression or decompression capabilities from any version of Imaging for Windows for development
purposes, or to use or derive the LZW capabilities from Eastman Software third party application or derivative software.
Please contact Unisys for licensing information at:
Unisys Corporation
Welch Licensing Dept. - MSC1SW19
Township Line and Union Meeting R oads
P.O Box 500
Blue Bell, PA 19424- 0001
Fax: (215) 986- 3090
or
www.unisys.com
Eastman Software is a trademark of Kodak.
Microsoft, Windows, and Windows N T are registered trademarks of Microsoft Corporation.
TextBridge

1998 ScanSoft, Inc., a Xerox Company. All rights reserved.


Compatible with Visioneer- branded scanner products.

Visioneer, Inc. 1996.


O ther product names mentioned in this guide may be trademarks or registered trademarks of their respective companies.
Contributers to this book include the following:
Project L eader
Jim Preftakes
Project M anager
Mark Sartanowicz
L ead Technical W riter
Bob R aymond
C ontributing Technical W riters
Steve ONeill, Leonard Turmel
Technical E ditors
Charles Bann, Kathleen Sparr
S oftware D evelopers
Sue Cox, Guy Greese, R ichard Guidoboni, Garry Sager,
and many other talented members of the Imaging for Windows team
G raphic D esigners
Patr icia Israel, Maria Witt
Production S pecialists
Jeanne Chandonnet, Denise Govoni
Cont ent s
Prof essional Developers Guide
1 Imaging In Development
Welcome t o t he Prof essional Developers Guide 2
Int roducing Imaging f or Window s 3
Imaging Component s 4
Imaging Applicat ion 4
Imaging Preview 5
Imaging Flow 6
Development Tools and M et hods 8
What Imaging Let s You Do 9
Command-line Invocat ion 9
OLE 10
Embedded Image Files 10
Linked Image Files 10
Aut omat ion 11
Act iveX Cont rols 12
Which t o Use: Command-line Int erf ace, OLE, Aut omat ion, or
Act iveX Cont rols? 13
Command-line Int erf ace 13
OLE 14
Aut omat ion 14
Act iveX Cont rols 15
Sample Code 16
Aut omat ion Demonst rat ion Project 16
Act iveX Demonst rat ion Project s 16
Act iveX/Web Demonst rat ion Project 17
Act iveX Sample Applicat ions 17
What Imaging Let s Your Users Do 19
Cont ent s
iv
What Exact ly Is Document Imaging? 20
Business Document Imagi ng 20
Personal Document Imagi ng 21
Compiling and Dist ribut ing Your Image-Enabled
Applicat ion 22
You Included Imaging f or Window s Prof essional Edit ion
Feat ures 22
You Did Not Include Imaging f or Window s Prof essional Edit ion
Feat ures 22
Import ant Not ice Concerning t he Use of LZW
Compression 24
Document at ion Convent ions 25
2 Adding Imaging Using Aut omat ion
Overview 28
The Object Hierarchy 28
Applicat ion Object 29
ImageFile Object 29
Page Object 29
PageRange Object 30
Aut omat ion Server and Embedded Server M odes 30
Aut omat ion Server M ode 30
Embedded Server M ode 31
Examples 31
As an Aut omat ion Server Applicat ion 31
As an Embedded Server Applicat ion 34
Demonst rat ion Project 36
View M odes 36
One Page 37
Thumbnail 38
Page and Thumbnails 39
Example 40
Cont ent s
v
The Aut omat ion From Excel Project 40
Opening t he Spreadsheet File 42
Opening and Displaying t he Image File 42
Obt aining t he Page Count 47
Rot at ing an Image Page 48
Set t ing t he One Page View M ode 49
Set t ing t he Thumbnail View M ode 49
Set t ing t he Page and Thumbnails View M ode 50
Closing t he Image File and t he Imaging
Applicat ion 50
3 Aut omat ion Lexicon
Overview 52
Applicat ion Object 53
Applicat ion Object Propert ies 53
Act iveDocument Propert y 54
Annot at ionPalet t eVisible Propert y 54
Applicat ion Propert y 55
AppSt at e Propert y 55
DisplayScaleAlgorit hm Propert y 55
Edit Propert y 56
FullName Propert y 56
Height Propert y 56
ImagePalet t e Propert y 57
ImageView Propert y 57
ImagingTool BarVisible Propert y 58
Lef t Propert y 58
Name Propert y 58
Parent Propert y 59
Pat h Propert y 59
ScannerIsAvailable Propert y 59
ScanToolBarVisible Propert y 59
ScrollBarsVisible Propert y 60
St at usBarVisible Propert y 60
ToolBarVisible Propert y 60
Top Propert y 61
TopWindow Propert y 61
Visible Propert y 61
Cont ent s
vi
WebToolBarVisible Propert y 62
Widt h Propert y 62
Zoom Propert y 62
Applicat ion Object M et hods 63
Creat eImageView erObject M et hod 63
Fit To M et hod 63
Help M et hod 64
Quit M et hod 64
ImageFile Object 65
ImageFile Object Propert ies 65
Act ivePage Propert y 65
Applicat ion Propert y 66
FileType Propert y 66
Name Propert y 67
OCRLaunchApplicat ion Propert y 67
OCROut put File Propert y 67
OCROut put Type Propert y 67
PageCount Propert y 68
Parent Propert y 68
Saved Propert y 68
ImageFile Object M et hods 69
AppendExist ingPages M et hod 70
Close M et hod 71
Creat eCont act Sheet M et hod 71
FindOIServerDoc M et hod 71
Help M et hod 72
Insert Exist ingPages M et hod 72
New M et hod 73
Ocr M et hod 74
Open M et hod 74
Pages M et hod 75
Print M et hod 76
Rot at eAll M et hod 76
Save M et hod 76
SaveAs M et hod 76
SaveCopyAs M et hod 77
Updat e M et hod 78
Cont ent s
vii
Page Object 79
Page Object Propert ies 79
Applicat ion Propert y 79
CompressionInf o Propert y 79
CompressionType Propert y 80
Height Propert y 81
ImageResolut ionX Propert y 81
ImageResolut ionY Propert y 82
Name Propert y 82
PageType Propert y 82
Parent Propert y 83
ScrollPosit ionX Propert y 83
ScrollPosit ionY Propert y 83
Widt h Propert y 83
Page Object M et hods 84
Delet e M et hod 84
Flip M et hod 84
Help M et hod 84
Ocr M et hod 84
Print M et hod 85
Rot at eLef t M et hod 85
Rot at eRight M et hod 85
Scroll M et hod 85
PageRange Object 86
PageRange Object Propert ies 86
Applicat ion Propert y 86
Count Propert y 86
EndPage Propert y 86
Parent Propert y 87
St art Page Propert y 87
PageRange Object M et hods 87
Delet e M et hod 87
Ocr M et hod 88
Print M et hod 88
Cont ent s
viii
4 Adding Imaging Using Act iveX Cont rols
Loading t he Cont rols 90
Visual Basic 92
Visual C++ 92
Access 93
Obt aining Help 95
Visual Basic 95
Obj ect Brow ser 96
Toolbox 96
Form Window 97
Propert ies Window 97
Code Window 97
Visual C++ 98
Component s and Cont rols Gallery Dialog Box 98
Propert ies Window 98
Access 99
Obj ect Brow ser 99
Propert ies Window 99
M odule Window 100
Demonst rat ion Project s 101
Displaying an Image and Applying Fit -To Opt ions 101
Fit -To Opt ions Def ined 101
Example 102
Fit To Opt ions Project 103
Convert ing an Image 106
Image Conversion Def ined 106
Example 107
Example 108
Example 110
Example 111
Example 111
Convert Image Project 112
Copying An Image 117
Clipboard Funct ions Def ined 117
Clipboard Copy and Cut 117
Clipboard Past e 117
Image Select ion 118
Cont ent s
ix
Annot at ion Select ion 118
Example 119
Copy Image Project 119
Print ing An Image 122
Image Print i ng Def ined 122
Example 122
Print Image Project 124
Scanning an Image Using a Templat e 130
Templat e Scanning Def ined 130
Example 131
Templat e Scan Project 133
M anaging an Image File Using Thumbnails 143
Thumbnail s Def i ned 143
Example 143
Thumbnail Sort er Project 144
Subt ract ing t he Value of X 156
Unloading a M ult ipage Image File 158
M ult ipage Image Files Def ined 158
Page-Relat ed Propert ies and M et hods 160
Image Admin 160
Image Edit 160
Image Scan 161
Image Thumbnail 161
Example 162
Unload Project 163
5 Developing Client -Server Applicat ions
Imaging Server Concept s 170
Fil e Type Support 171
St andard Dialog Boxes 171
Image Fi les and Server Document s 172
Int eract i ng w i t h Imaging 1.x Servers 172
Image File Volume 172
Document Volume 172
Int eract ing w it h Imaging 3.x Servers 173
Imaging 1.x Server Programming Considerat ions 173
Logging Ont o t he Server 173
Set t ing Imaging Server Opt ions 174
Cont ent s
x
The f ollow ing sect ions explain each server opt ion set t ing and
relat ed propert y in det ail. 177
File Locat ion f or Document Pages (FileSt gLoc1x Propert y) 177
Force Low er-Case File Names (ForceLow erCase1x Propert y)
178
Link Files On Ref erence
(ForceFileLinking1x Propert y) 178
Delet e Files Wit h Pages
(ForceFileDelet ion1x Propert y) 180
Brow sing f or Volumes or Image Files and Server Document s 181
Brow sing f or Volumes 181
Brow sing f or Files and Document s 182
Querying f or 1.x Server Document s 185
Saving 1.x Image Files and Server Document s 186
Imaging 3.x Server Programming Considerat ions 189
Logging Ont o t he Server 189
Querying 3.x Server document s 190
Demonst rat ion Project 192
Zooming an Image Def ined 192
Zooming an Ent ire Image Page 192
Zooming a Port ion of an Image Page 193
Example 193
Annot at i ons Def ined 194
Image Annot at ion Tool But t on Cont rol 197
Image Edit Cont rol 197
Example 204
The Image Server Project 204
Set t ing Server Opt ions 206
In t his case, t he procedure invokes t he
Show 1xServerOpt Dlg met hod of t he Image Admin cont rol,
w hich displays t he Imaging Server Opt ions dialog box de-
scribed i n t he Set t i ng Imaging Server Opt ions sect ion of t hi s
chapt er. 207
Brow sing f or Imaging 1.x File and/or
Document Volumes 208
Opening 1.x Files and Document s 210
Querying 1. x Document M anager Dat abases 212
Zooming an Image 229
Cont ent s
xi
Invoking t he St andard Annot at ion
Tool Palet t e 231
Show ing and Hiding Annot at ions 233
6 Image-Enabling Web Pages
Image-Enabling a Web Page 236
Java Applet 236
Import ing Type Libraries 236
Declaring Object Ref erences 239
Connect ing t he Applet t o t he Cont rols 240
HTM L File 241
Def ining t he Applet and t he Cont rols 241
Compl et i ng t he Connect i on 243
Obt aining Help 245
Visual J++ 245
Window s Explorer 246
Demonst rat ion Project 247
Rot at ing an Image Def ined 247
Thumbnail Capt ions Def ined 249
Example 251
The Imgct rls Project 252
In t he Brow ser 254
In t he Applet 255
7 Image Edit / Image Annot at ion Cont rols
Overview 273
Image Edit Cont rol 273
Image Annot at ion Tool But t on Cont rol 273
Image Admin Cont rol 274
Image OCR Cont rol 274
Image Scan Cont rol 274
Image Thumbnail Cont rol 274
Image Edit Cont rol Overview 275
What t he Image Edit Cont rol Let s You Do 275
Cont ent s
xii
What t he Image Edit Cont rol Let s Your Users Do 275
Image Display 275
Image Annot at ion 275
Image M anipulat ion 276
Image Document Ret rieval and St orage 276
Linking Ot her Imaging Cont rols t o t he Image Edit Cont rol 276
Image Annot at ion Tool But t on Cont rol 276
Image Scan Cont rol 276
Est ablishing t he Link 277
Image Annot at ion Tool But t on Overview 277
What t he Image Annot at ion Tool But t on Cont rol Let s You Do 277
What t he IATB Cont rol Let s Your Users Do 278
Prerequisit es 278
Annot at ionBackColor Propert y 279
Annot at ionBackColor Example VB 279
Annot at ionBackColor Example VC+ + 279
Annot at ionFillColor Propert y 280
Annot at ionFillColor Example VB 280
Annot at ionFillSt yle Propert y 281
Annot at ionFillSt yle Example VB 281
Annot at ionFillSt yle Example VC+ + 282
Annot at ionFont Propert y 282
Annot at ionFont Example VB 283
Annot at ionFont Example VC++ 284
Annot at ionFont Color Propert y 285
Annot at ionFont Color Example VB 285
Annot at ionFont Color Example VC++ 286
Annot at ionGroupCount Propert y 286
Annot at ionGroupCount Example VB 287
Annot at ionGroupCount Example VC++ 287
Annot at ionImage Propert y 288
Annot at ionImage Example VB 288
Annot at ionImage Example VC++ 289
Cont ent s
xiii
Annot at ionLineColor Propert y 289
Annot at ionLineColor Example VB 290
Annot at ionLineColor Example VC++ 290
Annot at ionLineSt yle Propert y 291
Annot at ionLineSt yle Example VB 291
Annot at ionLineSt yle Example VC+ + 292
Annot at ionLineWidt h Propert y 292
Annot at ionLineWidt h Example VB 293
Annot at ionLineWidt h Example VC+ + 293
Annot at ionOcrType Propert y 294
Annot at ionOcrType Example VB 295
Annot at ionOcrType Example VC++ 295
Annot at ionSt ampText Propert y 295
Annot at ionSt ampText Example VB 297
Annot at ionSt ampText Exampl e VC+ + 297
Annot at ionText File Propert y 297
Annot at ionText File Example VB 298
Annot at ionText File Example VC++ 298
Annot at ionType Propert y 298
Annot at ionType Example VB 302
Annot at ionType Example VC++ 302
Aut oRef resh Propert y 302
Aut oRef resh Example VB 303
Aut oRef resh Example VC+ + 303
BorderSt yle Propert y 304
CompressionInf o Propert y 304
CompressionInf o Example VB 306
CompressionInf o Example VC+ + 307
CompressionType Propert y 308
CompressionType Example VB 309
Cont inuePrint ing Propert y 310
Cont inueWit hout Undo Propert y 311
Cont ent s
xiv
Dest ImageCont rol Propert y 311
Dest ImageCont rol Example VB 312
DisplayICM Enabled Propert y 313
DisplayScaleAlgorit hm Propert y 313
DisplayScaleAlgorit hm Example VB 314
DisplayScaleAlgorit hm Example VC++ 315
Enabled Propert y 315
FileType Propert y 316
FileType Example VB 317
hWnd Propert y 317
Image Propert y 318
Image Example VB 318
Image Example VC+ + 319
ImageCont rol Propert y 319
ImageDisplayed Propert y 320
ImageHeight Propert y 320
ImageHeight Example VB 321
ImageHeight Example VC++ 321
ImageM odif ied Propert y 322
ImageM odif i ed Example VB 324
ImageM odif i ed Example VC++ 324
ImagePalet t e Propert y 325
ImageResolut ionX Propert y 326
ImageResolut ionX Example VB 326
ImageResolut ionX Example VC++ 327
ImageResolut ionY Propert y 328
ImageResolut ionY Example VB 328
ImageResolut ionY Example VC++ 329
ImageScaleHeight Propert y 329
ImageScaleHeight Example VB 330
ImageScaleHeight Example VC++ 331
Cont ent s
xv
ImageScaleWidt h Propert y 331
ImageScaleWidt h Example VB 332
ImageScaleWidt h Example VC++ 332
ImageWidt h Propert y 333
ImageWidt h Example VB 334
ImageWidt h Example VC++ 334
M agnif ierZoom Propert y 335
M agnif ierZoom Example VB 336
M agnif ierZoom Example VC++ 336
M ouseIcon Propert y 336
M ouseIcon Example VB 337
M ouseIcon Example VC+ + 337
M ousePoint er Propert y 337
M ousePoint er Example VB 339
M ousePoint er Example VC+ + 339
OcrZoneVisibilit y Propert y 340
OCRZoneVisibilit y Example VB 340
OCRZoneVisibilit y Example VC+ + 341
Page Propert y 341
Page Example VB 342
Page Example VC++ 342
PageCount Propert y 342
PageCount Example VB 343
PageCount Example VC++ 343
PageType Propert y 344
PageType Example VB 345
Pict ureDisabled Propert y 345
Pict ureDisabled Example VB 346
Pict ureDow n Propert y 346
Pict ureDow n Example VB 347
Pict ureUp Propert y 348
Pict ureUp Example VB 348
ReadySt at e Propert y 349
Cont ent s
xvi
ScrollBars Propert y 350
Scrol lBars Example VB 350
Scrol lBars Example VC++ 351
ScrollPosit ionX Propert y 351
ScrollPosit ionX Example VB 352
ScrollPosit ionX Example VC++ 352
ScrollPosit ionY Propert y 352
ScrollPosit ionY Example VB 353
ScrollPosit ionY Example VC++ 353
ScrollShort cut sEnabled Propert y 354
ScrollShort cut sEnabled Example VB 355
ScrollShort cut sEnabled Example VC++ 355
Select ionRect angle Propert y 356
Select ionRect angle Example VB 356
Select ionRect angle Example VC++ 357
St at usCode Propert y 357
UndoLevels Propert y 358
UndoLevels Example VB 358
UndoLevels Example VC+ + 358
UseCheckCont inuePrint ing Propert y 359
Value Propert y 360
Zoom Propert y 361
Zoom Example VB 361
Zoom Example VC++ 361
About Box M et hod 362
AddAnnot at ionGroup M et hod 362
AddAnnot at ionGroup Example VB 363
AddAnnot at ionGroup Example VC++ 363
Aut oCrop M et hod 364
Aut oCrop Example VB 364
Aut oCrop Example VC++ 365
Cont ent s
xvii
Aut oDeskew M et hod 365
Aut oDeskew Example VB 366
Aut oDeskew Example VC+ + 366
BurnInAnnot at ions M et hod 367
BurnInAnnot at ions Example VB 369
BurnInAnnot at ions Example VC++ 369
ClearDisplay M et hod 370
ClipboardCopy M et hod 370
ClipboardCopy Example VB 371
ClipboardCopy Example VC++ 372
ClipboardCut M et hod 372
ClipboardPast e M et hod 373
ClipboardPast e Example VB 374
ClipboardPast e Example VC++ 374
Complet ePast e M et hod 375
Complet ePast e Example VB 376
Complet ePast e Example VC+ + 376
Convert PageType M et hod 377
Convert PageType Example VB 377
Convert PageType Example VC++ 378
Crop M et hod 378
Delet eAnnot at ionGroup M et hod 379
Delet eAnnot at ionGroup Example VB 380
Delet eAnnot at ionGroup Example VC++ 380
Delet eImageDat a M et hod 381
Delet eSelect edAnnot at ions M et hod 382
Despeckle M et hod 382
Despeckle Example VB 383
Despeckle Example VC+ + 384
Display M et hod 384
Display Example VB 385
Display Example VC++ 385
Cont ent s
xviii
DisplayBlankImage M et hod 386
DisplayBlankImage Example VB 386
DisplayBlankImage Example VC+ + 387
Draw M et hod 387
Draw Example VB 389
Draw Example VC+ + 389
Draw Select ionRect M et hod 389
Draw Select ionRect Example VB 390
Draw Select ionRect Example VC+ + 390
Edit Select edAnnot at ionText M et hod 391
Edit Select edAnnot at ionText Example VB 392
Edit Select edAnnot at ionText Example VC++ 392
Execut eText Edit Command M et hod 393
Fit To M et hod 396
Fit To Example VB 397
Fit To Example VC++ 397
Flip M et hod 398
Flip Example VB 398
Flip Example VC++ 399
Get Annot at ionGroup M et hod 399
Get Annot at ionGroup Example VB 400
Get Annot at ionGroup Example VC++ 400
Get Annot at ionM arkCount M et hod 401
Get Annot at ionM arkCount Example VB 402
Get Annot at ionM arkCount Example VC++ 402
Get Current Annot at ionGroup M et hod 403
Get RubberSt ampIt em M et hod 403
Get RubberSt ampIt em Example VB 404
Get RubberSt ampIt em Example VC++ 405
Get RubberSt ampM enuIt ems M et hod 406
Get RubberSt ampM enuIt ems Example VB 406
Get RubberSt ampM enuIt ems Example VC++ 407
Cont ent s
xix
Get Select edAnnot at ionBackColor M et hod 408
Get Select edAnnot at ionBackColor Example VB 408
Get Select edAnnot at ionBackColor Example VC++ 409
Get Select edAnnot at ionFillColor M et hod 409
Get Select edAnnot at ionFillColor Example VB 410
Get Select edAnnot at ionFillColor Example VC++ 410
Get Select edAnnot at ionFillSt yle M et hod 411
Get Select edAnnot at ionFillSt yle Example VB 411
Get Select edAnnot at ionFillSt yle Example VC++ 412
Get Select edAnnot at ionFont M et hod 413
Get Select edAnnot at ionFont Example VB 413
Get Select edAnnot at ionFont Example VC++ 414
Get Select edAnnot at ionFont Color M et hod 415
Get Select edAnnot at ionFont Color Example VB 416
Get Select edAnnot at ionFont Color Example VC++ 416
Get Select edAnnot at ionImage M et hod 417
Get Select edAnnot at ionImage Example VB 418
Get Select edAnnot at ionLineColor M et hod 418
Get Select edAnnot at ionLineColor Example VB 419
Get Select edAnnot at ionLineColor Example VC++ 419
Get Select edAnnot at ionLineSt yle M et hod 420
Get Select edAnnot at ionLineSt yle Example VB 420
Get Select edAnnot at ionLineSt yle Example VC++ 421
Get Select edAnnot at ionLineWidt h M et hod 422
Get Select edAnnot at ionLineWidt h Example VB 422
Get Select edAnnot at ionLineWidt h Example VC++ 423
Get Select edAnnot at ionOcrType M et hod 424
Get Select edAnnot at ionOcrType Example VB 424
Get Select edAnnot at ionOcrType Example VC++ 425
Get Version M et hod 426
HideAnnot at ionGroup M et hod 426
HideAnnot at ionGroup Example VB 427
Cont ent s
xx
HideAnnot at ionGroup Example VC++ 427
HideAnnot at ionToolPalet t e M et hod 428
Invert M et hod 428
IsClipboardDat aAvailable M et hod 429
IsClipboardDat aAvailable Example VB 429
IsClipboardDat aAvailable Example VC+ + 430
LoadAnnot at ions M et hod 430
LoadAnnot at ions Example VB 431
LoadAnnot at ions Example VC++ 431
M anualDeSkew M et hod 432
Print Image M et hod 432
Print Image Example VB 434
Print Image Example VC++ 435
Redo M et hod 435
Ref resh M et hod 436
Ref resh Example VB 436
Ref resh Example VC+ + 437
RemoveAllOCRM arks M et hod 437
Rot at e M et hod 438
Rot at e Example VB 439
Rot at e Example VC++ 439
Rot at eAll M et hod 440
Rot at eAll Example VB 440
Rot at eAll Example VC++ 441
Rot at eLef t M et hod 441
Rot at eLef t Example VB 442
Rot at eLef t Example VC+ + 442
Rot at eRight M et hod 443
Rot at eRight Example VB 444
Rot at eRight Example VC++ 444
Cont ent s
xxi
Save M et hod 444
Save Example VB 445
Save Example VC++ 446
SaveAnnot at ions M et hod 447
SaveAnnot at ions Example VB 448
SaveAnnot at ions Example VC++ 448
SaveAs M et hod 449
SaveAs Example VB 453
SaveAs Example VC++ 454
SavePage M et hod 456
SavePage Example VB 460
SavePage Example VC++ 460
ScrollImage M et hod 461
Select Annot at ionGroup M et hod 462
Select First OcrZone M et hod 462
Select Next OcrZone M et hod 463
Select Tool M et hod 464
Select Tool Example VB 465
Select Tool Example VC++ 465
Set Current Annot at ionGroup M et hod 466
Set ImagePalet t e M et hod 466
Set RubberSt ampIt em M et hod 467
Set RubberSt ampIt em Example VB 468
Set RubberSt ampIt em Example VC+ + 469
Set Select edAnnot at ionBackColor M et hod 469
Set Select edAnnot at ionBackColor Example VB 470
Set Select edAnnot at ionBackColor Example VC++ 470
Set Select edAnnot at ionFillColor M et hod 470
Set Select edAnnot at ionFillColor Example VB 471
Set Sel ect edAnnot at ionFillColor Example VC++ 471
Cont ent s
xxii
Set Select edAnnot at ionFillSt yle M et hod 472
Set Select edAnnot at ionFillSt yle Example VB 473
Set Select edAnnot at ionFillSt yle Example VC+ + 473
Set Select edAnnot at ionFont M et hod 474
Set Select edAnnot at ionFont Example VB 476
Set Select edAnnot at ionFont Example VC++ 476
Set Select edAnnot at ionFont Color M et hod 477
Set Select edAnnot at ionFont Color Example VB 478
Set Select edAnnot at ionFont Color Example VC++ 479
Set Select edAnnot at ionLineColor M et hod 480
Set Select edAnnot at ionLineColor Example VB 480
Set Select edAnnot at ionLineColor Example VC+ + 481
Set Select edAnnot at ionLineSt yle M et hod 481
Set Select edAnnot at ionLineSt yle Example VB 482
Set Select edAnnot at ionLineSt yle Example VC+ + 483
Set Select edAnnot at ionLineWidt h M et hod 484
Set Select edAnnot at ionLineWidt h Example VB 484
Set Select edAnnot at ionLineWidt h Example VC+ + 485
Set Select edAnnot at ionOcrType M et hod 486
Set Select edAnnot at ionOcrType Example VB 486
Set Select edAnnot at ionOcrType Example VB 487
Show Annot at ionGroup M et hod 488
Show Annot at ionGroup Example VB 489
Show Annot at ionGroup Example VC++ 489
Show Annot at ionToolPalet t e M et hod 489
Show Annot at ionToolPalet t e Example VB 491
Show Annot at ionToolPalet t e Example VC+ + 492
Show At t ribsDialog M et hod 492
Show At t ribsDialog Example VB 493
Show At t ribsDialog Example VC++ 494
Show M agnif ier M et hod 494
Show M agnif ier Example VB 495
Show M agnif ier Example VC++ 495
Cont ent s
xxiii
Show PagePropert ies M et hod 496
Show RubberSt ampDialog M et hod 497
Undo M et hod 498
Undo Example VB 498
Undo Example VC++ 499
ZoomToSelect ion M et hod 499
ZoomToSelect ion Example VB 500
ZoomToSelect ion Example VC+ + 500
BadDocument FileType Event 500
BadDocument FileType Example VB 502
BadDocument FileType Example VC++ 502
CheckCont inuePrint ing Event 502
Close Event 503
Close Example VB 504
Close Example VC++ 504
Edit ingText Annot at ion Event 505
Edit ingText Annot at ion Example VB 506
Error Event 507
ErrorSavingUndoInf ormat ion Event 508
HyperlinkGoToDoc Event 508
HyperlinkGoToPage Event 509
Load Event 510
Load Example VB 510
Load Example VC++ 511
M agnif ierSt at us Event 511
M arkEnd Event 512
M arkEnd Example VB 513
M arkEnd Example VC++ 514
M arkM ove Event 514
M arkM ove Example VB 515
M arkM ove Example VC++ 515
Cont ent s
xxiv
M arkSelect Event 515
M arkSelect Example VB 516
M arkSelect Example VC++ 517
PagePropert iesClose Event 518
Past eClip Event 518
Past eComplet ed Event 519
ReadySt at eChange Event 520
Scroll Event 520
Select ionRect Draw n Event 521
Select ionRect Draw n Example VB 522
Select ionRect Draw n Example VC++ 522
St raight enPage Event 523
ToolPalet t eHidden Event 523
ToolPalet t eHidden Example VB 524
ToolPalet t eHidden Example VC++ 524
ToolSelect ed Event 525
ToolSelect ed Example VB 525
ToolSelect ed Example VC++ 526
ToolTip Event 528
PageType Set t ings 528
PageType Set t ings f or SaveAs and SavePage 529
Annot at ion Type Set t ings 529
FileType Set t ings 530
CompressionType Set t ings 531
CompressionInf o Set t ings 531
Tool ID Set t ings 532
Annot at ion Tool Palet t e 533
Select Annot at ions and Zones 533
Highlight er 533
Cont ent s
xxv
Hollow Rect angle 533
Text 533
Text From File 534
Freehand Line 534
St raight Line 534
Filled Rect angle 534
At t ach-a-Not e 534
Rubber St amp 534
Hyperlink 535
Fully-qualif ied Image Document Names 535
Ext ender Propert ies, M et hods, and Event s 536
Image Edit Ext ender Propert ies 536
Image Edit Ext ender M et hods 537
Image Edit Ext ender Event s 538
IATB Ext ender Propert ies 538
IATB Ext ender M et hods 539
IATB Ext ender Event s 540
RGB Format 540
Annot at ion St yles 541
Annot at ion Types 542
File Types 543
Pixel 544
8 Image Admin Cont rol
What t he Image Admin Cont rol Let s You Do 548
What t he Image Admin Cont rol Let s Your Users Do 548
Aut hor Propert y 548
Aut hor Example VB 549
Aut hor Example VC+ + 549
Brow se1xRet urnedPat h 550
Brow se1xRet urnedType Propert y 550
Cont ent s
xxvi
CancelError Propert y 551
CancelError Example VB 551
CancelError Example VC+ + 552
Comment s Propert y 553
Comment s Example VB 553
Comment s Example VC++ 554
CompressionInf o Propert y 554
CompressionType Propert y 555
CompressionType Example VB 556
CompressionType Example VC++ 558
Def ault Ext Propert y 561
DialogTit le Propert y 561
DialogTit le Example VB 562
DialogTit le Example VC+ + 562
Domain Propert y 563
FileSt gLoc1x Propert y 564
FileSt gLoc1x Example VB 564
FileSt gLoc1x Example VC+ + 565
FileType Propert y 565
FileType Example VB 566
FileType Example VC+ + 568
Filt er Propert y 570
Filt er Example VB 571
Filt er Example VC+ + 572
Filt erIndex Propert y 572
Filt erIndex Example VB 573
Filt erIndex Example VC++ 573
Flags Propert y 575
Flags Example VB 576
Flags Example VC+ + 576
ForceFileDelet ion1x Propert y 577
Cont ent s
xxvii
ForceFileLinking1x Propert y 578
ForceFileLinking1x Example VB 579
ForceFileLinking1x Example VC+ + 579
ForceLow erCase1x Propert y 580
HelpCommand Propert y 581
HelpCont ext Id Propert y 582
HelpFile Propert y 582
HelpKey Propert y 583
Image Propert y 583
Image Example VB 584
Image Example VC++ 584
ImageHeight Propert y 585
ImageHeight Example VB 585
ImageHeight Example VC++ 587
ImageResolut ionX Propert y 590
ImageResolut ionX Example VB 590
ImageResolut ionX Example VC++ 592
ImageResolut ionY Propert y 595
ImageResolut ionY Example VB 595
ImageResolut ionY Example VC++ 597
ImageWidt h Propert y 600
ImageWidt h Example VB 600
ImageWidt h Example VC++ 602
Init Dir Propert y 605
Init Dir Example VB 605
Init Dir Example VC+ + 606
Init 1xFindDir Propert y 606
Keyw ords Propert y 607
Keyw ords Example VB 607
Keyw ords Example VC++ 608
NameServer Propert y 608
Cont ent s
xxviii
PageCount Propert y 609
PageCount Example VB 609
PageCount Example VC++ 611
PageNumber Propert y 614
PageNumber Example VB 614
PageNumber Example VC++ 616
PageType Propert y 619
PageType Example VB 619
PageType Example VC+ + 621
Print Annot at ions Propert y 624
Print Annot at ions Example VB 624
Print Annot at ions Example VC++ 625
Print Collat e Propert y 626
Print EndPage Propert y 626
Print EndPage Example VB 627
Print EndPage Example VC++ 627
Print NumCopies Propert y 628
Print NumCopies Example VB 628
Print NumCopies Example VC++ 629
Print Orient at ion Propert y 630
Print Out put Format Propert y 630
Print Out put Format Example VB 631
Print Out put Format Example VC++ 631
Print RangeOpt ion Propert y 632
Print St art Page Propert y 633
Print St art Page Example VB 633
Print St art Page Example VC+ + 634
Print ToFile Propert y 635
SaveAsName Propert y 635
Subject Propert y 636
Subject Example VB 636
Subject Example VC++ 637
Cont ent s
xxix
Tit le Propert y 637
Tit le Example VB 638
Tit le Example VC+ + 638
Append M et hod 639
Append Example VB 640
Append Example VC++ 640
Brow se1x M et hod 641
Convert Dat e M et hod 642
Creat eDirect ory M et hod 642
Delet e M et hod 643
Delet ePages M et hod 643
Delet ePages Example VB 644
Delet ePages Example VC++ 644
Get SysCompressionInf o M et hod 644
Get SysCompressionType M et hod 646
Get SysFileType M et hod 647
Get UniqueName M et hod 648
Get UniqueName Example VB 649
Get UniqueName Example VC++ 649
Get VolumeType M et hod 650
ImgQuery M et hod 650
ImgQuery Example VB 653
ImgQuery Example VC++ 654
ImgQueryEnd M et hod 655
ImgQueryEnd Example VB 656
ImgQueryEnd Example VC++ 656
Insert M et hod 657
Insert Example VB 659
Insert Example VC++ 659
LoginToServer M et hod 660
Cont ent s
xxx
LogOf f Server M et hod 661
Rename M et hod 662
Replace M et hod 662
Replace Example VB 663
Replace Example VC+ + 664
Set FilePropert ies M et hod 665
Set FilePropert ies Example VB 665
Set FilePropert ies Example VC++ 666
Set Syst emFileAt t ribut es M et hod 666
Show 1xServerOpt Dlg M et hod 669
Show FileDialog M et hod 670
Show FileDialog Example VB 671
Show FileDialog Example VC++ 672
Show FilePropert ies M et hod 673
Show FindDialog M et hod 674
Show Print Dialog M et hod 675
Show Print Dialog Example VB 676
Show Print Dialog Example VC+ + 677
Verif yImage M et hod 677
FilePropert iesClose Event 678
Image Admin Ext ender Propert ies 679
Image Page 680
Display Types 680
Summary Propert ies 681
9 Image OCR Cont rol
What t he Image OCR Cont rol Let s You Do 685
What t he Image OCR Cont rol Let s Your Users Do 685
Copyt oClipBoard Propert y 686
Cont ent s
xxxi
CopyToClipBoard Example VB 686
Image Propert y 686
Image Example VB 687
Language Propert y 687
Language Example VB 688
LaunchApplicat ion Propert y 688
LaunchApplicat ion Example VB 689
Layout Propert y 689
Layout Example VB 690
OcrFromClipBoard Propert y 690
OcrFromClipBoard Example VB 691
Out put File Propert y 691
Out put File Example 691
Out put Type Propert y 692
Out put Type Example VB 692
Pages Propert y 693
Pages Example VB 693
ProcessingM ode Propert y 694
ProcessingM ode Example VB 694
ProgressDialogCapt ion Propert y 695
ProgressDialogCapt ion Example VB 695
ProgressNot if icat ion Propert y 696
ProgressNot if icat ion Example VB 696
Qualit y Propert y 697
Qualit y Example VB 697
ReadySt at e Propert y 698
ReadySt at e Example VB 698
Ret ainPageLayout Propert y 699
Ret ainPageLayout Example VB 699
Ret ainPict ures Propert y 700
Ret ainPict ures Example VB 700
Cont ent s
xxxii
Show Progress Propert y 701
Show Progress Example VB 701
St at usCode Propert y 702
St at usCode Example VB 703
TrainingFile Propert y 704
TrainingFile Example VB 704
TrainingFileOpt ions Propert y 704
TrainingFileOpt ions Example VB 705
TrainingThreshold Propert y 705
TrainingThreshold Example VB 706
LoadDict ionary M et hod 706
LoadDict ionary Example VB 707
Set Def ault Values M et hod 707
Set Def ault Values Example VB 707
Show Ocr M et hod 708
Show Ocr Example VB 709
Show OcrOpt ions M et hod 710
Show OcrOpt ions Example VB 712
St art Ocr M et hod 712
St art Ocr Example VB 712
St opOcr M et hod 713
St opOcr Example VB 713
OcrComplet e Event 714
OcrComplet e Example VB 714
OcrProgress Event 714
OcrProgress Example VB 715
Image OCR Ext ender Propert ies 716
Layout Types 716
Out put Types 717
OCR Zones 717
Cont ent s
xxxiii
Input Qualit y Types 718
User-Def ined Dict ionaries 718
Int eract ive Training 718
Original Document Language 719
Training Files 719
Document Recomposit ions 719
10 Image Scan Cont rol
What t he Image Scan Cont rol Let s You Do 723
What t he Image Scan Cont rol Let s Your Users Do 723
Prerequisit es 723
Obsolet e Propert ies and M et hods 724
CompressionInf o Propert y 725
CompressionType Propert y 726
Dest ImageCont rol Propert y 727
Dest ImageCont rol Example VB 727
Dest ImageCont rol Example VC+ + 727
FileType Propert y 728
FileType Example VB 728
FileType Example VC++ 729
Image Propert y 730
Image Example VB 730
Image Example VC+ + 731
M ult iPage Propert y 731
M ult iPage Example VB 732
M ult iPage Example VC+ + 732
Page Propert y 733
Page Example VB 733
Page Example VC++ 734
Cont ent s
xxxiv
PageCount Propert y 734
PageCount Example VB 735
PageCount Example VC++ 735
PageOpt ion Propert y 736
PageOpt ion Example VB 737
PageOpt ion Example VC++ 737
PageType Propert y 738
ScanTo Propert y 739
ScanTo Example VB 740
ScanTo Example VC+ + 741
Scroll Propert y 741
Show Set upBef oreScan Propert y 742
Show Set upBef oreScan Example VB 742
Show Set upBef oreScan Example VC+ + 743
St opScanBox Propert y 743
Zoom Propert y 744
CloseScanner M et hod 745
Get CompressionPref erence M et hod 745
Get CompressionPref erence Example VB 748
Get CompressionPref erence Example VC++ 748
Get PageTypeCompressionInf o M et hod 749
Get PageTypeCompressionInf o Example VB 750
Get PageTypeCompressionInf o Example VC++ 751
Get PageTypeCompressionType M et hod 751
Get PageTypeCompressionType Example VB 752
Get PageTypeCompressionType Example VC+ + 753
Get ScanCapabilit y M et hod 753
Get ScanCapabilit y Example VB 757
Get ScanCapabilit y Example VC+ + 758
OpenScanner M et hod 759
OpenScanner Example VB 760
OpenScanner Example VC+ + 761
Cont ent s
xxxv
Reset Scanner M et hod 762
ScannerAvailable M et hod 762
ScannerAvailable Example VB 763
ScannerAvailable Example VC+ + 763
Set PageTypeCompressionOpt s M et hod 764
Set PageTypeCompressionOpt s Example VB 768
Set PageTypeCompressionOpt s Example VC++ 768
Set ScanCapabilit y M et hod 768
Set ScanCapabilit y Example VB 771
Set ScanCapabilit y Example VC+ + 771
Show ScanNew M et hod 772
Show ScanNew Example VB 773
Show ScanNew Example VC++ 774
Show ScanPage M et hod 774
Show ScanPage Example VB 775
Show ScanPage Example VC+ + 776
Show ScanPref erences M et hod 776
Show ScannerSet up M et hod 778
Show Select Scanner M et hod 778
St art Scan M et hod 779
St art Scan Example VB 779
St art Scan Example VC++ 780
St opScan M et hod 780
PageDone Event 781
ScanDone Event 781
ScanSt art ed Event 782
ScanUIDone Event 782
Image Scan Ext ender Propert ies 783
Cont ent s
xxxvi
11 Image Thumbnail Cont rol
What t he Image Thumbnail Cont rol Let s You Do 788
What t he Image Thumbnail Cont rol Let s Your
Users Do 789
Prerequisit es 789
Aut oSelect Propert y 790
Aut oSelect Example VB 790
BackColor Propert y 791
BackColor Example VB 791
BorderSt yle Propert y 791
DropFailed Propert y 792
DropFailed Example VB 792
EnableDragDrop Propert y 794
EnableDragDrop Example VB 795
First Select edThumb Propert y 796
First Select edThumb Example VB 796
Highlight Color Propert y 797
Highlight Color Example VB 797
Highlight Select edThumbs Propert y 798
Highlight Select edThumbs Example VB 798
Image Propert y 799
Image Example VB 799
Last Select edThumb Propert y 800
Last Select edThumb Example VB 800
M ouseIcon Propert y 801
M ouseIcon Example VB 801
M ousePoint er Propert y 802
M ousePoint er Example VB 803
ReadySt at e Propert y 803
ReadySt at e Example VB 803
Cont ent s
xxxvii
ScrollDirect ion Propert y 804
ScrollDirect ion Example VB 804
Select edThumbCount Propert y 805
Select edThumbCount Example VB 805
ThumbBackColor Propert y 806
ThumbBackColor Example VB 806
ThumbCapt ion Propert y 807
ThumbCapt ion Example VB 807
ThumbCapt ionColor Propert y 808
ThumbCapt ionColor Example VB 808
ThumbCapt ionFont Propert y 809
ThumbCapt ionFont Example VB 809
ThumbCapt ionSt yle Propert y 810
ThumbCapt ionSt yle Example VB 811
ThumbCount Propert y 811
ThumbCount Example VB 812
ThumbDropNames Propert y 812
ThumbDropNames Example VB 813
ThumbDropPages Propert y 813
ThumbDropPages Example VB 814
ThumbHeight Propert y 815
ThumbHeight Example VB 815
ThumbSelect ed Propert y 816
ThumbSelect ed Example VB 816
ThumbWidt h Propert y 817
ThumbWidt h Example VB 817
ClearThumbs M et hod 818
Delet eThumbs M et hod 819
Delet eThumbs Example VB 819
Deselect AllThumbs M et hod 820
Deselect AllThumbs Example VB 820
Cont ent s
xxxviii
DisplayThumbs M et hod 821
DisplayThumbs Example VB 821
Generat eThumb M et hod 822
Generat eThumb Example VB 823
Get M anualThumbFilename M et hod 824
Get M anualThumbFilename Example VB 824
Get M anualThumbPage M et hod 825
Get M anualThumbPage Example VB 825
Get M aximumSize M et hod 826
Get M aximumSize Example VB 827
Get M inimumSize M et hod 827
Get M inimumSize Example VB 828
Get ScrollDirect ionSize M et hod 829
Get ScrollDirect ionSize Example VB 830
Insert Thumbs M et hod 831
Insert Thumbs Example VB 832
Ref resh M et hod 832
Ref resh Example VB 833
SaveAs M et hod 833
SaveAs Example VB 835
ScrollThumbs M et hod 836
ScrollThumbs Example VB 837
Select AllThumbs M et hod 837
Select AllThumbs Example VB 837
Set M anualM ode M et hod 838
Set M anualM ode Example VB 838
Set M anualThumb M et hod 839
Set M anualThumb Example VB 839
Set SaveAsBackColor M et hod 840
Set SaveAsBackColor Example VB 840
Set SaveAsCapt ion M et hod 841
Cont ent s
xxxix
Set SaveAsCapt ion Example VB 841
Set SaveAsCapt ionFont M et hod 842
Set SaveAsCapt ionFont Example VB 843
Set SaveAsDimensions M et hod 843
Set SaveAsDimensions Example VB 844
Set SaveAsOrient at ion M et hod 845
Set SaveAsOrient at ion Example VB 845
Set SaveAsThumbType M et hod 846
Set SaveAsThumbType Example VB 846
UISet ThumbSize M et hod 847
UISet ThumbSize Example VB 848
St andard Event s (Thumbnail Cont rol) 849
ThumbDrag Event 850
ThumbDrop Event 850
ThumbDrop Example VB 851
Image Thumbnail Ext ender Propert ies 851
Image Thumbnail Ext ender M et hods 853
Image Thumbnail Ext ender Event s 853
A Imaging Act iveX Sample Applicat ions
Overview 856
Requirement s 856
Sample Applicat ions 857
Image Edit or Samples 857
East man Sample 857
Image Edit or 858
Funct ion Specif ic Samples 858
Image Print 859
Image Propert ies 859
Image Scan 860
Image Thumbnails 860
Cont ent s
xl
Imaging Flow Samples 861
Flow Program 861
Flow Variables 861
B Imaging Act iveX Tips and Tricks
Tips and Tricks 864
M iscellaneous Programming Tips 864
How t o use f unct ions of t he Version 2.0 Act iveX sample
applicat ions 864
Specif y t ent hs of degrees w hen calling
rot at ion met hods 865
Use t he DisplayScaleAlgorit hm propert y t o scale black-
and-w hit e image pages t o gray 865
Cat ch errors properly w hen w orking w it h t he
Show FileDialog met hod 865
Alw ays pass t he parent w indow handle w hen invoking
t he Show Print Dialog met hod 866
How t o ret ain generat ed f ile names w hen
t emplat e scanning 866
How t o clear a select ion rect angle 867
Prevent f licker w hen using t he Image Edit and Image Thumb-
nail cont rols simult aneously 867
Image File M anagement Tips 868
Provide f ile t ype and page propert y opt ions t o your us-
ers 868
Use t he Append met hod t o assemble several image f iles
int o one mult ipage TIFF image f ile 870
Alw ays clear a displayed image page bef ore delet ing it
870
Use caut i on w hen copyi ng select ed image dat a t o t he Clip-
board 871
Annot at ion Tips 871
Let your users modif y t he propert ies of a draw n annot a-
t ion 871
Guidelines f or making annot at ions
permanent 872
How t o ret ain annot at i ons w hen users
navigat e mult ipage image f iles 872
When print i ng annot at i ons 873
Cont ent s
xli
Opt ical Charact er Recognit ion Tips 873
When w orki ng w i t h Int eract i ve Traini ng 873
When perf orming OCR 874
C Imaging Act iveX Cont rols Summary
Overview 878
Imaging Act iveX Table Def init ions 878
Product Version Headings 878
Cell Ent ries 879
Image Admin Cont rol 881
Image Admin Cont rol (cont inued) 882
Image Admin Cont rol (cont inued) 883
Image Admin Cont rol (cont inued) 884
Image Admin Cont rol (cont inued) 885
Ext ender Propert ies, M et hods, and Event s of t he Image Admin
Cont rol 886
Image Annot at ion Tool But t on Cont rol 887
Image Annot at ion Tool But t on Cont rol (cont inued) 888
Ext ender Propert ies, M et hods, and Event s of t he Image Annot at ion
Tool But t on Cont rol 889
Ext ender Propert ies, M et hods, and Event s of t he Image Annot at ion
Tool But t on Cont rol (cont inued) 890
Image Edit Cont rol 891
Image Edit Cont rol (cont inued) 892
Image Edit Cont rol (cont inued) 893
Image Edit Cont rol (cont inued) 894
Image Edit Cont rol (cont inued) 895
Image Edit Cont rol (cont inued) 896
Image Edit Cont rol (cont inued) 897
Image Edit Cont rol (cont inued) 898
Image Edit Cont rol (cont inued) 899
Image Edit Cont rol (cont inued) 900
Image Edit Cont rol (cont inued) 901
Ext ender Propert ies, M et hods and Event s of t he Image Edit
Cont rol 902
Cont ent s
xlii
Ext ender Propert ies, M et hods and Event s of t he Image Edit Cont rol
(cont inued) 903
Image OCR Cont rol 904
Image OCR Cont rol (cont inued) 905
Ext ender Propert ies, M et hods and Event s of t he Image OCR
Cont rol 906
Image Scan Cont rol 907
Image Scan Cont rol (cont inued) 908
Image Scan Cont rol (cont inued) 909
Ext ender Propert ies, M et hods, and Event s of t he Image Scan Cont rol
910
Image Thumbnail Cont rol 911
Image Thumbnail Cont rol (cont inued) 912
Image Thumbnail Cont rol (cont inued) 913
Image Thumbnail Cont rol (cont inued) 914
Image Thumbnail Cont rol (cont inued) 915
Ext ender Propert ies, M et hods and Event s of t he Image Thumbnail
Cont rol 916
Ext ender Propert ies, M et hods, and Event s of t he Image Thumbnail
Cont rol (cont inued) 917
Index
1
Imaging In Development
This chapter introduces you to the E astman S oftware Imaging Professional
D evelopers G uide.
The chapter begins by descr ibing the guide and the Imaging for
Windows product. It continues by explaining what Imaging for
Windows lets you do and what it lets your users do. The chapter
concludes by explaining the concepts of business and personal
document imaging.
In This Chapt er
Welcome t o t he Prof essional Developers Guide ............................. 2
Int roducing Imaging f or Window s ................................................. 3
What Imaging Let s You Do ............................................................ 9
What Imaging Let s Your Users Do ................................................ 19
What Exact ly Is Document Imaging? ............................................ 20
Compiling and Dist ribut ing Your Image-Enabled Applicat ion ........ 22
Import ant Not ice Concer ning t he Use of LZW Compression ......... 24
Document at ion Convent ions ....................................................... 25
Chapt er 1
2
Welcome t o t he Prof essional Developers Guide
This sect ion int roduces you
t o t he Imaging Prof essional
Developers Guide.
The E astman S oftware Imaging Professional D evelopers G uide provides
software developers and MIS professionals with the infor mation they
need to understand, produce, and support image- enabled applications
that run on Microsoft Windows 95, Windows 98, and Windows NT
4.0 and greater.
This guide is a technical resource that supplements the documentation
included with the Imaging for Windows product. For instructions on
how to use Imaging for Windows, refer to its on- line help system. You
can access on- line help from the Help menu of any Imaging for
Windows application.
For instructions on how to use the Imaging ActiveX controls, access the
on- line help system for the controls from your development
environment. (R efer to Chapters 4 and 6 in this guide for instructions.)
In addition to this pr inted book, the developers guide includes a compact
disc (CD) that contains the following items:
s
An updated Imaging ActiveX controls help system.
s
Sample code that helps you image- enable your applications. (R efer to
Sample Code later in this chapter for more infor mation.)
s
The Imaging Professional D evelopers G uide in Portable Document
For mat (PDF).
Not e: To view t he developers guide on-line, t he Adobe Acrobat
Reader (Version 3.0 or great er) must be inst alled on your syst em.
You can obt ain t he reader f ree of charge f rom Adobe Syst ems
Incorporat ed, at :
http://www.adobe.com
Imaging In Development
3
Int roducing Imaging f or Windows
This sect ion describes t he
Imaging f or Windows
product .
E astman S oftware Imaging for Windows is a multifaceted product that lets
users transfor m paper documents and faxes into electronic documents
that can be viewed, annotated, edited, converted, pr inted, and shared.
There are several versions of Imaging for Windows. At the time of this
wr iting, they are the following:
Imaging for Windows 95 Created by Eastman Software, Inc.
(then- Wang Software) for Microsoft Cor poration, Imaging for Windows
95 ships as a standard component of the Windows 95 operating system
(OSR 2 release).
Imaging for Windows NT Also created for Microsoft
Corporation, Imaging for Windows NT ships as a standard component
of the Windows NT operating system (Version 4.0 and greater).
Imaging for Windows 98 Also created for Microsoft Corporation,
Imaging for Windows 98 ships as a standard component of the Windows
98 operating system.
Imaging for Windows Professional Edition Available for
purchase from the Eastman Software Web site and other places, Imaging
Professional provides increased capabilities over the standard version of
the product. It runs on Windows 95, Windows 98, and Windows NT
4.0 and greater.
Not e: If you or your users have a version of Window s 95 t hat is earlier
t han t he OSR2 release, Imaging f or Window s 95 is not included
w it h t he operat ing syst em.
To det ermine w het her Imaging is inst alled, have your users
check t he Accessories menu on t he PC. If Imaging does not
appear on t his menu, it must be dow nloaded f rom t he Web and
inst alled.
Imaging f or Window s 95 is available f ree-of -charge f rom t he
East man Sof t w are Web sit e, at :
http://www.eastmansoftware.com
Chapt er 1
4
Imaging Component s
Imaging for Windows has several components. The following sections
br iefly descr ibe them.
Imaging Applicat ion
The Imaging application is the main component of Imaging for
Windows. It enables users to scan, view, annotate, manipulate, store, and
perfor m Optical Character R ecognition (OCR ) on faxes, paper
documents, and electronic images. (OCR is available with Imaging
Professional only.)
Imaging In Development
5
Imaging Preview
Imaging Preview is a lean version of the Imaging application. It lets users
view image files quickly and, if necessary, load them into the Imaging
application for editing.
Imaging Preview is available with Imaging for Windows 98 and Imaging
Professional only.
Chapt er 1
6
Imaging Flow
Imaging Flow enables users to automatically capture, process, and output
image files. An intelligent and editable procedure called a flow
defines and controls the work Imaging Flow perfor ms.
Flow tools included within each flow perfor m specific functions. They
can:
s
Capture images from:
Scanners.
MAPI- compliant in- boxes.
Local and network folders.
s
Process images by:
Converting them from one file type to another.
Applying compression.
Enhancing their appearance.
Per mitting their review.
Converting them to text.
s
Output images by:
Posting them to Exchange folders.
Saving them to local or network folders.
Pr inting them.
Sending them to others via e- mail.
Imaging In Development
7
Imaging Flow is available with Imaging for Windows Professional
Edition only.
Chapt er 1
8
Development Tools and Met hods
Imaging for Windows includes a r ich set of development tools and
methods that let you the software developer add Imaging functions
to your applications.
To add Imaging functions, you must be using a development
environment that supports OLE, Automation, and ActiveX controls;
such as:
s
Microsoft Visual Basic
s
Microsoft Visual C+ +
s
Microsoft Office (Visual Basic for Applications)
s
Microsoft Visual J+ +
s
Borland Delphi
s
Powersoft PowerBuilder
Imaging In Development
9
What Imaging Let s You Do
This sect ion describes what
Imaging f or Windows let s
developers do.
Imaging for Windows includes several development tools and methods
that let you add Imaging functions to your 32- bit applications. The
development tools and methods include:
s
Command- line invocation
s
OLE
s
Automation
s
ActiveX controls
The following sections descr ibe them, help you deter mine which one to
use, and br iefly descr ibe the sample code contained on the
companion CD.
Command-line Invocat ion
You can invoke the Imaging application using its command line. Because
the command line can accept a fully qualified image file name, you can
use standard Shell functions within your application to invoke the
Imaging application with an image on display.
Within your call to the Shell function, include the path and file name of
the Imaging application along with the path and file name of the image
file you want it to display. (R efer to the examples on page 13.) The
following table lists the file names of the Imaging application by version.
Imaging f or Windows File Names By Version
File Name Product Version
wangimg.exe Imaging for Windows 95
Imaging for Windows NT 4.0
Imaging for Windows Professional Edition
V1.0 and 1.1
kodakimg.exe Imaging for Windows NT 5.0 and greater
Imaging for Windows 98
Imaging for Windows Professional Edition
V2.0 and greater
Chapt er 1
10
OLE
You can use standard OLE functions to embed and link image files in
your application and other applications, such as Microsoft Word, Excel,
Access, and SQL Server.
For example, you can use Visual Basics OLE Container control to easily
embed or link image files in your application.
Your application is the container, while the Imaging application is the
server. Users can edit and open embedded or linked image files, as
descr ibed in the following sections.
Embedded Image Files
When you embed an image file in your application, the application stores
the image data within it.
When end users edit an embedded image file, it becomes in- place
activated, causing your application to display a subset of the Imaging
application menus. The menus provide access to Imaging functions that
let users edit the activated image file in- place; that is, within your
application.
When end users open an embedded image file, the Imaging application
appears with the embedded image displayed within it. Changes users
make to the image in the Imaging application also appear on the linked
image in your application. If desired, users can save a copy of the image
to another file by clicking SaveAs on the File menu.
Linked Image Files
When you link an image in your application, the image data remains
external to your application. Your application stores only a reference to
the image file.
Not e: The name Wang appears in t he f ile name of early versions of t he
Imaging applicat ion because Wang Sof t w are, t he sof t w are unit
of Wang Laborat ories, Inc., produced t hose versions.
The East man Kodak Company acquired Wang Sof t w are in 1997,
creat ing East man Sof t w are, Inc.
Imaging In Development
11
When end users edit or open a linked image file, the Imaging
application appears with the image file displayed, which enables them to
perfor m the full range of Imaging functions on the displayed image file.
In- place activation is not available because the linked image file may also
be available to other containers (referential integr ity).
As in the case of embedded image files, changes users make to the image
in the Imaging application also appear on the linked image in your
application.
Aut omat ion
You can use Automation to image- enable your application.
Automation is a more powerful way to image- enable your application. It
enables you to control the Imaging application programmatically from
your application and provide your users with the capabilities contained
within the Imaging application.
The Imaging application implements Automation as a full object model,
similar to the Automation model of Microsoft Word and Excel.
The object hierarchy starts with the Application object, continues with
an ImageFile object and one or more Page objects, and then concludes
with a Page R ange object. Each object has its own set of properties and
methods.
Not e: You can also use Aut omat ion t o cont rol t he Imaging applicat ion
f rom ot her Aut omat ion-capable applicat ions, such as M icrosof t
Word and Excel.
How ever, you cannot use Aut omat ion t o cont rol t he Imaging
Preview and Imaging Flow applicat ions.
Not e: Chapt er 2 of t his guide explains Imagings implement at ion of
Aut omat ion. Chapt er 3 describes t he propert ies and met hods of
each object .
Chapt er 1
12
Act iveX Cont rols
You can use ActiveX controls to image- enable your application.
Using ActiveX controls is another powerful way to include Imaging
functions within your application. Imaging for Windows provides the
following ActiveX controls:
Image Admin control The Image Admin control manages
administrative functions, such as: creating, opening, saving, and pr inting
image files; appending, inserting, and deleting image pages; and enter ing
Summary property infor mation.
(Summary property functions are available with Imaging Professional
only.)
Image Annotation Tool Button control The Image Annotation
Tool Button control lets you create customized annotation tool bars for
use within your application. The control links with the Image Edit
control to provide annotation drawing and management functions to
your end users.
Image Edit control The Image Edit control manages all image
display and annotation functions. Its huge ar ray of properties, methods,
and events provide Imaging functions, such as: displaying, annotating,
and editing images; rotating, flipping, and zooming images; applying
compression to images; and copying, cutting, and pasting images to and
from the Clipboard.
Image OCR control The Image OCR control manages the
recognition and recomposition of image files. It lets users convert images
into editable text documents. Output for mats include Microsoft Word/
R ich Text For mat (RTF), Corel WordPerfect, Hypertext Markup
Language (HTML), and text.
(The Image OCR control is available with Imaging Professional only.)
Image Scan control The Image Scan control manages the scanning
of documents using TWAIN- compliant image acquisition devices.
TWAIN (Technology Without An Interesting Name) is an industry-
standard interface between image- enabled applications and image
acquisition devices.
Imaging In Development
13
Image Thumbnail control The Image Thumbnail control displays
and manages thumbnail renditions of individual image pages.
Which t o Use: Command-line Int erf ace, OLE, Aut omat ion, or
Act iveX Cont rols?
The following sections descr ibe the major differences in using the
command- line interface, OLE, Automation, or ActiveX controls to
image- enable an application.
Command-line Int erf ace
Command- line invocation is the most simple but least powerful way to
implement Imaging functions in your application.
You can invoke the Imaging application using standard Shell functions,
by including the executable file name of the Imaging application and the
fully qualified file name of a supported image file.
For example, if you are developing under Imaging for Windows 95,
Imaging for Windows NT 4.0, or Imaging for Windows Professional
Edition V1.0 or V1.1, you can use the following statement to invoke the
Imaging application and display an image file:
Shell("c:\Windows\Wangimg.exe c:\Quote.tif", 1)
If you are developing under Imaging for Windows 98 or Imaging for
Windows Professional Edition V2.0 or greater, you can use the following
statement to invoke the Imaging application and display an image file:
Shell("c:\Windows\Kodakimg.exe c:\Quote.tif", 1)
Employing the command- line interface does not make the Imaging
application a full- fledged component of your application. The
command- line interface does not give you the opportunity to manipulate
the application or the image after it is displayed.
Not e: Chapt ers 4 t hrough 6 of t his guide explain how t o get st art ed
w it h t he Imaging Act iveX cont rols and w alk you t hrough several
sample programs.
Chapt ers 7 t hrough 11 of t his guide describe t he propert ies,
met hods, and event s of each Imaging Act iveX cont rol. Every
t opic indicat es t he Imaging version t hat support s each propert y,
met hod, and event .
Chapt er 1
14
OLE
OLE lets you add a subset of Imaging functions to your application. It is
useful when you want to add Imaging functions with an absolute
minimum of coding.
Using a container control such as that provided by Visual Basic, you can
add image files as insertable objects within your application at design
time. Image files may be embedded or linked.
As an alternative, you can use the container control to create a
placeholder in your application for image files that will be added at run
time. Set the appropr iate properties or provide end users with drag- and-
drop capability so they can select image files for display at run time.
Users can edit embedded images within your application and linked
images within the Imaging application.
OLE does not make the Imaging application a full- fledged component of
your application. OLE does not give you the opportunity to manipulate
the application or the image after it is displayed.
Aut omat ion
Automation lets you add Imaging functions to your application by
making the Imaging application a full- fledged component of your
application.
Automation is useful when you want images to be displayed in a window
that is separate from your application and when you want to control the
Imaging application from your application.
Your application can control the state of the Imaging application as well
as manipulate the displayed image. But, unlike using the Imaging
ActiveX controls, your application cannot respond to events that occur
when users perfor m Imaging operations.
Depending on the degree of control you want to exert, automating the
Imaging application from your application can be accomplished with a
minimal or substantial amount of coding.
Example
Imaging Flow, a component of Imaging for Windows Professional
Edition, demonstrates a good example of Automation.
The R eview flow tool invokes the Imaging application to per mit users to
review image files as they are being processed by the cur rent flow.
Imaging In Development
15
At flow design time, the author can set R eview tool options that
manipulate the Imaging application as well as the image it displays. These
options include:
s
Whether to view image pages, thumbnails, or both.
s
The size and position of the Imaging application window.
s
The zoom setting to apply to images.
s
Whether to open image files as read only.
s
Whether to scale black- and- white images to gray.
Act iveX Cont rols
The Imaging ActiveX controls let you add Imaging functions to your
application by making the functions an integral part your application.
The controls are useful when you want to display images within a window
in your application and when you want to manipulate all Imaging
functions from within your application.
While the ActiveX controls add overhead to your application, they give
you the power to deter mine the range of Imaging functions to be
provided. And, unlike Automation, the ActiveX controls support
extender as well as intr insic events, which enable your application to
respond to events that occur when users perfor m Imaging operations.
Depending on the Imaging functions you want to provide, image-
enabling your application with ActiveX controls can require more coding
when compared to Automation.
Example
The demonstration projects in Chapters 4 through 6 of this guide are
excellent examples of using the Imaging ActiveX controls to image-
enable applications.
You can also use t he Imaging
Act iveX cont rols t o add
imaging f unct ions t o Web
pages.
Chapt er 1
16
Sample Code
The companion CD contains sample code designed to help you add
Imaging functions to your applications.
Before you can use the sample code, you need to:
s
Set up Imaging for Windows on your development system (if
necessary).
s
Set up Microsoft Excel 97 and be familiar with Visual Basic for
Applications (for the Automation demonstration project).
s
Set up and be familiar with Visual Basic 5.0 or greater (for the
ActiveX demonstration projects and the ActiveX sample
applications).
s
Set up and be familiar with Visual J+ + Version 1.1 or greater (for the
ActiveX/ Web demonstration project).
The following sections br iefly descr ibe the sample code on the CD.
Aut omat ion Demonst rat ion Project
The Automation demonstration project shows you how to use
Automation in Excel 97 to:
s
Invoke the Imaging application.
s
Display an image.
s
Select the view mode.
s
R otate the image.
s
Obtain the number of pages in the image file.
Chapter 2 of this guide walks you through the Automation project.
Act iveX Demonst rat ion Project s
The ActiveX demonstration projects are small Visual Basic applications
that show you how to:
s
Display an image and apply fit- to options.
s
Convert an image.
Not e: When you set up Visual Basic 5.0 or great er, you must perf orm a
Typical inst allat ion. If you don t , t he sample code supplied w it h
t he Imaging Prof essional Developers Guide may not f unct ion
correct ly.
Imaging In Development
17
s
Copy an image.
s
Print an image.
s
Scan images using a template.
s
R eorganize an image file using thumbnails.
s
Unload a multipage image file.
s
Access an interact with E astman S oftware Imaging 1.x and Imaging 3.x
servers.
Chapters 4 and 5 of this guide walks you through each demonstration
project.
Act iveX/Web Demonst rat ion Project
The ActiveX/ Web demonstration project is a small Java applet that shows
you how to:
s
Display a multipage image file in a Web page.
s
R otate an image page.
s
Navigate an image file.
Chapter 6 of this guide walks you through the demonstration project.
Act iveX Sample Applicat ions
The ActiveX sample applications are relatively large Visual Basic projects
that show you how the Imaging ActiveX controls may be used to create
comprehensive and useful image- enabled applications.
While walking you through each sample application is beyond the scope
of this guide, Eastman Software, Inc. suggests that you run each
application and analyze its code to deter mine whether you can use the
code directly in your application or as a guide to wr iting your own,
related code.
The code in each sample project is highly organized, heavily
commented, and wr itten using Hungar ian notation. The sample
applications show you how to:
s
Create an application that virtually mirrors the standard Imaging
application.
s
Develop an application that prepares separator pages for scanning
several multipage documents in the Imaging Flow application.
s
Perfor m template scanning.
Chapt er 1
18
s
Use the Image Thumbnail control to create folder- based contact
sheets.
s
Print a selected portion of an image.
s
Use General and Page properties to analyze image files in folders.
Appendix A descr ibes each sample application in greater detail.
Imaging In Development
19
What Imaging Let s Your Users Do
Imaging for Windows lets your users access and control paper- based
infor mation directly on their PCs. With it, users can view, manipulate,
annotate, pr int, file, and share documents they used to manage as
cumbersome paper files.
The following types of business documents are ideal subjects for image
processing:
s
Business cards
s
Letters
s
Legal documents
s
Handwr itten meeting notes
s
Memoranda
s
Newsclips
s
Technical drawings
The following types of personal documents are also ideal subjects for
image processing:
s
Childrens drawings
s
Hobby- related documents
s
Household bills
s
Legal documents
s
Letters from fr iends
s
Magazine and newspaper articles
s
Medical and insurance records
s
R eceipts
s
Tax for ms
Depending on how you design and code your application, you can
enable your users to:
s
Scan images.
s
R etr ieve and display images.
s
Annotate, edit, and manipulate images.
s
Convert, copy, and OCR images.
s
Append, insert, and replace image pages.
s
Display and manage thumbnail representations.
s
Set the Summary properties of images for easier retr ieval.
s
Print, save, and send images.
Chapt er 1
20
What Exact ly Is Document Imaging?
Imaging for Windows technology br ings Imaging functions to many
business and personal users particularly where Imaging for Windows
is on virtually every desktop running Windows 95, Windows 98, and
Windows NT 4.0 and greater.
The following sections descr ibe the concepts of business and personal
document imaging.
Business Document Imaging
Business document imaging is a technology that converts paper
documents into an electronic for m, where they can be automated using
standard computer technology.
Most business infor mation is in the for m of paper documents. Industry
analysts report that about 94 percent of business infor mation is on paper
and that 2.7 billion new sheets of paper are filed into folders every single
day.
Paper has obvious advantages, such as portability, ease of use, and low
cost. However, paper also has ser ious drawbacks. At any given time,
between three and five percent of a company's files are lost or misplaced.
With the average cost of recreating a document at around $180, the cost
of losing important business documents can be an expensive one indeed.
Perhaps papers most ser ious drawback is that paper- based infor mation is
not as readily accessible as computer- based data. A manual business
process, not an automated one, uses paper best. To make matters worse,
paper- based documents and their respective data usually reside separate
from related paper- based documents and their data.
Obtaining infor mation readily or providing the r ight infor mation to the
r ight person at the r ight time is difficult and costly with the paper-
based, manual business process. So, while paper is the major infor mation
base of a business, it remains outside of the business infor mation system
because it is not easily and reliably accessible.
Computer- based infor mation, on the other hand, is always readily and
reliably accessible. Business document imaging is the process of turning
paper- based infor mation into computer- based infor mation.
By using a computer to capture paper documents as electronic images,
you can apply all the benefits and power of database, e- mail, networking,
fax, and storage technology to what was once manually processed
infor mation.
Imaging In Development
21
Personal Document Imaging
As is the case with business document imaging, personal document
imaging is the process of tur ning paper- based infor mation into
computer- based infor mation.
Like business infor mation, most personal infor mation is in the for m of
paper documents. From personal cor respondence with companies to tax
for ms to hobby- related documents and childrens drawings, the
infor mation in our personal lives is very much paper- centr ic.
Paper- based personal documents are also subject to per manent loss and
temporary misplacement. Theyre also not as readily accessible as
computer- based documents.
By using a computer to capture personal paper- based documents as
electronic images, you can store letters, tax for ms, and receipts in an
organized manner that makes finding them easier. You can preserve
college records, hobby- related documents, and childrens drawings for
many years not to mention share them with family and fr iends by
sending them over the Internet.
Chapt er 1
22
Compiling and Dist ribut ing Your Image-Enabled
Applicat ion
You need to make sure that you compile your image- enabled application
with the appropr iate version of Imaging for Windows.
You also need to make sure that your end users acquire and set up the
appropr iate version of Imaging for Windows pr ior to installing your
software.
The version of Imaging for Windows you need when compiling your
application and the version your end users need to install largely
depends on the features you have included in your software.
You Included Imaging f or Windows Prof essional Edit ion Feat ures
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 guide), 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 f or Windows Prof essional Edit ion
Feat ures
If you did not use a control, property, method, event, or parameter
provided exclusively by Imaging for Windows Professional Edition
and you want your application to be used by Imaging for Windows 95,
98, or NT users you must compile your application with the
appropr iate version of Imaging for Windows (95, 98, or NT).
Imaging In Development
23
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 appropr iate version of Imaging for Windows as a
prerequisite to using your program (if they havent already).
Not e: Do not dist ribut e t he Imaging OCX f iles w it h your applicat ion,
because doing so w ill not inst all Imaging f or Window s correct ly.
Inst ead, have your users set up t he ent ire Imaging f or Window s
applicat ion t o ensure t hat all of t he required sof t w are is inst alled
and regist ered properly.
This guide assumes t hat users of Imaging f or Window s 95 are
using t he OSR2 release, available f ree of charge f rom t he East -
man Sof t w are Web sit e, at :
http://www.eastmansoftware.com/
Imaging f or Window s NT 4.0 ships as a component of Window s
NT Workst at ion 4.0.
Imaging f or Window s 98 ships as a component of Window s 98.
Chapt er 1
24
Import ant Not ice Concerning t he 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 Cor poration.
Eastman Software, Inc.s grant of license from Unisys does not per mit you
to use LZW compression or decompression capabilities from any version
of Imaging for Windows for development purposes, or to use or der ive
the LZW capabilities from an Eastman Software third- party application
or other der ivative software.
Contact Unisys for licensing infor mation at:
Unisys Cor poration
Welch Licensing Dept. MSC1SW19
Township Line and Union Meeting R oads
P.O. Box 500
Blue Bell, PA 19424- 0001
Fax: (215) 986- 3090
Web: www.unisys.com
Imaging In Development
25
Document at ion Convent ions
This guide uses the following conventions.
You should keep the code on one line in your program, or use the line
continuation character provided by your programming environment.
R efer to the documentation that came with your programming
environment for more infor mation on the line continuation character
and its proper placement in your code.
Note that the character does not necessar ily indicate the proper place
for a line continuation character in your code.
Convent ions Descript ion
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
infor mation you must provide.
[expressionlist] In the syntax section, items appear ing
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.
&KO Z #U +(QPV&KUR 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.
2
Adding Imaging Using Aut omat ion
This chapter explains how to use Automation to image- enable your
applications. It begins by descr ibing the object hierarchy of the Imaging
application and continues by descr ibing how the Imaging application can
function as an Automation server application or an Embedded server
application. The chapter concludes by walking you through a sample
project to help you get started.
In This Chapt er
Overview ..................................................................................... 28
The Object Hierarchy ................................................................... 28
Aut omat ion Server and Embedded Server M odes......................... 30
Demonst rat ion Project ................................................................. 36
Chapt er 2
28
Overview
Imaging for Windows features a r ich Automation interface that provides
programmatic access to the inter nal services of the Imaging application.
Using Automation, you can provide your users with the image display
and manipulation functions that are contained within the Imaging
application. You, in effect, make the Imaging application a fully
functional, tested, and trusted component of your application.
In addition to automating the Imaging application from your programs,
you can also automate it from other Automation- capable programs, such
as Microsoft Word and Excel.
The remainder of this chapter:
s
Outlines the Object Hierarchy of the Imaging application.
s
Descr ibes how the Imaging application can function as an
Automation server application or an Embedded server application.
s
Provides an example of automating the Imaging application from
Microsoft Excel.
The Object Hierarchy
The object model of the Imaging application includes:
s
One top- level object, called the Application object;
s
One document object, called the ImageFile object; and
s
Two objects that support the ImageFile object, called
the Page object and the PageR ange object.
Component s are sof t w are
modules t hat can b e plugged
int o applicat ions f rom ot her
vendors. They provide end
users w it h a specif ic set of
addit ional f unct ions and
capabilit ies.
Not e: The Imaging Preview and Imaging Flow applicat ions cannot be
aut omat ed.
Application Object
ImageFile Object
Page Object
PageR ange O bject
Adding Imaging Using Aut omat ion
29
The first time you start the Imaging application, it adds the Application
object to the Windows registry. Imaging Automation exposes only the
Application object for creation. Other programmable objects can be
created by referencing the Application object.
Each object in the hierarchy has its own set of properties and methods.
R efer to Chapter 3 for a descr iption of the properties and methods of
each object.
Applicat ion Object
Use the Application object to create an instance of the Imaging appli-
cation and to control it. The Application object controls every other
object you create as well as the environment of the application; such as
the applications size and position.
ImageFile Object
The ImageFile object represents an image document file. Use it to
specify the name of an image file and to provide basic filing functions
such as open, save, close, pr int, insert, update, and append. Use it also to
provide image manipulation functions such as rotate, create contact sheet,
and perfor m OCR .
Page Object
Each Page object represents an image document page. Use it to
manipulate the individual pages of an image file and to provide func-
tions such as delete, flip, pr int, rotate, scroll, and perfor m OCR .
Not e: Cont act sheet s and OCR are available w it h Imaging f or
Window s Prof essional Edit ion only.
Chapt er 2
30
PageRange Object
The PageR ange object represents a range of consecutive pages within an
ImageFile object starting at the StartPage property and ending at the
EndPage property. Use it to manipulate a range of pages and to provide
page manipulation functions such as delete, pr int, and perfor m OCR .
Aut omat ion Server and Embedded Server Modes
The Imaging application can function as an:
s
Automation server application, or an
s
Embedded server application.
The following sections descr ibe each mode and include examples.
Aut omat ion Server Mode
In every version of Imaging for Windows, the Imaging application can
function as a stand- alone Automation server application.
When automated in this mode, the Imaging application is directed to
display and manipulate an image file that is exter nal to your application;
such as a file resident on a local or network dr ive. Your program uses the
properties and methods of the Imaging Automation objects to control
the Imaging application and to display and manipulate the image.
The demonstration project, descr ibed later in this chapter, is an excellent
example of using the Imaging application as an Automation server
application.
Not e: Aut omat ion is not aw are of t he act ions perf ormed by users
w it hin t he Imaging applicat ion. The object s know n t o
Aut omat ion remain in t he st at e t hey w ere in w hen last af f ect ed
programmat ically.
In ot her w ords, if users change a displayed object , Aut omat ion
does not updat e t hat object w it hin it s Applicat ion object . For
example, if users change t he act ive page, Aut omat ion does not
updat e t he Act ivePage propert y.
How ever, propert ies and met hods are available t hat let you
det ermine if a change has occurred. At your opt ion, you can use
t hem t o updat e t he corresponding object s know n t o
Aut omat ion.
You can use t he AppSt at e
propert y of t h e Applicat ion
object t o det ermine w het her
t he Imag ing applicat ion is
running as an Aut omat ion
server or an Embedded server.
Adding Imaging Using Aut omat ion
31
Embedded Server Mode
Beginning with Imaging for Windows Professional Edition Version 2.0,
you can use several Imaging Automation properties and methods to
manipulate an embedded image document object.
When automated in this mode, the Imaging application is directed to
manipulate an image document object that has been embedded into your
program using, for example, the OLE Container control of Visual Basic.
Depending on how you code your application, you can manipulate the
embedded image document in- place or within the Imaging application
window (refer to the next section for examples).
Examples
This section contains examples that show you how to automate the
Imaging application as a stand- alone Automation server application and
as an Embedded server application.
As an Aut omat ion Server Applicat ion
This example shows you how to use Visual Basic to automate the
Imaging application as an Automation server application. (R efer to the
code snippet at the end of this section.)
Automating the Imaging application involves a ser ies of programming
steps that begin with the creation of Application and Image File objects
and continue with the application control and image manipulation
functions you want to perfor m.
Not e: Remember t hat t he Aut omat ion int erf ace allow s t he in-place
act ivat ion of embedded object s only. It does not permit t he in-
place act ivat ion of linked object s.
Not e: The example t hat demonst rat es aut omat ing t he Imaging
applicat ion as an Aut omat ion server applicat ion is more
ext ensive because:
s
The principles behind aut omat ing t he Imaging applicat ion
are similar no mat t er w hich mode is used.
s
Use of t he Imaging applicat ion as an Aut omat ion server
applicat ion is more prevalent .
Chapt er 2
32
To create the Application and Image File Objects
1 Declare the object var iables that will contain references to the
Application and Image File objects.
2 Use the Set statement and the CreateObject function of Visual
Basic to create and return a reference to the Application object.
3 Use the Set statement of Visual Basic and the
CreateImageViewerObject method of the Application object to
create and return a reference to the ImageFile object.
With the Application and ImageFile objects instantiated, you can
now manipulate the Imaging application as well as any image the
application displays.
To manipulate the Imaging Application
1 Set the TopWindow property of the Application object to True to
have the Imaging application window remain on top of all other
applications that may be running.
2 Invoke the Open method of the ImageFile object to open and display
an image file. In your call to the Open method, pass the following
parameters:
ImageFile The path and file name of the image file to display
IncludeAnnotation (optional) True or False: whether to
display annotations that may be present in the image file
Page (optional) The number of the image page to display
DisplayUIFlag (optional) True or False: whether to display the
Open dialog box, which lets end users select the file they want to
display
Now that an image is open and on display, you can manipulate it.
The following paragraphs provide some examples.
Invoke the RotateLeft method of the Page object to rotate page 1
of the image file 90 degrees to the left. Keep in mind that there is
one Page object for each image page in the file.
Use the Height property of the Page object to assign the height of
page 1 to the local var iable lngPageHeight.
Invoke the Print method of the PageR ange object to pr int pages 1
and 2 on the default pr inter.
Set the ActivePage property of the ImageFile object to 2 to
display page 2 of the image file.
Af t er you creat e an object , you
can access t he p ropert ies and
met hods of t he object usin g
t he object variable.
A PageRange object represent s
a range of consecut ive pages
w it hin an ImageFile object .
Adding Imaging Using Aut omat ion
33
To Close the Image File and Exit the Application
1 Invoke the Close method of the ImageFile object to close the image
file.
2 Invoke the Quit method of the Application object to exit the
application.
3 Set the object var iables to Nothing to free system resources.
'&GENCTG XCTKCDNGU
&KO QDL#RR #U 1DLGEV
&KO QDL+OI #U 1DLGEV
&KO XPV2TV4CPIG #U 8CTKCPV
&KO NPI2CIG*GKIJV #U .QPI
'%TGCVG VJG #RRNKECVKQP QDLGEV 5VCPFCTF 8$ ECNN)
5GV QDL#RR - %TGCVG1DLGEV+OCIKPI#RRNKECVKQP)
'%TGCVG VJG +OCIG(KNG QDLGEV
5GV QDL+OI - QDL#RR%TGCVG+OCIG8KGYGT1DLGEV1)
'5GV VJG CRRNKECVKQP'U 6QR9KPFQY RTQRGTV[ VQ 647' UVC[ QP VQR)
QDL#RR6QR9KPFQY - 6TWG
'%CNN VJG +OCIG(KNG QDLGEV 1RGP /GVJQF VQ FKURNC[ RCIG 1 QH O[KOCIGVKH
QDL+OI1RGP E>KOCIGU>O[KOCIGVKH 6TWG 1 (CNUG
'%TGCVG CPF TQVCVG QPG 2CIG QDLGEV
QDL+OI2CIGU1)4QVCVG.GHV
'4GVWTP VJG JGKIJV QH VJG KOCIG HTQO VJG 2CIG QDLGEV
NPI2CIG*GKIJV - QDL+OI2CIGU1)*GKIJV
'%TGCVG C 2CIG4CPIG QDLGEV CPF RTKPV RCIGU 1 CPF
XPV2TV4CPIG - QDL+OI2CIGU1)2TKPV
'&KURNC[ RCIG QH VJG KOCIG
QDL+OI#EVKXG2CIG -
'%NQUG +OCIG(KNG QDLGEV CPF SWKV VJG CRRNKECVKQP
QDL+OI%NQUG
QDL#RR3WKV
'4GNGCUG U[UVGO TGUQWTEGU
5GV QDL#RR - 0QVJKPI
5GV QDL+OI - 0QVJKPI
Chapt er 2
34
Met hods Not Available in Aut omat ion Server Mode
You cannot use the following methods when the Imaging application is
functioning as an Automation server application:
s
SaveCopyAs method of the ImageFile object
s
Update method of the ImageFile object
As an Embedded Server Applicat ion
The following sections demonstrate how to automate the Imaging
application as an Embedded server application. The examples assume you
are embedding an image document object into a Visual Basic application
using the OLE Container control.
Example 1
In this example, the Imaging application displays the embedded image
document in a separate window for editing.
Example 2
In this example, the Imaging application is in- place active and displays a
subset of its menus within your application. The menus provide access to
functions that let users edit the image document object in- place
that is, within your application.
5GV QDL#RR - %TGCVG1DLGEV+OCIKPI#RRNKECVKQP)
5GV QDL+OI - QDL#RR%TGCVG+OCIG8KGYGT1DLGEV1)
QNG+OI%TGCVG'ODGF +OCIKPI&QEWOGPV)
QNG+OI&Q8GTD XD1.'1RGP
QDL+OI+PUGTV'ZKUVKPI2CIGU 6GUVVKH 1 1 1 (CNUG
5GV QDL#RR - %TGCVG1DLGEV+OCIKPI#RRNKECVKQP)
QNG+OI%TGCVG'ODGF +OCIKPI&QEWOGPV)
QNG+OI&Q8GTD XD1.'5JQY
5GV QDL+OI - QDL#RR%TGCVG+OCIG8KGYGT1DLGEV1)
QDL+OI+PUGTV'ZKUVKPI2CIGU 6GUVVKH 1 1 1 (CNUG
Adding Imaging Using Aut omat ion
35
Example 3
In this example, the Imaging application displays the embedded image
document in an instance of the Imaging application that is already
running.
Propert ies and Met hods Not Available in Embedded Server
Mode
You cannot use the following properties and methods when the Imaging
application is functioning as an Embedded server application:
s
Edit property of the Application object
s
Height and Width properties of the Application object
s
ImageView property of the Application object (if the application is
in- place active)
s
Left property of the Application object
s
Top property of the Application object
s
Close method of the ImageFile object
s
FindOIServerDoc method of the ImageFile object
s
New method of the ImageFile object
s
Open method of the ImageFile object
s
Quit method of the Application object (if the application is in- place
active)
s
SaveAs method of the ImageFile object
QNG+OI%TGCVG'ODGF +OCIKPI&QEWOGPV)
QNG+OI&Q8GTD XD1.'1RGP
5GV QDL#RR - %TGCVG1DLGEV+OCIKPI#RRNKECVKQP)
5GV QDL+OI - QDL#RR%TGCVG+OCIG8KGYGT1DLGEV1)
Chapt er 2
36
Demonst rat ion Project
This sect ion demonst rat es
how t o aut omat e t he
Imaging applicat ion f rom
Microsof t Excel.
While a wide-ranging dis-
cussion of every Imaging
f unct ion is beyond t he scope
of t his chapt er, t he inf or-
mat ion present ed here is
suf f icient t o get st art ed.
The demonst rat ion project
was developed using
Microsof t Visual Basic f or
Applicat ions, Version 5.0 and
Excel 97.
Even if you are not going t o
aut omat e t he Imaging
applicat ion, youll f ind t he
sect ion in t his chapt er on
View Modes usef ul.
To help you use Automation to image- enable your applications, Eastman
Software, Inc. has prepared a demonstration project called
Automation From Excel that shows you how to:
s
Invoke the Imaging application and open an image.
s
Obtain the page count.
s
R otate an image page.
s
Set the desired view mode.
s
Close the image and the application.
Before walking through the demonstration project, read the following
section, which descr ibes the view modes of the Imaging application.
Chapter 4 of this guide descr ibes the concepts of image display, page
counts, multipage image files, and image rotation.
View Modes
The Imaging application has three view modes that enable users to view
and work with image files. Each view mode has its own set of advantages
and capabilities.
The ImageView property of the Application object enables you to
invoke most likely in response to user input any one of the three
view modes. You should consider making view mode selection available
to your users when automating the Imaging application.
The following sections descr ibe the view modes.
Not e: Chapt er 3 of t his guide describes t he propert ies and met hods of
each Imaging Aut omat ion object .
Developers using t he Imaging
Act iveX cont rols can use
t he Imag e Edit and Image
Thumbnail cont rols t o simulat e
t he View M ode behavior des-
cr ibed in t his sect ion. Ref er t o
Chapt ers 7 t hroug h 11 in t his
guide f or more in f ormat ion.
Adding Imaging Using Aut omat ion
37
One Page
The One Page view mode lets users display image files one page at a
time. It lets users display image pages in the entire window while
maintaining complete access to the menus, toolbars, and functions of
the application.
Chapt er 2
38
Thumbnail
The Thumbnail view mode lets users display image files as a ser ies of
thumbnail images one for each image page. It lets users:
s
View multiple image pages simultaneously.
s
R earrange pages using drag and drop.
s
Delete pages.
s
Drag and drop pages to and from other applications that support drag
and drop functionality.
Keep in mind that some Imaging functions like annotation and
zoom are not available in this mode because they are not appropr iate
for use on such small images.
Rear ranging image pages is
available w it h Imaging f or
W indow s Prof essional Edit ion
only.
Adding Imaging Using Aut omat ion
39
Page and Thumbnails
The Page and Thumbnails view mode is a combination of the first two
view modes. It enables users to display image files one page at a time and
as ser ies of thumbnail images one for each image page in the file.
This view mode lets users perfor m Imaging tasks that are available to
both the One Page view mode and the Thumbnail view mode.
Chapt er 2
40
Example
Users of Excel may want to display and manipulate an image file refer-
enced within a spreadsheet.
Scenario
In her role as a product manager for a major computer company, Eileen
regularly uses Microsoft Excel to create product configurations of PCs
sold on contract to government agencies.
After she completes a configuration spreadsheet, she typically submits it
to review via e- mail. In the past, several reviewers have requested that she
also include a scanned copy of the contract.
At a recent employee meeting, Eileen asked you if there was any way her
reviewers could display a scanned contract from Excel. Knowing that
Imaging for Windows is on every desktop in the company, you told her
that you could automate the Imaging application from Excel to give her
reviewers quick access to a scanned contract, or any other image file for
that matter.
All Eileen needs to do is:
1 Scan the contract using Imaging for Windows.
2 Import your code module into her Excel spreadsheet.
3 Enter the path and file name of the scanned contract in Cell A1 of the
spreadsheet.
4 Send both the image file and the spreadsheet file to her reviewers.
The Aut omat ion From Excel Project
As stated previously, the Automation From Excel project demonstrates:
s
Invoking the Imaging application and opening an image from Excel.
s
Obtaining the page count.
s
R otating an image page.
s
Setting the desired view mode.
s
Closing the image and the application.
The project consists of the following files:
AutoFromExcel.bas A Visual Basic for Applications (VBA) code
module that contains macros that automate the Imaging application.
ImagingAutomation.xls A sample spreadsheet that contains the
AutoFromExcel.bas code module.
The f ile names f or t he
Aut omat ion From Excel project
are AutoFromExcel.bas,
ImagingAutomation.xls,
and Facc.tif.
Adding Imaging Using Aut omat ion
41
Facc.tif A sample TIFF image file that simulates the title page of a
gover nment contract.
The AutoFromExcel.bas code module contains the following macros:
f_InitializeApp() Initializes the Imaging application.
s_DispImg() Displays the image file.
s_GetPagecount() Obtains the number of pages in the image file
and displays it in a worksheet cell.
s_RotateImg() R otates the image 90 degrees to the left.
s_ViewSingle() Places the Imaging application in the One Page
view mode.
s_ViewThumbnails() Places the Imaging application in the
Thumbnail view mode.
s_ViewThumbAndSingle() Places the Imaging application in the
Page and Thumbnails view mode.
s_CloseImg() Closes the image file and exits the Imaging
application.
The AutoFromExcel.bas code module uses the following Automation
methods to provide the Imaging functions:
Open method (ImageFile object) Opens the image file in the
Imaging application.
CreateImageViewerObject method (Application object) Creates
and returns an ImageFile object.
RotateLeft method (Page object) R otates the image 90 degrees
counterclockwise.
Close method (ImageFile object) Closes the ImageFile object.
Quit method (Application object) Exits the application.
Chapt er 2
42
Opening t he Spreadsheet File
Start Excel and then open the ImagingAutomation.xls file. The
sample spreadsheet appears.
Opening and Displaying t he Image File
Give focus to Cell A1, which contains the path and file name of the
sample TIFF image file.
Adding Imaging Using Aut omat ion
43
On the Tools menu, point to Macro and then click Macros. The
Macro dialog box appears.
Click the s_DispImg macro and then click Run.
When the macro runs, code in the General Declarations area of
the code module defines the constants that represent the early and recent
versions of the Imaging application. The code also declares the object
var iables that contain references to the Application and Image File
objects.
%QPUV 9#0)A+/) - YCPIKOIGZG '1NFGT XGTUKQPU QH +OCIKPI
%QPUV -1&#-A+/) - MQFCMKOIGZG '0GYGT XGTUKQPU QH +OCIKPI
&KO QDL#RR #U 1DLGEV
&KO QDL+OI #U 1DLGEV
Chapt er 2
44
Then, the s_DispImg() subroutine executes its code.
The s_DispImg() subroutine obtains the path and file name of the
image file to open from the active cell of the spreadsheet. Then it assigns
the path and file name to the strCurrentFile local var iable.
5WD UA&KUR+OI)

&KO UVT%WTTGPV(KNG #U 5VTKPI
&KO UVT%WTTGPV+OCIG0COG #U 5VTKPI

')GV HKNG PCOG VQ FKURNC[ HTQO URTGCF UJGGV
strOurrentF1e - Act1veOe.Vaue



'+H VJG #RRNKECVKQP QDLGEV PQV ETGCVGF ETGCVG KV
+H QDL#RR +U 0QVJKPI 6JGP
+H fIn1t1a1zeA) - (CNUG 6JGP '%QPVKPWG KH UWEEGUUHWN
'ZKV 5WD
'PF +H
'PF +H

'/CMG VJG +OCIKPI CRRNKECVKQP QPVQR
QDL#RR6QR9KPFQY - 6TWG

1P 'TTQT 4GUWOG 0GZV '+H PQ HKNG KU QRGP
')GV VJG PCOG QH VJG QRGP +OCIG HKNG
UVT%WTTGPV+OCIG0COG - QDL+OI0COG

1P 'TTQT )Q6Q 0 '4GUGV GTTQT JCPFNGT
+H UVT%WTTGPV+OCIG0COG 6JGP
'#NYC[U ENQUG GZKUVKPI KOCIG HKNG DGHQTG QRGPKPI C PGY QPG
QDL+OI%NQUG
'PF +H

1P 'TTQT )Q6Q 1RGP+OCIG/GVJQF'TTQT
'1RGP VJG +OCIG HKNG KP VJG #EVKXG%GNN
QDL+OI1RGP UVT%WTTGPV(KNG
'ZKV 5WD

1RGP+OCIG/GVJQF'TTQT
U/UI - 'TTQT - o 5VT!'TT0WODGT) o o 'TT&GUETKRVKQP
/UI$QZ U/UI)
'%NQUG VJG +OCIKPI CRRNKECVKQP
UA%NQUG+OI
'PF 5WD
Adding Imaging Using Aut omat ion
45
Next, the subroutine checks to see if an instance of the Imaging
application exists. If it does not, it invokes the f_InitializeApp()
function.
The f_InitializeApp() function uses the Set statement and the
CreateObject function of Visual Basic to create and return a reference
to the Application object. Then it uses the Set statement of Visual Basic
and the CreateImageViewerObject method of the Application object
to create and return a reference to the ImageFile object.
With the Application and ImageFile objects now fully instantiated,
control returns to the s_DispImg() subroutine.
The _DispImg() subroutine sets the TopWindow property of the
Application object to True to have the Imaging application window
remain on top of all other applications that may be running.
Then it checks to see if an image file is already displayed by examining
the value of the Name property of the ImageFile object. If the Name
property is not blank, the subroutine invokes the Close method of the
ImageFile object to close the displayed image file.
(WPEVKQP HA+PKVKCNK\G#RR) #U $QQNGCP
&KO UVT9KP&KT #U 5VTKPI

5GV QDL#RR - 0QVJKPI
5GV QDL+OI - 0QVJKPI
UVT9KP&KT - 'PXKTQP9KP&KT) 'FQGU PQV CRRN[ VQ 06
+H .%CUG!&KTUVT9KP&KT o > o 9#0)A+/))) - 9#0)A+/) 6JGP
Set obJA - OreateObJect"WanqImaqe.A1cat1on")
'NUG
+H .%CUG!&KTUVT9KP&KT o > o -1&#-A+/))) - -1&#-A+/) 6JGP
Set obJA - OreateObJect"Imaq1nq.A1cat1on")
'NUG
/UI$QZ 6JG +OCIKPI #RRNKECVKQP EQWNF PQV DG HQWPF)
HA+PKVKCNK\G#RR - (CNUG
'ZKV (WPEVKQP
'PF +H
'PF +H

Set obJImq - obJA.OreateImaqeV1ewerObJectI)
HA+PKVKCNK\G#RR - 6TWG
'PF (WPEVKQP
Chapt er 2
46
Next, the subroutine invokes the Open method of the ImageFile object,
passing to it the path and file name of the image to display (from
strCurrentFile). The Open method opens the image file in the
Imaging application window.
Now that the image is open and on display, you can use some of the
other macros to manipulate it and the Imaging application.
Adding Imaging Using Aut omat ion
47
Obt aining t he Page Count
On the Tools menu in Excel, point to Macro and then click Macros.
The Macro dialog box appears.
Click the s_GetPagecount macro and then click Run. The
s_GetPagecount() subroutine executes its code.
The subroutine obtains the page count from the PageCount property of
the ImageFile object and assigns it to the lngPageCount local var iable.
Then it invokes the Cells function of Excel to display the page count
(from lngPageCount)in the cell adjacent to the active cell on the
spreadsheet.
5WD UA)GV2CIGEQWPV)

&KO NPI2CIG%QWPV #U .QPI

+H QDL+OI +U 0QVJKPI 6JGP
/UI$QZ 2NGCUG 1RGP CP +OCIG HKNG HKTUV)
'ZKV 5WD
'PF +H

')GV VJG RCIG EQWPV
nqPaqeOount - obJImq.PaqeOount

'2WV VJG RCIG EQWPV KP VJG CFLCEGPV EQNWOP
OesAct1veOe.Row. Act1veOe.Ooumn I) - nqPaqeOount
'PF 5WD
Chapt er 2
48
Rot at ing an Image Page
On the Tools menu in Excel, point to Macro and then click Macros.
The Macro dialog box appears.
Click the s_RotateImg macro and then click Run. The
s_RotateImg() subroutine executes its code.
The subroutine obtains the page number of the currently displayed image
page from the ActivePage property of the ImageFile object, and assigns
it to the lngActivepage local var iable. Then it invokes the
RotateLeft method of the Page object to rotate the displayed image
page 90 degrees to the left.
5WD UA4QVCVG+OI)

&KO NPI#EVKXGRCIG #U .QPI

+H QDL+OI +U 0QVJKPI 6JGP
/UI$QZ 2NGCUG QRGP CP KOCIG HKNG HKTUV)
'ZKV 5WD
'PF +H

nqAct1veaqe - obJImq.Act1vePaqe
obJImq.PaqesnqAct1vePaqe).RotateLeft
'PF 5WD
Adding Imaging Using Aut omat ion
49
Set t ing t he One Page View Mode
On the Tools menu in Excel, point to Macro and then click Macros.
The Macro dialog box appears.
Click the s_ViewSingle macro and then click Run. The
s_ViewSingle() subroutine executes its code.
The subroutine invokes the ImageView method of the Application
object with a parameter value of 0, which places the Imaging application
in the One Page view mode.
Set t ing t he Thumbnail View Mode
On the Tools menu in Excel, point to Macro and then click Macros.
The Macro dialog box appears.
Click the s_ViewThumbnails macro and then click Run. The
s_ViewThumbnails() subroutine executes its code.
The subroutine invokes the ImageView method of the Application
object with a parameter value of 1, which places the Imaging application
in the Thumbnail view mode.
5WD UA8KGY5KPING)

+H QDL+OI +U 0QVJKPI 6JGP
/UI$QZ 2NGCUG 1RGP CP +OCIG HKNG HKTUV)
'ZKV 5WD
'PF +H

'2NCEG VJG +OCIKPI CRRNKECVKQP KP 1PG 2CIG XKGY OQFG
obJA.ImaqeV1ew - 0
'PF 5WD
5WD UA8KGY6JWODPCKNU)

+H QDL+OI +U 0QVJKPI 6JGP
/UI$QZ 2NGCUG 1RGP CP +OCIG HKNG HKTUV)
'ZKV 5WD
'PF +H
'2NCEG VJG +OCIKPI CRRNKECVKQP KP 6JWODPCKN XKGY OQFG
obJA.ImaqeV1ew - I
'PF 5WD
Chapt er 2
50
Set t ing t he Page and Thumbnails View Mode
On the Tools menu in Excel, point to Macro and then click Macros.
The Macro dialog box appears.
Click the s_ViewThumbAndSingle macro and then click Run. The
s_ViewThumbAndSingle() subroutine executes its code.
The subroutine invokes the ImageView method of the Application
object with a parameter value of 2, which places the Imaging application
in the Page and Thumbnails view mode.
Closing t he Image File and t he Imaging
Applicat ion
On the Tools menu in Excel, point to Macro and then click Macros.
The Macro dialog box appears.
Click the s_CloseImg macro and then click Run. The s_CloseImg()
subroutine executes its code.
The subroutine invokes the Close method of the ImageFile object to
close the currently displayed image file. Then it invokes the Quit
method of the Application object to close the Imaging application.
Finally, it sets the object var iables to Nothing to free system resources.
5WD UA8KGY6JWOD#PF5KPING)

+H QDL+OI +U 0QVJKPI 6JGP
/UI$QZ 2NGCUG 1RGP CP +OCIG HKNG HKTUV)
'ZKV 5WD
'PF +H

'2NCEG VJG +OCIKPI CRRNKECVKQP KP 2CIG CPF 6JWODPCKNU XKGY OQFG
obJA.ImaqeV1ew - 2
'PF 5WD
5WD UA%NQUG+OI)

1P 'TTQT 4GUWOG 0GZV
obJImq.Oose 'Oose oen 1maqe
obJA.Ou1t 'Ou1t Automat1on a1cat1on
Set obJImq - Noth1nq 'Destroy Imaqe obJect
Set obJA - Noth1nq 'Destroy A1cat1on obJect
1P 'TTQT )Q6Q 0 '4GUGV 'TTQT JCPFNGT
'PF 5WD
3
Aut omat ion Lexicon
This chapter descr ibes the properties and methods of each Imaging for
Windows Automation object.
In This Chapt er
Overview ..................................................................................... 52
Applicat ion Object ....................................................................... 53
ImageFile Object .......................................................................... 65
Page Object ................................................................................. 79
PageRange Object ....................................................................... 86
Chapt er 3
52
Overview
This chapt er describes t he
propert ies and met hods of
each object in t he Imaging
applicat ion object hierarchy.
Automation enables you to control the Imaging application program-
matically from within your application. Using it, you can provide your
end users with all of the capabilities of the Imaging application.
The object model of the Imaging application consists of:
s
One top- level object, called the Application object;
s
One document object, called the ImageFile object; and
s
Two objects that support the ImageFile object, called the
Page object and the PageR ange object.
Each object has its own set of properties and methods. The remainder of
this chapter descr ibes each one.
Not e: Ref er t o Chapt er 2 of t his guide f or more inf ormat ion about
using Aut omat ion t o image-enable your applicat ions.
Application Object
ImageFile Object
Page Object
PageR ange O bject
Aut omat i on Lexicon
53
Applicat ion Object
The Application object is a top- level object that controls every other
object you create. The Application object also allows you to set the
environment. For example, you can control the size and position of the
Imaging application window and the visibility of scroll bars, the status
bar, and the toolbar.
Applicat ion Object Propert ies
The following table lists the Application object properties. Note
that the properties that affect the displayed image (for example,
DisplayScaleAlgorithm, ImagePalette, and Zoom) affect every
image displayed in the Application object.
Applicat ion Object Propert ies
Propert y Descript ion
ActiveDocument R eturns the active ImageFile object.
AnnotationPaletteVisible Sets or retur ns the visibility of the application's annotation
palette.
Application R eturns the Application object.
AppState R eturns the state of the image viewer application.
DisplayScaleAlgorithm Sets or retur ns the scaling algor ithm used for displaying images.
Edit Sets or retur ns the applications ability to edit the displayed
object.
FullName R eturns the file specification for the Application object.
Height Sets or retur ns the distance between the top and bottom edge
of the application window.
ImagePalette Sets or retur ns the image palette used for image display.
ImageView Sets or retur ns the present image view.
ImagingToolBarVisible Sets or retur ns the visibility of the applications scan toolbar.
Not available in all releases.
Left Sets or retur ns the distance between the left edge of the physi-
cal screen and the main application window.
Name R eturns the name of the Application object.
Parent R eturns the Application object.
Path R eturns the path specification for this applications executable
file.
Chapt er 3
54
Act iveDocument Propert y
Descript ion R eturns the active ImageFile object in the Application object. This is a read- only property.
Usage ApplicationObject.ActiveDocument
Dat a Type Object.
Example 'This example returns the ImageFile object in the application.
Dim Img as Object
Set Img = App.ActiveDocument
Annot at ionPalet t eVisible Propert y
Descript ion Sets or returns the visibility of the annotation palette. This is a read/ wr ite property.
Usage ApplicationObject.AnnotationPaletteVisible = [{True|False}]
Dat a Type Integer (Boolean).
ScanIsAvailable Sets or retur ns the state of the scanner.
Professional Edition only.
ScanToolBarVisible Sets or retur ns the visibility of the applications imaging tool-
bar. Not available in all releases.
ScrollBarsVisible Sets or retur ns the visibility of the applications scroll bars.
StatusBarVisible Sets or retur ns the visibility of the applications status bar.
ToolBarVisible Sets or retur ns the visibility of the applications toolbar.
Top Sets or retur ns the distance between the top edge of the physi-
cal screen and applications window.
TopWindow Sets or retur ns the applications top window flag.
Visible R eturns the visibility of the application.
WebToolBarVisible Sets or retur ns the visibility of the web toolbar. Professional
edition only.
Width Sets or returns the distance between the left and r ight edges of
the applications window.
Zoom Sets or retur ns the zoom factor for image display.
Applicat ion Object Propert ies (cont .)
Propert y Descript ion
Aut omat i on Lexicon
55
Remarks The AnnotationPaletteVisible property settings are:
Applicat ion Propert y
Descript ion R eturns the Application object. This is a read- only property.
Usage ApplicationObject.Application
Dat a Type Object.
Example 'This example returns the Application object.
Dim Parent As ObjectSet Parent = App.Application
AppSt at e Propert y
Descript ion R eturns the state of the Application object. The state indicates whether the application is
running as an embedded or automation server. This is a read- only property.
Usage ApplicationObject.AppState
Dat a Type Short.
Remarks The AppState property settings are:
DisplayScaleAlgorit hm Propert y
Descript ion Sets or retur ns the scaling algor ithm used for displaying images. This is a read/ wr ite
property.
Usage ApplicationObject.DisplayScaleAlgorithm [=value]
Dat a Type Short.
Remarks The DisplayScaleAlgor ithm value can be specified before or after an image is displayed. The
property settings are:
Set t ing Descript ion
True (Default) The annotation palette is visible.
False The annotation palette is not visible.
Set t ing Descript ion
1 The application is running as an embedded server.
2 The application is running as an automation server.
Set t ing Descript ion
0 (Default) Nor mal decimation.
1 Gray4 4- bit gray scale (16 shades of gray).
2 Gray8 8- bit gray scale (256 shades of gray).
Chapt er 3
56
Edit Propert y
Descript ion Sets or returns the Application objects ability to edit the displayed object. You should set
the Edit property pr ior to opening each ImageFile object. This is a read/ wr ite property.
Usage ApplicationObject.Edit = [{True|False}]
Dat a Type Integer (Boolean).
Remarks The Edit property settings are:
FullName Propert y
Descript ion R eturns the file specification for the Application object, including the path. This is a read-
only property.
Usage ApplicationObject.FullName
Dat a Type Str ing.
Height Propert y
Descript ion Sets or returns the distance, in pixels, between the top and bottom edge of the Application
objects window. This is a read/ wr ite property.
Usage ApplicationObject.Height [=value]
Dat a Type Long.
3 Stamp R epresents the image as a thumbnail.
4 Optimize Changes the display scale algor ithm based on the image type of
the displayed image. Black and white images are scaled to gray. Palettized
4- and 8- bit, R GB, and BGR images remain color.
Not e: This propert y must be set prior t o opening t he ImageFile object . For t his propert y t o
t ake ef f ect af t er an image is open, you must reopen t he image.
Set t ing Descript ion
True (Default) Image editing is available.
False The displayed object cannot be changed.
Not e: You must set t he Edit propert y prior t o opening t he ImageFile object . You can only
set t he Edit propert y once in t he current session.
Set t ing Descript ion
Aut omat i on Lexicon
57
Remarks This property must be set pr ior to opening the ImageFile object. It only takes effect if the
Width, Top, and Left properties are also set. If you set the Height property to less than
the minimum allowable window size, the value is ignored. The minimum setting is usually
27.
The Height property only retur ns the value that you set programmatically pr ior to opening
the window. It does not return changes made to the window after it has been opened.
ImagePalet t e Propert y
Descript ion Sets or retur ns the image palette used to display an image. This is a read/ wr ite property.
Usage ApplicationObject.ImagePalette [=value]
Dat a Type Short.
Remarks The ImagePalette property settings are:
ImageView Propert y
Descript ion Sets or retur ns the present image view. This is a read/ wr ite property.
Usage ApplicationObject.ImageView [=value]
Dat a Type Short.
Remarks The ImageView property settings are:
Not e: The ImagePalet t e propert y must be set prior t o opening t he ImageFile object . For
t his propert y t o t ake ef f ect af t er an image is open, you must reopen t he image.
Set t ing Descript ion
0 (Default) Custom
1 Common
2 Gray8 8- bit grayscale (256 shades of gray)
3 R GB24 24- bit (millions of colors)
4 Black and white
Set t ing Descript ion
0 (Default) One page view
1 Thumbnails view
2 Page and Thumbnails view
Chapt er 3
58
The ImageView property and the ImageFileObject. ActivePage property have the
following relationships:
See Also ImageFileObject.ActivePage property.
ImagingToolBarVisible Propert y
Descript ion Sets or returns the visibility of this Application objects imaging toolbar. This is a read/ wr ite
property.
Usage ApplicationObject.ImagingToolBarVisible = [{True|False}]
Dat a Type Integer (Boolean).
Remarks The ImagingToolBarVisible property settings are:
Lef t Propert y
Descript ion Sets or returns the distance, in pixels, between the left edge of the physical screen and the
Application objects window. This is a read/ wr ite property.
Usage ApplicationObject.Left [=value]
Dat a Type Long.
Remarks The Left property must be set pr ior to opening the ImageFile object. This property only
takes effect if the Height, Width, and Top properties are also set.
The Left property only returns the value that you set programmatically pr ior to opening
the window. It does not return changes made to the window after it has been opened.
Name Propert y
Descript ion R eturns the name of this Application object. This is a read- only property.
Usage ApplicationObject.Name
Dat a Type Str ing.
View Relat ionship
One Page (Default) The active page is displayed.
Thumbnails The active page appears in thumbnail view.
Page and Thumbnails The active page is the page that is displayed.
Set t ing Descript ion
True (Default) The imaging toolbar is visible.
False The imaging toolbar is not visible.
Aut omat i on Lexicon
59
Parent Propert y
Descript ion R eturns the parent of the Application object. This is a read- only property.
Usage ApplicationObject.Parent
Dat a Type Object.
Pat h Propert y
Descript ion R eturns the path specification for the Application objects executable file. This is a read-
only property.
Usage ApplicationObject.Path
Dat a Type Str ing.
ScannerIsAvailable Propert y
Descript ion Sets or retur ns the availablity of the scanner. This is a read/ wr ite property.
Usage ApplicationObject.ScannerIsAvailable = [{True|False}]
Dat a Type Integer (Boolean).
Remarks The ScannerIsAvailable property settings are:
ScanToolBarVisible Propert y
Descript ion Sets or retur ns the visibility of this Application objects scan toolbar. This is a read/ wr ite
property.
Usage ApplicationObject.ScanToolBarVisible = [{True|False}]
Dat a Type Integer (Boolean).
Remarks The ScanToolBarVisible property settings are:
Set t ing Descript ion
True (Default) The scanner is available. If no scanner is attached to the system, this
property setting is False.
False The scanner is unavailable.
Set t ing Descript ion
True The scan toolbar is visible.
False (Default) The scan toolbar is not visible.
Chapt er 3
60
ScrollBarsVisible Propert y
Descript ion Sets or returns the visibility of the Application objects scroll bars. This is a read/ wr ite
property.
Usage ApplicationObject.ScrollBarsVisible = [{True|False}]
Dat a Type Integer (Boolean).
Remarks The ScrollBarsVisible property settings are:
St at usBarVisible Propert y
Dat a Type Sets or returns the visibility of this Application objects status bar. This is a read/ wr ite
property.
Usage ApplicationObject.StatusBarVisible = [{True|False}]
Dat a Type Integer (Boolean).
Remarks The StatusBarVisible property settings are:
ToolBarVisible Propert y
Dat a Type Sets or returns the visibility of this Application objects standard toolbar. R ead/ wr ite
property.
Usage ApplicationObject.ToolBarVisible = [{True|False}]
Dat a Type Integer (Boolean).
Remarks The ToolBarVisible property settings are:
Set t ing Descript ion
True (Default) The scroll bars are visible.
False The scroll bars are not visible.
Not e: The ScrollBarsVisible propert y must be set prior t o opening t he ImageFile object .
For t his propert y t o t ake ef f ect af t er an image is open, you must reopen t he image.
Set t ing Descript ion
True (Default) The status bar is visible.
False The status bar is not visible.
Set t ing Descript ion
True (Default) The toolbar is visible.
False The toolbar is not visible.
Aut omat i on Lexicon
61
Top Propert y
Descript ion Sets or retur ns the distance, in pixels, between the top edge of the physical screen and main
application window. This is a read/ wr ite property.
Usage ApplicationObject.Top
Dat a Type Long.
Remarks The Top property must be set pr ior to opening the ImageFile object. This property only
takes effect if the Height, Width, and Left properties are also set.
The Top property only retur ns the value that you set programmatically pr ior to opening
the window. It does not return changes made to the window after it has been opened.
TopWindow Propert y
Descript ion Sets or retur ns this Application objects top window flag. This is a read/ wr ite property.
Usage ApplicationObject.TopWindow = [{True|False}]
Dat a Type Integer (Boolean).
Remarks The TopWindow property settings are:
Example 'This example makes the application window a stay-on-top window.
App.TopWindow = True
Visible Propert y
Descript ion R eturns the visibility of the Application object. This is a read- only property.
Usage ApplicationObject.Visible
Dat a Type Integer (Boolean).
Remarks The Visible property settings are:
Set t ing Descript ion
True The application is a stay- on- top window.
False (Default) The application is not a stay- on- top window.
Set t ing Descript ion
True The application is visible.
False (Default) The application is not visible.
Chapt er 3
62
WebToolBarVisible Propert y
Descript ion Sets or returns the visibility of this Application objects web toolbar. This is a read/ wr ite
property.
Usage ApplicationObject.WebToolBarVisible = [{True|False}]
Dat a Type Integer (Boolean).
Remarks The WebToolBarVisible property settings are:
Widt h Propert y
Descript ion Sets or returns the distance, in pixels, between the left and r ight edges of the Application
object's window. This is a read/ wr ite property.
Usage ApplicationObject.Width [=value]
Dat a Type Long.
Remarks The Width property must be set pr ior to opening the ImageFile object. This property only
takes effect if the Top, Left, and Height properties are also set. If you set the Width
property to less than the minimum allowable window size, the value is ignored. The
minimum setting is usually 112.
The Width property only returns the value that you set programmatically pr ior to opening
the window. It does not return changes made to the window after it has been opened.
Zoom Propert y
Dat a Type Sets or returns the zoom factor used for displaying images. This is a read/ wr ite property.
Usage ApplicationObject.Zoom [=value]
Dat a Type Float.
Remarks The zoom factor is a percent value.
Example 'This example sets the zoom factor to 100%.
App.Zoom = 100
'This example returns the current zoom factor.
x = App.Zoom
Set t ing Descript ion
True The web toolbar is visible.
False (Default) The web toolbar is not visible.
Aut omat i on Lexicon
63
Applicat ion Object Met hods
The following table lists the Application object methods.
Creat eImageViewerObject Met hod
Descript ion Creates and returns an ImageFile object. The ImageFile object is empty, with no image file
associated with it. Use the object's Open or New method to associate a specific image file.
Usage ApplicationObject.CreateImageViewerObject([ObjectClass])
Dat a Type Object.
Remarks This method only supports the ImageFile object, for which the setting is 1.
Example 'This example creates an ImageFile object.
Dim Img as Object
Set Img = App.CreateImageViewerObject(1)
Fit To Met hod
Descript ion Displays the cur rent image at the specified zoom option. This method updates the
Application objects Zoom property with the actual zoom factor.
This method affects each view as follows:
Usage ApplicationObject.FitTo (ZoomOption)
Dat a Type Short.
Applicat ion Object Met hods
Met hod Descript ion
CreateImageViewerObject Creates an Imaging object of the specified class.
FitTo Displays the image at the specified zoom option.
Help Displays online Help.
Quit Exits this application and closes all open objects.
View Display
One Page The page is zoomed.
Thumbnails No effect The Application property is changed and affects
other views when they are used.
Page & Thumbnails The page is zoomed No effect on thumbnails.
Chapt er 3
64
Remarks ZoomOption settings are:
Help Met hod
Descript ion Displays the Imaging online Help table of contents.
Usage ApplicationObject.Help
Quit Met hod
Descript ion Closes all open objects and exits the application. The Application object is no longer active
or available.
Usage ApplicationObject.Quit
Set t ing Descript ion
1 Best fit
2 Fit to width
3 Fit to height
4 Actual size
Aut omat i on Lexicon
65
ImageFile Object
An ImageFile object represents an image file. An ImageFile object can have
s
One Page object, representing the cur rently displayed page of the ImageFile object.
s
One or more PageR ange objects, each representing different and possibly overlapping
page ranges.
ImageFile Object Propert ies
The following table lists the ImageFile object properties.
Act ivePage Propert y
Descript ion Sets or retur ns the ImageFile objects active page number. This is a read/ wr ite property.
Setting the ActivePage property to a page number causes that page to become active,
which updates the display if the Application object is visible. R efer to the Application
objects ImageView property for more infor mation about the relationships between the
active page and different views of the page.
ImageFile Object Propert ies
Propert y Descript ion
ActivePage Sets or retur ns the ImageFile objects cur rent page number.
Application R eturns the Application object.
FileType R eturns the ImageFile objects file type.
Name R eturns the name of the active image file.
OCRLaunchApplication
Launches an application with an output file after OCR
a

processing is complete. Professional Edition only.
a. TextBr idge OCR technology by Xerox.
OCROutputFile Sets or retur ns the output file for OCR processing.
Professional Edition only.
OCROutputType Sets or retur ns the output file for mat for OCR processing.
Professional Edition only.
PageCount R eturns the number of pages in the ImageFile object.
Parent R eturns the parent of the ImageFile object.
Saved R eturns a flag indicating whether or not the file has ever
been saved.
Chapt er 3
66
Page selection and navigation by the end- user have no effect on the ActivePage property.
The active page is always the active page according to automation.
Usage ImageFileObject.ActivePage [=value]
Dat a Type Long.
Remarks The number is the page number value.
See Also ApplicationObject.ImageView property.
Applicat ion Propert y
Descript ion R eturns the Application object. This is a read- only property.
Usage ImageFileObject.Application
Dat a Type Object.
Example 'This example returns the Application object.
Dim Parent As Object
Set Parent = Img.Application
FileType Propert y
Descript ion R eturns the file type of this ImageFile object. This is a read- only property.
Usage ImageFileObject.FileType
Dat a Type Short.
Remarks The FileType property settings are:
Not e: If you set t he Act ivePage propert y t o a page number beyond t hose cont ained in
t he document , an error is ret ur ned.
Set t ing Descript ion
0 Unknown
1 TIFF
2 AWD Windows 95
3 BMP
4 PCX
5 DCX
6 JPEG
7 XIF
8 GIF
9 WIFF
Aut omat i on Lexicon
67
Name Propert y
Descript ion R eturns a str ing that contains the name of the active image file. This is a read- only
property.
Usage ImageFileObject.Name
Dat a Type Str ing.
OCRLaunchApplicat ion Propert y
Descript ion Launches the Application object with an output file after OCR processing is complete.
This is a read/ wr ite property.
Usage ImageFileObject.OCRLaunchApplication = [{True|False}]
Dat a Type Integer (Boolean).
Remarks The OCRLaunchApplication property settings are:
OCROut put File Propert y
Descript ion Sets or retur ns the output file name. If blank, the SaveAs dialog box is displayed. This is a
read/ write property.
Usage ImageFileObject.OCROutputFile = [FileName]
Dat a Type Str ing.
OCROut put Type Propert y
Descript ion Sets or retur ns the output file type. This is a read/ wr ite property.
Usage ImageFileObject.OCROutputType = [Type]
Dat a Type Long.
Remarks The OCROutputType property results are:
Set t ing Descript ion
True (Default) Launch the application.
False Do not launch the application.
Set t ing Descript ion
0 Word for Windows/ RTF
1 WordPerfect
2 HTML
3 Text
Chapt er 3
68
PageCount Propert y
Descript ion R eturns the number of pages in this ImageFile object. This is a read- only property.
Usage ImageFileObject.PageCount
Dat a Type Long.
Parent Propert y
Descript ion R eturns the parent of the ImageFile object. This is a read- only property.
Usage ImageFileObject.Parent
Dat a Type Object.
Example 'This example returns the parent of the ImageFile object.
Dim App As Object
App = Img.Parent
Saved Propert y
Descript ion R eturns the saved state of the ImageFile object. R ead- only property.
Usage ImageFileObject.Saved
Dat a Type Integer (Boolean).
Remarks The Saved property settings are:
Example 'This example returns the saved state of the file.
bIsSaved = Img.Saved
Set t ing Descript ion
True The ImageFile object has been saved and has not changed since it was last saved.
False The imageFile object has never been saved and has changed since it was created;
or, it has been saved but has changed since it was last saved.
Aut omat i on Lexicon
69
ImageFile Object Met hods
The following table lists the ImageFile object methods.
ImageFile Object Met hods
Met hod Descript ion
AppendExistingPages Appends existing pages to the end of the ImageFile object.
Close Closes the ImageFile object.
CreateContactSheet Saves a contact sheet rendition of the ImageFile object.
Professional Edition only.
FindOIServerDoc Finds E astman S oftware Imaging Server documents. Not available
when the application is running as an embedded server.
Professional Edition only.
Help Displays online Help.
InsertExistingPages Inserts existing pages in the ImageFile object.
New Creates a new blank ImageFile object. Not available when the
application is running as an embedded server.
Ocr OCR s opened Image File. Professional Edition only.
Open Opens the ImageFile object. Not available when the application is
running as an embedded server.
Pages R eturns a Page or PageR ange object for the ImageFile object.
Print Pr ints the ImageFile object.
RotateAll R otates all ImageFile object pages.
Save Saves changes to the ImageFile object.
SaveAs Saves the ImageFile object under another name.
SaveCopyAs Saves a copy of the ImageFile object. The application must be
running as an embedded server.
Update Updates the ImageFile object embedded within the container
application with the current data from the server application.
The application must be running as an embedded server.
Chapt er 3
70
AppendExist ingPages Met hod
Descript ion Appends specified page(s) to the end of the cur rent ImageFile object. If the page(s) being
appended come from an image file of a type different than the active image file, the pages
are converted before being appended. After appending page(s), all PageR ange objects are
invalid. You can optionally display a dialog box that allows the end- user to select a file from
which to append page(s).
Usage ImageFileObject.AppendExistingPages [ImageFile],[Page],
[Count],[DisplayUIFlag]
Argument s The AppendExistingPages method has the following parameters:
Example 'This example appends the first page from the file, BW.TIF.
Img.AppendExistingPages "c:\bw.tif", 1
'This example appends a file selected from a dialog box to the
'currently displayed image file. After the user selects a file
'to append, the application prompts the user to specify the
'starting page number and the number of pages to append from
'the selected file.
Img1.AppendExistingPages "", 0, 0, True
'This example appends pages to an Imaging Server 1.x file.
ImgFileObj.AppendExistingPages
"Image://nqa11\SYS:\tmp\3PAGES.tif", 1, 3
'This example appends pages to an Imaging Server 1.x document.
ImgFileObj.AppendExistingPages
"Image://PATRIOTS\CABINET\DRAWER\FOLDER\doc1", 3, 2
'This example appends pages to an Imaging Server 3.x
'document.
ImgFileObj.AppendExistingPages "Imagex://sixpage", 1, 6
Paramet er Dat a Type Descript ion
ImageFile Str ing The image file from which pages will be appended (source
image file).
Page Long The page from which to start appending pages (in the
source image file).
Count Long The number of pages to append.
DisplayUIFlag Flag True Displays a dialog box that allows the end- user to
select an image file to append.
False (Default) Does not display a dialog box.
If you specify True and the selected file is a multi- page file,
the user is prompted to select the pages to append.
Aut omat i on Lexicon
71
Close Met hod
Descript ion Closes the ImageFile object. Closing an ImageFile object deletes it; all Page and PageR ange
objects associated with it are also deleted. The Application object no longer has an
ImageFile object associated with it.
Usage ImageFileObject.Close [SaveChangeFlag]
Dat a Type Integer (Boolean).
Remarks The Close method SaveChangeFlag argument has the following settings:
Creat eCont act Sheet Met hod
Descript ion Saves a contact sheet rendition of the ImageFile object. This method is unavailable when
the Application is running as an embedded server.
Usage ImageFileObject.CreateContactSheet (ImageFile,
[IncludeAnnotations], [OpenAfterSave])
Dat a Type Str ing.
Argument s The CreateContactSheet method has the following parameters:
FindOIServerDoc Met hod
Descript ion Finds an E astman S oftware Imaging server document. This method displays an Imaging
server document Find dialog box, from which the user may search for E astman S oftware
Imaging 1.x server documents or E astman S oftware Imaging 3.x server documents. After the
user selects a document and chooses the Open button, the Find dialog box is closed and
returns the selected document name, with a path, to the user. A null str ing is retur ned if the
user chooses Cancel in the Find dialog box. The user may use the retur ned document
name str ing as input for the Image O bject Open method.
Set t ing Descript ion
True Changes are saved when the image file closes.
False (Default) Changes are not saved when the image file closes.
Paramet er Dat a Type Descript ion
ImageFile Str ing The image file object.
IncludeAnnotations Integer Option to include annotations on the image stamps.
OpenAfterSave Integer Option to open the contact sheet file after it has
been created.
Not e: This met hod is available only w it h t he Imaging f or Window s Prof essional Edit ion
applicat ion.
Chapt er 3
72
Dat a Type Str ing.
Usage ImageFileObject.FindOIServerDoc
Help Met hod
Descript ion Displays the Imaging online Help table of contents.
Usage ImageFileObject.Help
Insert Exist ingPages Met hod
Descript ion Inserts page(s) into the ImageFile object.
Page(s) to be inserted must come from an existing file. If the pages being inserted come
from an image file of a type different than the active image file, the pages are converted
before being inserted. After inserting page(s), all PageR ange objects are invalid. You can
optionally cause a dialog box to open for the end- user to select a file from which to insert
page(s).
Usage ImageFileObject.InsertExistingPages (ImageFile, ImagePage,
Count, Page, DisplayUIFlag)
Argument s The InsertExistingPages method has the following parameters:
Example 'This example inserts pages 4 and 5 from the file BW.TIF
'before page 1.
Img.InsertExistingPages "c:\bw.tif", 1, 2, 4
'This example inserts page(s) into the current file at the
'current page. (A dialog box prompts the user for the image
'file to be selected for insertion. Another dialog box
'prompts for a page range.) Page, count, and pagenumber
Paramet er Dat a Type Descript ion
ImageFile Str ing The image file from which page(s) are to be inserted (the
source image file).
ImagePage Long The page before which the new page(s) are to be inserted.
Count Long The number of pages to insert.
Page Long The page in the source image file from which to start
inserting pages.
DisplayUIFlag Flag True Displays a dialog box that allows the end- user to
select a source image file.
False (Default) Does not display a dialog box.
If you specify True and the selected file is a multi- page file,
the user will be prompted to select the pages to append.
Aut omat i on Lexicon
73
'arguments are required but ignored when dialogflag is True.
Img.InsertExistingPages "", 1, 1, 2, True
'This example inserts pages in an Imaging Server 1.x file.
ImgFileObj.InsertExistingPages
"Image://nqa11\SYS:\tmp\3PAGES.tif", 2, 3, 1
'This example inserts pages in an Imaging Server 1.x document.
ImgFileObj.InsertExistingPages
"Image://PATRIOTS\CABINET\DRAWER\FOLDER\doc1", 2, 3, 1
'This example inserts pages in an Imaging Server 3.x document.
ImgFileObj.InsertExistingPages "Imagex://sixpage", 1, 2, 5
New Met hod
Descript ion Displays a dialog box that allows the end- user to create a new ImageFile object that
contains one blank page.
Creating a new ImageFile object causes the new object to become active. If the active
ImageFile object is unsaved, the end- user is prompted to save it before the new object is
created.
No image file is associated with the object until you save it. The file type of the new object
is the same as the file type of the active object.
Usage ImageFileObject.New ([DisplayUIFlag])
Remarks The New method has the following parameter:
Example 'This example creates a new image object.
'Create the image object
Dim App, Img As Object
Set App = CreateObject("Imaging.Application")
Set Img = App.CreateImageViewerObject(1)
'Call the image object New Method
Img.New
Not e: This met hod is not available w hen applicat ion is running as an embedded server.
Paramet er Dat a Type Descript ion
DisplayUIFlag Flag True Displays a dialog box that allows the end- user
to create a new image file.
False (Default) Does not display a dialog box.
Chapt er 3
74
Ocr Met hod
Descript ion OCR s all image file pages.
Usage ImageFileObject.Ocr
Remarks The Image file must be open. The Ocr method uses the OcrOutputFile and
OcrOutputFileType properties.
Example 'This example performs an OCR on an image object.
Dim App, Img As Object
Set App = CreateObject("Imaging.Application")
Set Img = App.CreateImageViewerObject(1)
Img.Open "d:\pcx.tif"
Img.Ocr
Open Met hod
Descript ion Opens an image file in the parent application window. This associates an image file with the
ImageFile object. If a file is cur rently open, it should be closed before a new file is opened.
(See the Close Method).
The Imaging application has the focus after an Open. You can reset the focus
programmatically after an Open, if desired.
Usage ImageFileObject.Open(ImageFile,[IncludeAnnotation],[Page],
[ DisplayUIFlag])
Remarks The Open method has the following parameters:
Not e: This met hod is unavailable w hen t he applicat ion is running as an embedded server.
Paramet er Dat a Type Descript ion
ImageFile Str ing Name str ing of the ImageFile object to open.
IncludeAnnotation Flag True (Default) The image has annotations that are
displayed.
False The image has annotations that are not
displayed.
Page Long Page number in the image file to display. This parame-
ter must be a constant, or use the ActivePage property
to specify the page that you want displayed when you
open the file.
DisplayUIFlag Flag True Displays a dialog box that allows the end- user
to select a file to open.
False (Default) Does not display a dialog box.
Aut omat i on Lexicon
75
Example 'This example opens an image file named 5page.tif:
Img.Open "C:\images\5page.tif"
'This example opens the same file to page 4 with annotations
'displayed:
Img.Open "C:\images\5page.tif",TRUE,4
'This example opens a dialog box so the user can select a
'file to open:
Img.Open "",,,TRUE
'This example opens an Imaging Server 1.x file.
Img.Open "Image://nqa11\SYS:\tmp\3PAGES.tif", TRUE, 1
'This example opens an Imaging Server 1.x document.
Img.Open "Image://PATRIOTS\CABINET\DRAWER\FOLDER\doc1"
'This example opens an Imaging Server 3.x document.
Img.Open"Imagex://sixpage"
See Also ApplicationObject.Edit.
Pages Met hod
Descript ion R eturns the Page or PageR ange object for the ImageFile object.
Usage ImageFileObject.Pages(StartPage, EndPage)
Dat a Type Long.
Remarks If you specify one page number, this method retur ns a Page object. If you specify two page
numbers, this method returns a PageR ange object. To return a range of pages, specify the
starting page number and ending page number. The first page number can be a var iable, but
the second page number must be a constant.
The Pages method uses these parameters:
Example 'This example returns a Page object and a PageRange object.
Dim Page As Object
Dim PageRange As Object
Set Page = Img.Pages(1)
Set PageRange = Img.Pages(1,3)
Paramet er Dat a Type Descript ion
StartPage Long The starting page of the page range to be retur ned.
EndPage Long The ending page of the page range to be retur ned.
Chapt er 3
76
Print Met hod
Descript ion Pr ints the image file associated with the ImageFile object. You can optionally display a
dialog box to allow the end- user to select the pr int options.
Usage ImageFileObject.Print ([DisplayUIFlag])
Remarks The Print method DisplayUIFlag argument has the following settings:
Example 'This example prints the specified image file.
x = Img.Print
Rot at eAll Met hod
Descript ion R otates all ImageFile object pages. Pages are rotated clockwise in 90 degree increments.
Usage ImageFileObject.RotateAll
Example 'This example rotates all pages of the currently displayed image.
Img.RotateAll
Save Met hod
Descript ion Saves changes to the ImageFile object. If no image file is associated with the ImageFile
object, the SaveAs method is executed instead of the Save method.
Usage ImageFileObject.Save
SaveAs Met hod
Descript ion Saves the ImageFile object as another ImageFile object. Copies its image file and renames it.
This method allows you to specify the new object's image parameters. If specified, the file
can be converted from one type to another. The cur rent image file is closed without being
saved and the Save As object becomes the active image file. You can optionally display a
dialog box that allows the end- user to name the file for the first time or select a file to
overwr ite.
Usage ImageFileObject.SaveAs (ImageFile, [FileType], [DisplayUIFlag])
Dat a Type Str ing.
Set t ing Descript ion
True Displays a dialog box that allows the end- user to select pr int file options.
False (Default) No dialog box is displayed.
Aut omat i on Lexicon
77
Remarks The SaveAs method has the following parameters:
The SaveAs method FileType argument settings are:
Example 'This example saves a file in TIF format.
Img.SaveAs "picture1.tif", 1
'This example opens a Save As dialog box so that the end-user can
'name the file for the first time or overwrite an existing file:
Img.SaveAs "", 0, True
SaveCopyAs Met hod
Descript ion Saves a copy of the ImageFile object as another ImageFile object. You may specify the
FileType of the destination file. The FileType can be TIFF, AWD, or BMP.
This method allows you to specify the new objects image parameters. If specified, the file
can be converted from one type to another. The current image file remains the active image
file. This method can only be used after launching the embedded server application in a
separate window.
Usage ImageFileObject.SaveCopyAs (ImageFile, FileType, DisplayUIFlag)
Dat a Type Str ing.
Paramet er Dat a Type Descript ion
ImageFile Str ing The destinations ImageFile object name str ing.
FileType Short The file type that you want to save the image as. This
number must be a constant. It must be present in the
command if the dialog flag option is used, even though its
value is ignored when the DisplayUIFlag is set to True.
DisplayUIFlag Flag True Displays a dialog box that allows the end- user to
enter or select a filename and options for saving the file.
False (Default) Does not display a dialog box.
Set t ing Descript ion
1 TIFF
2 AWD (not supported on NT)
3 BMP
Chapt er 3
78
Remarks The SaveCopyAs method has the following parameters:
Updat e Met hod
Descript ion Updates the ImageFile object embedded within the container application with the current
data from the server application.
This method can only be used after launching the embedded server application in a separate
window.
Usage ImageFileObject.Update
Paramet er Dat a Type Descript ion
ImageFile Str ing The destinations ImageFile object name str ing.
FileType Short The image file type that you want to save the image as.
This number must be a constant. It must be present in the
command if the dialog flag option is used, even though its
value is ignored when the DisplayUIFlag is set to True.
DisplayUIFlag Flag True Displays a dialog box that allows the end- user to
enter or select a filename and options for saving the file.
False (Default) Does not display a dialog box.
Aut omat i on Lexicon
79
Page Object
A Page object represents a single page in an ImageFile object. Page objects can only be
accessed by using the Pages method of the parent ImageFile object.
Page Object Propert ies
The following table lists the Page object properties.
Applicat ion Propert y
Descript ion R eturns the Application object. This is a read- only property.
Usage PageObject.Application
Dat a Type Object.
Example 'This example returns the Application object.
Dim Img As ObjectDim Parent As ObjectSet Parent =
Img.Pages(1).Application
CompressionInf o Propert y
Descript ion R eturns this pages compression infor mation. This is a read- only property.
Usage PageObject.CompressionInfo]
Dat a Type Long.
Page Object Propert ies
Propert y Descript ion
Application R eturns the Application object.
CompressionInfo R eturns the pages compression infor mation.
CompressionType R eturns the pages compression type.
Height R eturns the pages height.
ImageResolutionX Sets or retur ns the pages hor izontal resolution.
ImageResolutionY Sets or the retur ns pages vertical resolution.
Name R eturns the page number of this page.
PageType R eturns the pages image type.
Parent R eturns the parent of the Page object.
ScrollPositionX Sets or retur ns this pages hor izontal scroll position.
ScrollPositionY Sets or retur ns this pages vertical scroll position.
Width R eturns the pages width.
Chapt er 3
80
Remarks The CompressionInfo property settings are:
Remarks Image files that do not have a compression type of JPEG will have a value between 1 and
63. This value is a combination of the values of 1 to 32. For JPEG files, the value is from 64
to 16384, and is only one of these values.
Example 'This example returns the page's compression information.
x = Img.Pages(1).CompressionInfo
CompressionType Propert y
Descript ion R eturns this pages compression type. This is a read- only property.
Usage PageObject.CompressionType[=value]
Dat a Type Short.
Set t ing Descript ion
0 No compression options set. Only applicable to uncompressed image files.
1 EOL (Include/ expect End Of Line). Each line is ter minated with an end- of-
line bit. Not used for JPEG compression.
2 Packed Lines (Byte align new lines). Not used for JPEG compression.
4 Prefixed EOL (Include/ expect prefixed End Of Line). Each str ip of data is pre-
fixed by a standard end- of- line bit sequence. Not used for JPEG compression.
8 Compressed LTR (Compressed bit order, left to r ight). The bit order for the
compressed data is the most significant bit to the least significant bit. Not used
for JPEG compression.
16 Expanded LTR (Expanded bit order, left to r ight). The bit order for the
expanded data is the most significant bit to the least significant bit. Not used for
JPEG compression.
32 Negate (Invert black and white on expansion). Indicates the setting of the Pho-
tometr ic Interpretation field of a TIFF file. Not used for JPEG compression.
64 Low R esolution/ High Quality (JPEG compression only).
128 Low R esolution/ Medium Quality (JPEG compression only).
256 Low R esolution/ Low Quality (JPEG compression only).
512 Medium R esolution/ High Quality (JPEG compression only).
1024 Medium R esolution/ Medium Quality (JPEG compression only).
2048 Medium R esolution/ Low Quality (JPEG compression only).
4098 High R esolution/ High Quality (JPEG compression only).
8196 High R esolution/ Medium Quality (JPEG compression only).
16392 High R esolution/ Low Quality (JPEG compression only).
Aut omat i on Lexicon
81
Remarks The CompressionType property settings are:
Example 'This example returns this page's compression type.
x = Img.Pages(1).CompressionType
Height Propert y
Descript ion R eturns this pages height in pixels. This is a read- only property.
Usage PageObject.Height
Dat a Type Long.
Example 'This example returns this page's height in pixels.
x = Img.Pages(1).Height
ImageResolut ionX Propert y
Descript ion Sets or retur ns this pages hor izontal resolution, in dots- per- inch. An error occurs when a
value less than 20 or greater than 1200 dpi is specified. This is a read/ wr ite property.
Usage PageObject.ImageResolutionX [= value]
Dat a Type Long.
Example 'This example sets this page's horizontal resolution.
Img.Pages(1).ImageResolutionX = 200
'This example returns this page's horizontal resolution.
XRes = Img.Pages(1).ImageResolutionX
Set t ing Descript ion
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 R eserved
8 Group 3 2D FAX
9 LZW
Chapt er 3
82
ImageResolut ionY Propert y
Descript ion Sets or returns this pages vertical resolution, in dots- per- inch. An error occurs when a
value less than 20 or greater than 1200 dpi is specified. This is a read/ wr ite property.
Usage PageObject.ImageResolutionY [= value]
Dat a Type Long.
Example 'This example sets this page's vertical resolution.
Img.Pages(1).ImageResolutionY = 200
'This example returns this page's vertical resolution.
YRes = Img.Pages(1).ImageResolutionY
Name Propert y
Descript ion R eturns the page number of the page in the ImageFile object. This is a read- only property.
Usage PageObject.Name
Dat a Type Long.
Example 'This example returns the page number of the page in the
'ImageFile object.
x = Img.Pages(1).Name
PageType Propert y
Descript ion R eturns the pages image type. This is a read- only property.
Usage PageObject.PageType
Dat a Type Short.
Remarks The PageType property settings are:
Example 'This example returns the page's image type.
x = Img.Pages(1).PageType
Set t ing Descript ion
1 Black and White
2 Gray 4
3 Gray 8
4 Palettized 4
5 Palettized 8
6 R GB 24
Aut omat i on Lexicon
83
Parent Propert y
Descript ion R eturns the parent of the Page object. This is a read- only property.
Usage PageObject.Parent
Dat a Type Object.
Example 'This example returns the parent of the Page object.
x = Img.Pages(1).Parent
ScrollPosit ionX Propert y
Descript ion Sets or retur ns this pages hor izontal scroll position, in pixels. This is a read/ wr ite property.
Usage PageObject.ScrollPositionX [=value]
Dat a Type Long.
Example 'This example sets this page's horizontal scroll position.
Img.Pages(1).ScrollPositionX = 200
'This example returns this page's horizontal scroll position.
xpos = Img.Pages(1).ScrollPositionX
ScrollPosit ionY Propert y
Descript ion Sets or retur ns this pages vertical scroll position, in pixels. This is a read/ wr ite property.
Usage PageObject.ScrollPositionY [=value]
Dat a Type Long.
Example 'This example sets this page's vertical scroll position.
Img.Pages(1).ScrollPositionY = 200
'This example returns this page's vertical scroll position.
ypos = Img.Pages(1).ScrollPositionY
Widt h Propert y
Descript ion R eturns this pages width, in pixels. This is a read- only property.
Usage PageObject.Width
Dat a Type Long.
Example 'This example returns this page's width in pixels.
x = Img.Pages(1).Width
Chapt er 3
84
Page Object Met hods
The following table lists the Page object methods.
Delet e Met hod
Descript ion Deletes the specified page from the active object. After deleting a page, the next page is
displayed (if one exists). Otherwise, the previous page is displayed.
Usage PageObject.Delete
Example 'This example deletes the specified page.
Img.Pages(1).Delete
Flip Met hod
Descript ion R otates the specified page 180 degrees. This change becomes per manent when the image
file is saved.
Usage PageObject.Flip
Example 'This example flips the page.
Img.Pages(1).Flip
Help Met hod
Descript ion Displays the Imaging online Help table of contents.
Usage PageObject.Help
Ocr Met hod
Descript ion OCR s the image page.
Usage PageObject.Ocr
Page Object Met hods
Met hod Descript ion
Delete Deletes the page.
Flip R otates the page 180 degrees.
Help Displays online Help.
Ocr OCR s Image Page. Professional Edition only.
Print Pr ints the page.
RotateLeft R otates the page counterclockwise 90 degrees.
RotateRight R otates the page clockwise 90 degrees.
Scroll Scrolls the page.
Aut omat i on Lexicon
85
Print Met hod
Descript ion Pr ints the page.
Usage PageObject.Print
Example 'This example prints the page.
x = Img.Pages(1).Print
Rot at eLef t Met hod
Descript ion R otates the page 90 degrees counterclockwise. This change becomes per manent when the
image file is saved.
Usage PageObject.RotateLeft
Example 'This example rotates the page 90 degrees to the left.
Img.Pages(1).RotateLeft
Rot at eRight Met hod
Descript ion R otates the page 90 degrees clockwise. This change becomes per manent when the image
file is saved.
Usage PageObject.RotateRight
Example 'This example rotates the page 90 degrees to the right.
Img.Pages(1).RotateRight
Scroll Met hod
Descript ion Scrolls the page.
Usage PageObject.Scroll Direction,ScrollAmount
Remarks The Scroll method uses the following parameters:
Example 'This example scrolls the page down 200 pixels.
Img.Pages(1).Scroll 0 200
Paramet er Dat a Type Descript ion
Direction Integer Direction in which to scroll the image:
0 (Default) Scrolls down
1 Scrolls up
2 Scrolls r ight
3 Scrolls Left
ScrollAmount Long Number of pixels to scroll the image
Chapt er 3
86
PageRange Object
A PageR ange object represents a range of consecutive pages in an ImageFile object. A page
range is a set of pages starting at the StartPage property and ending at the EndPage
property. PageR ange objects can only be accessed by using the Pages method of the parent
ImageFile object.
PageRange Object Propert ies
The following table lists the PageR ange object properties.
Applicat ion Propert y
Descript ion R eturns the Application object. This is a read- only property.
Usage PageRangeObject.Application
Descript ion Object.
Count Propert y
Descript ion R eturns the number of pages in this range. This is a read- only property.
Usage PageRangeObject.Count
Dat a Type Long.
EndPage Propert y
Descript ion R eturns or sets the page number of the last page in the range. This is a read/ wr ite property.
Usage PageRangeObject.EndPage [=value]
Dat a Type Long.
Remarks This property setting is the number of the last page. The value of EndPage must be greater
than or equal to the value of StartPage.
PageRange Object Propert ies
Propert y Descript ion
Application R eturns the Application object.
Count R eturns the number of pages in this range.
EndPage R eturns or sets the page number of the last page in the range.
Parent R eturns the parent of the PageR ange object.
StartPage R eturns or sets the page number of the first page in the range.
Aut omat i on Lexicon
87
Parent Propert y
Descript ion R eturns the parent of the PageR ange object. This is a read- only property.
Usage PageRangeObject.Parent
Dat a Type Object.
Example 'This example returns the parent of the PageRange object.
x = Img.Pages(1,7).Parent
St art Page Propert y
Descript ion R eturns or sets the page number of the first page in the range. This is a read/ wr ite property.
Usage PageRangeObject.StartPage [=value]
Dat a Type Long.
Remarks This property setting is the number of the first page. The value of StartPage must be less
than or equal to the value of EndPage.
PageRange Object Met hods
The following table lists the PageR ange object methods.
The Delete, Ocr, and Print methods of the PageR ange object use the following
parameters:
Delet e Met hod
Descript ion R emoves pages from the ImageFile object. After deleting a PageR ange object, all page
ranges are invalid.
Usage PageRangeObject.Delete( )
Example 'This example deletes the pages 1 through 3.
Img.Pages(1,3).Delete
PageRange Object Met hods
Met hod Descript ion
Delete Deletes the page range.
Ocr OCR s the page range.
Pr int Pr ints the page range.
Paramet er Dat a Type Descript ion
StartPage Long First page to be deleted.
NumPages Long Number of pages to be deleted, including the StartPage.
Chapt er 3
88
Ocr Met hod
Descript ion OCR s the page range.
Usage PageRangeObject.Ocr( )
Example 'This example OCRs pages 2 through 6.
x = Img.Pages(2,6).Ocr
Print Met hod
Descript ion Pr ints the page range.
Usage PageRangeObject.Print( )
Example 'This example prints pages 1 through 5.
x = Img.Pages(1,5).Print
4
Adding Imaging Using Act iveX Cont rols
This chapter demonstrates how to use the Imaging ActiveX controls to
image- enable your applications.
It begins by explaining how to load the Imaging ActiveX controls into
your development environment. Then it explains how to access the
on- line help for the controls. It concludes by walking you through some
sample applications to help you get started.
In This Chapt er
Loading t he Cont rols ................................................................... 90
Obt aining Help ............................................................................ 95
Demonst rat ion Project s.............................................................. 101
Chapt er 4
90
Loading t he Cont rols
This sect ion explains how t o
load t he Imaging Act iveX
cont rols int o t hree devel-
opment environment s:
Microsof t Visual Basic,
Visual C++, and Access.
Before you can use the Imaging ActiveX controls, you must load them
into your development environment.
Loading the controls consists of the following basic
tasks:
Keep in mind t hat you can
use t he Imaging Act iveX
cont rols wit h ot her pro-
gramming environment s,
such as Powersof t
PowerBuilder.
s
Selecting each Imaging ActiveX control from a list of registered
ActiveX controls on your system.
s
Inserting each Imaging ActiveX control icon into the controls
toolbox of your development environment.
The following list shows how the Imaging ActiveX controls appear
on your system:
Kodak Image Admin Control
Kodak Image Edit Control
Kodak Image Ocr Control
Kodak Image Scan Control
Kodak Image Thumbnail Control
Not e: The name Wang appears inst ead of Kodak w hen using Imaging
f or Window s 95, Imaging f or Window s NT 4.0, and Imaging f or
Window s Prof essional Edit ion V1.0 and V1.1. (The East man
Kodak Company acquired Wang Sof t w are, t he sof t w are unit of
Wang Laborat ories, Inc. in 1997, creat ing East man Sof t w are,
Inc.)
Adding Imaging Using Act iveX Cont rols
91
The following table lists the icons that represent each Imaging ActiveX
control in the controls toolbox of your development environment.
Imaging Act iveX Toolbox Icons
Icon Name Not es
Image Admin Available with all
versions of Imaging.
Image Annotation
Tool Button
Actually a member of the
Image Edit control.
Image Edit Available with all
versions of Imaging.
Image OCR Available with Imaging
Professional only.
Image Scan Available with all
versions of Imaging.
Image Thumbnail Available with all
versions of Imaging.
Chapt er 4
92
Visual Basic
To add the Imaging ActiveX controls to Visual Basic
1 Start Visual Basic and create a new project.
2 On the Project menu, click Components.
3 On the Components dialog box, click the Controls tab.
4 Select the Imaging ActiveX controls from the controls listed. (R efer
to Loading the Controls earlier in this chapter to see a list of
Imaging ActiveX controls.)
5 Click OK. Visual Basic adds the controls to your project and the
control icons to your toolbox.
6 Work with the Imaging ActiveX controls as you would any other
type of ActiveX control.
Visual C++
To add the Imaging ActiveX controls to Visual C++
1 Start Visual C+ + and create a new project.
2 On the Project menu, point to Add to Project, and click
Components and Controls. The Component and Controls
Gallery dialog box appears.
3 In the Look In list box, click SharedIDE and then Gallery.
4 Below the Look In list box, double- click Registered ActiveX
Controls. A list of registered ActiveX controls appears.
5 For each Imaging ActiveX control:
a Click the desired control among the list of registered controls and
then click Insert. (R efer to Loading the Controls earlier in this
chapter to see a list of Imaging ActiveX controls.)
b On the Confirm Classes dialog box, click OK. Visual C+ + adds
the control to your project and its icon to the Controls toolbox,
which is visible when you edit a dialog box in R esource View.
6 When you have finished adding the Imaging ActiveX controls, click
Close on the Components and Controls Gallery dialog box.
7 Work with the Imaging ActiveX controls as you would any other
type of ActiveX control.
A cont rol is select ed w hen a
check mark appears next t o it .
Not e: If you are using M icrosof t Foundat ion Classes (M FC), be sure t o
call Af xEnableCont rolCont ainer w it hin InitInstance.
Adding Imaging Using Act iveX Cont rols
93
Access
To add the Imaging ActiveX controls to Access
1 Start Access and create a new database.
2 On the Tools menu, click ActiveX Controls.
3 If the ActiveX Controls dialog box lists all of the Imaging ActiveX
controls as available, click Close and proceed to Step 4.
For each control the dialog box does not list as available:
a Click Register.
b On the Add ActiveX Control dialog box, navigate to your
Windows/System folder.
c Click the file name of the control not listed as available. Then
click Open to register the control.
The following table lists the file names of each Imaging ActiveX
control.
d When you finish register ing the controls, click Close to exit the
ActiveX Controls dialog box.
4 Enter For m or R eport design view.
5 On the View menu:
a If necessary, click Toolbox to display the Controls toolbox.
b Point to Toolbars and click Customize.
6 On the Customize dialog box, click the Commands tab.
If you select ed t he OLE
Cont rols check box in t he
Set up program w hen you
inst alled M icrosof t Access, t he
Imaging Act iveX cont rols are
available aut omat ically.
Imaging Act iveX Cont rol File Names
Click This File To Regist er This Cont rol
imgadmin.ocx Image Admin
iimgedit.ocx Image Annotation Tool Button
iimgedit.ocx Image Edit
iimgocr.ocx Image OCR
iimgscan.ocx Image Scan
iimgthumb.ocx Image Thumbnail
Chapt er 4
94
7 In the Categories list box:
a Click ActiveX Controls.
b From the Commands list box, drag each Imaging ActiveX
control and drop it onto the Controls toolbox.
c When you finish dragging and dropping the Imaging ActiveX
controls onto the toolbox, click Close.
8 Work with the Imaging ActiveX controls as you would any other
type of ActiveX control.
Adding Imaging Using Act iveX Cont rols
95
Obt aining Help
This sect ion explains how t o
access t he on-line help
syst em of t he Imaging
Act iveX cont rols.
How you access the Imaging ActiveX Controls on- line help system
differs within each of the following programming environments:
s
Visual Basic
s
Visual C+ +
s
Access
The following sections descr ibe how to access help in each environment.
Visual Basic
There are many ways to access the Imaging ActiveX Controls on- line
help in Visual Basic. You can access help from the:
s
Object Browser
s
Toolbox
s
Form window
s
Properties window
s
Code window
Before attempting to access help, make sure that the Imaging ActiveX
controls have been added to your current project. (R efer to Loading the
Controls for instructions.)
If desired , you can also open
t he help f ile in Window s
Explorer. Ref er t o Chapt er 6 f or
inst ruct ions.
Not e: Several met hods in t he Imaging Act iveX cont rols present dialog
boxes t o t he end user. Each dialog box provides it s ow n cont ext -
sensit ive help, w hich t he user can invoke by clicking t he ques-
t ion mark at t he t op of t he dialog box and t hen t he desired
cont rol.
Chapt er 4
96
Object Browser
To access Imaging ActiveX help from the Object Browser
1 On the View menu, click Object Browser. The Object Browser
appears.
2 In the Project/ Library list box, click the library name of the desired
Imaging ActiveX control.
The following table lists the library and class names of each Imaging
ActiveX control.
3 In the Classes list box, click the class name of the control. (R efer to
the preceding table for a list of class names.)
4 In the Members list box, click the desired property, method, or
event, and then press F1. The help topic for the selected member
appears.
Toolbox
To access Imaging ActiveX help from the Toolbox
s
Click the desired Imaging ActiveX control in the toolbox, and then
press F1. The overview topic for the selected control appears.
From the overview topic, you can navigate to other topics that
descr ibe the properties, methods, and events of the selected control.
Imaging Act iveX Cont rol Library and Class Names
Library Name Class Name Imaging Cont rol
AdminLibCtl ImgAdmin Image Admin
ImgeditLibCtl ImgAnnTool Image Annotation Tool
Button
ImgeditLibCtl ImgEdit Image Edit
IMGOCR Lib Imgocr Image OCR
ScanLibCtl ImgScan Image Scan
ThumbnailLibCtl ImgThumbnail Image Thumbnail
Not e: If t he member you select is an ext ender propert y, met hod, or
event , Visual Basics on-line help appears.
Adding Imaging Using Act iveX Cont rols
97
Form Window
To access Imaging ActiveX help from the Form window
1 Draw at least one Imaging ActiveX control on a for m.
2 Select the Imaging ActiveX control on the for m.
3 Press F1. The overview topic for the selected control appears.
From the overview topic, you can navigate to other topics that
descr ibe the properties, methods, and events of the selected control.
Propert ies Window
To access Imaging ActiveX help from the Properties window
1 Select an Imaging ActiveX control that has been drawn on a for m.
Then, on the View menu, click Properties Window. The
Properties window appears.
2 Click the desired property in the Properties window and then press
F1. The help topic for the selected property appears.
Code Window
To access Imaging ActiveX help from the Code window
1 Make sure that at least one Imaging ActiveX control has been drawn
on a for m.
2 Invoke the Code window.
3 Within your code, select the Imaging property, method, or event for
which you want help. Then press F1. The help topic for the selected
property, method, or event appears I.
Not e: Keep in mind t hat only t he design-t ime propert ies appear in t he
Propert ies w indow.
If t he propert y you select is an ext ender propert y, Visual Basics
on-line help appears.
Not e: If t he propert y, met hod, or event you select is an ext ender
propert y, met hod, or event , Visual Basics on-line help appears.
Chapt er 4
98
Visual C++
There are two ways to access the Imaging ActiveX Controls on- line help
in Visual C+ + . You can access help from the:
s
Components and Controls Gallery dialog box
s
Properties window
Before attempting to access help, make sure that the Imaging ActiveX
controls have been added to your current project. (R efer to Loading the
Controls for instructions.)
Component s and Cont rols Gallery Dialog Box
To access Imaging ActiveX help from the Components and
Controls Gallery dialog box
1 On the Project menu, point to Add To Project and click
Components and Controls. The Components and Controls
Gallery dialog box appears.
2 Click the desired Imaging ActiveX control below the Lookin box,
and then click More Info. The overview topic for the selected
control appears.
From the overview topic, you can navigate to other topics that descr ibe
the properties, methods, and events of the selected control.
Propert ies Window
To access Imaging ActiveX help from the Properties window
1 Select an Imaging ActiveX control that has been drawn on a for m.
2 On the View menu, click Properties.
3 Click the desired property in the Properties window, and then press
F1. The help topic for the selected property appears.
Not e: Keep in mind t hat only t he design-t ime propert ies appear in t he
Propert ies w indow.
If t he propert y you select is an ext ender propert y, t he cont ent s
w indow f or t he Imaging Act iveX help syst em appears.
Adding Imaging Using Act iveX Cont rols
99
Access
There are three ways to access the Imaging ActiveX Controls on- line
help in Access. You can access help from the:
s
Object Browser
s
Properties window
s
Module window
Before attempting to access help, make sure that the Imaging ActiveX
controls have been added to your current database. (R efer to Loading
the Controls for instructions.)
Object Browser
To access Imaging ActiveX help from the Object Browser
1 Make sure the Module window is cur rently on display.
2 On the View menu, click Object Browser. The Object Browser
appears.
3 In the Project/ Library list box, select the library of the desired
Imaging ActiveX control. (R efer to Visual Basic earlier in this
section to see a list of library and class names for each Imaging
ActiveX control.)
4 In the Classes list box, click the class name of the desired control.
(R efer to the aforementioned list.)
5 In the Members list box, click the desired property, method, or
event, and then press F1. The help topic for the selected member
appears.
Propert ies Window
To access Imaging ActiveX help from the Properties window
1 Select an Imaging ActiveX control that has been drawn on a for m.
2 On the View menu, click Properties.
3 On the Properties window, click the Other tab or the All tab.
Not e: If t he member you select is an ext ender propert y, met hod, or
event , Visual Basics on-line help appears provided Visual
Basic is inst alled on your syst em. Access does not provide help
f or ext ender propert ies, met hods, or event s in t he Object
Brow ser.
Chapt er 4
100
4 Click the desired property in the Properties window and then press
F1. The help topic for the selected property appears.
Module Window
To access Imaging ActiveX help from the Module window
1 Make sure that at least one Imaging ActiveX control has been drawn
on a for m.
2 Invoke the Module window.
3 Select the Imaging property, method, or event within your code for
which you want help. And then press F1. The help topic for the
selected property, method, or event appears I.
Not e: Keep in mind t hat only t he design-t ime propert ies appear in t he
Propert ies w indow.
If t he propert y you select is an ext ender propert y, Access on-line
help appears.
Not e: If t he propert y, met hod, or event you select is an ext ender
propert y, met hod, or event , Visual Basics on-line help appears
provided Visual Basic is inst alled on your syst em.
Adding Imaging Using Act iveX Cont rols
101
Demonst rat ion Project s
This sect ion demonst rat es
how t o add a variet y of
Imaging f unct ions t o your
applicat ions.
A wide-ranging discussion of
every Imaging f unct ion is
beyond t he scope of t his
chapt er; however it does
discuss many of t he popular
ones.
All demonst rat ion project s
were developed using
Microsof t Visual Basic,
Version 5.0.
To help you use the Imaging ActiveX controls, Eastman Software, Inc.
has prepared seven demonstration projects that show you how to:
s
Display an image and apply fit- to options.
s
Convert an image.
s
Copy an image.
s
Print an image.
s
Scan images using a template.
s
Manage an image file using thumbnails.
s
Unload a multipage image file.
Displaying an Image and Applying Fit -To Opt ions
The FitTo Options demonstration project shows how to display an image
at var ious fit- to settings. Before walking through the demonstration
project, read the following section, which explains the concept of fitting
an image and descr ibes the var ious fit- to options. (R efer to Chapters 7
through 11 in this guide for more infor mation.)
Fit -To Opt ions Def ined
Fit- to options gover n the way an Image Edit control displays images.
The FitTo method of the Image Edit control lets you select usually in
response to user input the scaling factor, or fit- to option, applied to
images when they're displayed.
Most image application developers make fit- to functions available to their
end users. These functions let users scale the image so it can be seen
more clearly, which is particularly important when users read scanned
documents or faxes.
Not e: Some of t he propert ies, met hods, event s, paramet ers, and
const ant s discussed in t his sect ion may not be available if you
use a version of Imaging t hat is earlier t han Imaging f or
Window s Prof essional Edit ion Version 2.0.
The on-line help syst em and Chapt ers 7 t hrough 11 of t his guide
ident if y t he propert ies, met hods, event s, paramet ers, and con-
st ant s t hat are available in each version of Imaging f or Window s.
Chapt er 4
102
You can provide the following fit- to options to your end users:
Best Fit Scales the image so it appears in the entire Image Edit
control. The full height or the full width of the image appears in the
control, depending on which results in the least unused space.
Fit To Width Scales the image so it matches the width of the Image
Edit control.
Fit To Height Scales the image so it matches the height of the Image
Edit control.
Inch To Inch Scales the image page to its actual size, so that one inch
on the scanned image equals one inch on your monitor.
Example
Users of your application may want control over the display of image
documents to make them easy to read.
Scenario
Assume Eileen receives several scanned business documents in her role as
product manager for a major computer company. Because she receives
these documents from others via e- mail, she has no control over how
they are scanned, but she really needs to be able to read them.
Because you included all of Image Edits fit- to options in your
application, Eileen can select the one that produces the best display
quality enabling her to view the image documents clearly and read
them easily.
You can provide your users
w it h even mo re cont rol over a
displayed image by using t he
Zoom propert y of t he Image
Edit cont rol in addit ion t o t he
Fit To met hod.
Adding Imaging Using Act iveX Cont rols
103
Fit To Opt ions Project
The FitTo Options project demonstrates displaying an image at a var iety
of fit- to options.
The f ile name f o r t he Fit To
Opt ions project is
FitTo.vbp.
Chapt er 4
104
The project consists of one for m and the following controls:
s
One Image Admin control
s
One Image Edit control
s
Four Option Button controls in a control ar ray
s
One Frame control
s
One Command Button control
It uses the following methods in the Image Edit control to provide the
display and fit- to functions:
Display Displays the image file specified in the Image property of
the Image Edit control.
FitTo Scales the image relative to the Image Edit control.
Displaying and Fit t ing an Image
Start the FitTo Options project. The Form_Load() event procedure
displays an Open dialog box to let you select the TIFF image file you
want to display.
After you select the image file, the Form_Activate() event procedure
invokes the FitTo method of the Image Edit control with a parameter
value of BEST_FIT (literal 0). This action sets the initial fit- to setting of
the Image Edit control to the Best Fit option.
The procedure then sets the Value property of the cor responding
Option Button control to True, to indicate that Best Fit is the initial
fit- to mode.
Next, the Form_Activate() event procedure invokes the Display
method of the Image Edit control to display the image file at the initial
fit- to setting.
2TKXCVG 5WD (QTOA#EVKXCVG)

'+PKVKCNK\G VQ C (KV6Q QRVKQP QH $GUV (KV
kdkImqEd1tI.F1tTo BESTFIT
QRV(KV6Q0)8CNWG - 6TWG

'&KURNC[ VJG UGNGEVGF KOCIG HKNG
kdkImqEd1tI.D1say
'PF 5WD
Adding Imaging Using Act iveX Cont rols
105
To change the FitTo setting, click the desired option button in
the FitTo Setting frame on the FitTo Options window. The
optFitTo_Click() event procedure fires and executes the appro-
pr iate code in its Select Case statement.
Each Case expression cor responds to the Index value of the FitTo
option buttons in the frame. Further, each Case expression invokes the
FitTo method of the Image Edit control, passing to it the appropr iate
parameter values:
FitTo parameter Deter mines the FitTo option applied:
Case 0 invokes BEST_FIT (literal 0).
Case 1 invokes FIT_TO_WIDTH (literal 1).
Case 2 invokes FIT_TO_HEIGHT (literal 2).
Case 3 invokes INCH_TO_INCH (literal 3).
Repaint parameter Deter mines whether the image is refreshed
immediately. All Case expressions invoke the FitTo method with a
R epaint setting of True.
As you try the var ious FitTo options, notice the impact on the displayed
image and how the scrollbars appear and disappear as needed.
You can cont rol w het her
scrollbars appear in t he Image
Edit cont rol by set t ing t he
ScrollBars p ropert y t o t he
appropriat e value.
2TKXCVG 5WD QRV(KV6QA%NKEM+PFGZ #U +PVGIGT)

5GNGEV %CUG +PFGZ

%CUG 0 '$GUV (KV
kdkImqEd1tI.F1tTo BESTFIT. True

%CUG 1 '(KV 6Q 9KFVJ
kdkImqEd1tI.F1tTo FITTOWIDTH. True

%CUG '(KV 6Q *GKIJV
kdkImqEd1tI.F1tTo FITTOHEIOHT. True

%CUG o '+PEJ 6Q +PEJ #EVWCN 5K\G)
kdkImqEd1tI.F1tTo INOHTOINOH. True
'PF 5GNGEV
'PF 5WD
Chapt er 4
106
Convert ing an Image
This demonstration project shows how to add image conversion
functions to your image- enabled applications. Before walking through
the demonstration project, read the following sections, which explain the
concept of image conversion. (R efer to Chapters 7 through 11 in this
guide for more infor mation.)
Image Conversion Def ined
Converting an image involves changing one or more of the following
attr ibutes:
s
File type
s
Color type
s
Compression type
s
R esolution
s
Size
There are many reasons why your end users would want to convert an
image. The following sections explain some of them.
File Type
The Imaging ActiveX controls provide three read/ wr ite file types. Your
users will want to use the file type that best satisfies their requirements.
TIFF Supports all color types and many compression types. Its image
files can contain multiple pages and can store Summary property
infor mation and image annotation data separate from the actual image
data.
BMP Supports all color types. While its image files can contain only
a single image page that cannot be compressed, they are readable by
anyone with Windows on the PC.
AWD While it supports only the Black- and- White color type, AWD
image files can contain multiple pages; and AWD is the for mat for
Microsoft Windows 95 Fax documents.
Not e: The AWD f ormat is not available w hen your applicat ion runs on
Window s NT.
Window s 98 support s AWD as a legacy f ile t ype.
Adding Imaging Using Act iveX Cont rols
107
Example
Users of your application may want to change the file type to take
advantage of the new file types special features.
Scenario
Assume Krystina sends Tom two BMP image files of an automobile that
was involved in an accident recently. Because the two BMP files are
separate and quite large, Tom converts each one to the TIFF file for mat
to take advantage of its special features. Once in the TIFF for mat, Tom
can:
s
Combine the two files into one multipage TIFF image file.
s
Apply compression to save disk space.
s
Annotate the images without making the annotations a per manent
part of the image.
s
Add Summary property infor mation to the image file.
Color Type
The color type also known as the page type or data type specifies
the number of colors images can have. Your users will want to use, or
convert images to, the color type that best satisfies their color and storage
requirements.
The factor that deter mines the color content of images is the number of
data bits that compose each picture element (pixel). The for mula for
deter mining the color content of image documents is 2
number of bits
. The
more color an image contains, the greater the number of data bits in each
pixel.
Aesthetics aside, the most important consideration when selecting the
color type is file size. The greater the number of data bits per pixel, the
greater the memory and storage requirements.
The following color types are available:
Black and White One bit makes up each pixel. Images can therefore
have only two colors: black and white.
16 Shades of Gray Four bits make up each pixel. Images can
therefore have a maximum of 16 shades of gray.
256 Shades of Gray Eight bits make up each pixel. Images can
therefore have a maximum of 256 shades of gray.
16 Colors Four bits make up each pixel. Images can therefore have a
maximum of 16 colors.
Chapt er 4
108
256 Colors Eight bits make up each pixel. Images can therefore have
a maximum of 256 colors.
True Color Twenty- four bits make up each pixel. Images can
therefore have a maximum of 16,777,216 colors.
Example
Users of your application may want to change a color type to save disk
space.
Scenario
Assume Tom scans a text- only insurance document in True Color and
then sends the image to Krystina so she can view it. When Krystina
receives the image, she notices that its file size is a little large for a text-
based image. R ealizing that color is not a requirement for this type of
image, she converts its color type to Black and White. File size drops
27%, and the document is completely readable.
Compression Type
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 applied when saving images, the
lower the disk space requirement. Your users will want to use, or convert
images to, the compression type that best satisfies their storage
requirements.
The following compression types are available.
CCITT Group 3 (1d) Fax Should be used to compress black- and-
white TIFF images when users anticipate sending them as faxes over
unreliable data links.
CCITT Group 3 (1d) Modified Huffman Should be used to
compress black- and- white TIFF images when users anticipate sending
them as faxes over unreliable data links, and they require increased
compression over that provided by Group 3 (1d) Fax.
Adding Imaging Using Act iveX Cont rols
109
CCITT Group 4 (2d) Fax Should be used to compress black- and-
white TIFF images when users anticipate saving them to disk or sending
them as faxes over reliable data links, such as ISDN, X.25, or e- mail.
JPEG Can be used to compress TIFF images with a color type of 256
Shades of Gray or True Color. Should be used when users want to
significantly reduce the storage requirement, and they dont mind if the
image is altered by the compression process.
When users select this compression type, they can also specify JPEG
compression options, which compr ise all combinations of high, medium,
or low R esolution and high, medium, or low Compression. The higher
the R esolution setting, the greater the image quality. The higher the
Compression setting, the lower the disk space requirement.
For example, an image compressed with the High R esolution/ Low
Compression option has the highest image quality and the highest disk
space requirement. Conversely, an image compressed with the Low
R esolution/ High Compression option has the lowest image quality and
the lowest disk space requirement.
LZW Can be used to compress TIFF image documents of any color
type, except black- and- white. Should be used when users do not want
the image to be altered by the compression process.
PackBits Can be used to compress black- and- white TIFF image
documents for any purpose.
Not e: Wit h CCITT compression t ypes, users can set t he Reversed Bit
Order compression opt ion, w hich signif ies t hat t he compressed
dat a codes begin at t he lef t , most signif icant bit (M SB) of each
byt e and are ordered f rom M SB t o t he least signif icant bit (LSB).
Users should employ t his opt ion w hen t hey need t o exchange
images w it h someone w hose image sof t w are cannot handle
non-reversed image document s.
JPEG is a lossy compression
t ype, w hich means t hat some
dat a is alt ered and lost during
compression. Usually, dat a
alt er at ion and loss are not
sig nif icant . Lossy compression
t ypes of t en of f er higher
compression r at ios t h an do
lossless t ypes, like LZW.
Not e: If you make t he LZW compression t ype available t o your users,
you need t o negot iat e a license w it h Unisys Corporat ion.
Chapt er 4
110
Example
Users of your application may want to change the compression type to
save disk space.
Scenario
In an earlier scenar io, Krystina sent Tom two True Color bitmap (BMP)
image files of an automobile that was involved in a recent accident. Tom
converted each BMP file to the TIFF file for mat and saved both of the
images in a single TIFF image file. The resulting uncompressed file was
quite large at 21 megabytes (MB); so, Tom elected to compress the file
using the JPEG compression type with the following compression
options:
s
JPEG Compression: Medium
s
JPEG R esolution: Medium
The resulting image file was reduced to just under 1 MB.
Resolut ion
R esolution deter mines the display quality of an image. Typically
expressed as hor izontal and vertical dots per inch (dpi), resolution
descr ibes the density of the dots that make up the image. The higher the
resolution or dots per inch the better the display quality.
An important consideration when setting the resolution is file size. The
greater the dots per inch, the greater the memory and storage
requirements. For example, the file size of an image with a resolution of
200 x 200 dpi is four times greater than the file size of the same image at
100 x 100 dpi.
Another important consideration when setting the resolution is how the
images are to be used:
Displayed on the screen For images that are displayed on the
screen, resolution need not be any greater than the display resolution of
the monitor, typically 75 x 75 dpi to 100 x 100 dpi.
Faxed For images that are faxed, resolution should confor m to the
international fax standard of 200 x 200 dpi.
Converted to text or printed For images that are OCR d or
pr inted, resolution should be set to 300 x 300 dpi.
Your users want to use, or convert images to, the resolution that best
satisfies their aesthetic, storage, and usage requirements.
Adding Imaging Using Act iveX Cont rols
111
Example
Users of your application may want to change the resolution of an image
to save disk space.
Scenario
Assume Tom received a complimentary letter from a customer that he
wants to post on the companys intranet page for all to see. Tom knows
that he can use your application to scan the letter and convert it to
HTML using the OCR functions you have provided.
Because you stated in your documentation that the OCR engine
processes images with optimum efficiency when their resolution is 300 x
300 dpi, Tom scans the letter at that resolution.
After perfor ming OCR on the image and uploading its HTML file to
the Web server, Tom realizes that he wants to save the image on his
PC just in case he needs it later. Knowing that an image with a
resolution of 300 x 300 dpi takes more storage space than one with a
lower resolution, Tom uses the conversion functions in your program to
convert the image to 200 x 200 dpi just pr ior to saving it.
Size
The size settings deter mine the dimensions of an image. Your users may
want to change the size of the image and/ or the unit of measure
employed to suit their pur poses.
Example
Users of your application may want to change the size of an image to
accommodate an annotation.
Scenario
Assume Krystina scans a claim for m and then wants to add a rubber
stamp annotation to the bottom of it. The problem is: theres no room at
the bottom of the image to accommodate the annotation. To make room
for the annotation, Krystina converts the size of the image from 8 1/ 2 x
11 inches to 8 1/ 2 x 12 inches, thereby making room for the annotation.
Not e: Only Imaging f or Window s 98 and Imaging f or Window s
Prof essional Edit ion support changing t he size of an image.
Chapt er 4
112
Convert Image Project
The Convert Image project shows how to provide image file type and
page property conversion functions to your users.
The project consists of one for m and the following controls:
s
One Image Admin control
s
One Image Edit control
s
Three Command Button controls in a control ar ray
It uses the following Imaging methods to provide the image conversion
functions:
ShowFileDialog (Image Admin) To enter the path and file name
and select the new file type of the converted image.
SaveAs (Image Edit) To save the image file with the new file type.
ShowPageProperties (Image Edit) To change the color type,
compression type, resolution, and/ or size of the image page.
Save (Image Edit) To save the image file after changing its color
type, compression type, resolution, and/ or size.
The f ile name f o r t he Convert
project is Convert.vbp.
Not e: Users can change t he color t ype, compression t ype, resolut ion,
and size on a page-by-page basis only.
Adding Imaging Using Act iveX Cont rols
113
Changing t he File Type
Start the Convert Image project. The application begins by displaying an
Open dialog box, which lets you select the image file you want to
convert. After you select the image file, the application displays it.
To change the file type of the displayed image, click the File Type
button. The cmdConvert_Click() event procedure fires and executes
the code in Case 0 of the Select Case statement.
The procedure invokes the ShowFileDialog method of the Image
Admin control, passing to it the following parameter values:
SaveDlg (literal 1) To display a Save As dialog box
frmConvertImage.hWnd To assign the parent window handle to
the Save As dialog box
The Save As dialog box lets you specify the new path and file name and
the new file type you want for the image. It assigns the new path and file
name to the Image property of the Image Admin control, and it assigns
the list box index value of the selected file type to the FilterIndex
property of the Image Admin control.
The procedure continues by assigning the content of the Image property
of the Image Admin control to the Image property of the Image Edit
control. And it assigns the new file type provided by the value of the
FilterIndex property of the Image Admin control to the
intFileType local var iable. Conveniently, the numer ic value of the
FilterIndex property equals the literal value of each file type. (R efer to
the SaveAs Method of the Image Edit control in Chapter 7 for more
infor mation.)
Similar t o t he M icrosof t
Common Dialog box, you can
use t he Filt er propert y of t he
Image Admin cont rol t o
populat e t he Files of Type list
box w it h t he f ile t ypes you
desire.
Chapt er 4
114
Next, the procedure invokes the SaveAs method of the Image Edit
control, passing to it the new path and file name provided by the Image
property and the new file type provided by intFileType.
The SaveAs method saves the image file using the new file name and file
type.
2TKXCVG 5WD EOF%QPXGTVA%NKEM+PFGZ #U +PVGIGT)
&KO KPV(KNG6[RG #U +PVGIGT
&KO KPV4GURQPUG #U +PVGIGT

5GNGEV %CUG +PFGZ

%CUG 0 '(KNG 6[RG DWVVQP

'5GV VJG (KNVGT RTQRGTV[ VQ HKNG V[RGU VJCV ECP DG YTKVVGP
MFM+OI#FOKP1(KNVGT - 6+(( 'VKH)^' VKH^(#: 'CYF)^' CYF^ A
$KVOCR 'DOR)^' DOR^

'5GV VJG (KNVGT+PFGZ RTQRGTV[ VQ VJG HKNG V[RG QH VJG FKURNC[GF KOCIG
'KH KV ECP DG YTKVVGP QVJGTYKUG VQ 6+((
+H MFM+OI#FOKP1(KNG6[RG 4 6JGP
MFM+OI#FOKP1(KNVGT+PFGZ - MFM+OI#FOKP1(KNG6[RG
'NUG
MFM+OI#FOKP1(KNVGT+PFGZ - 1
'PF +H

'+PXQMG 5JQY(KNG&KCNQI OGVJQF
1P 'TTQT )Q6Q %CPEGN2TGUUGFA'*
kdkImqAdm1nI.ShowF1eD1aoq SaveDq. frmOonvertImaqe.hWnd
'5GV +OCIG 'FKV'U +OCIG RTQRGTV[ VQ VJG HKNG PCOG TGVWTPGF D[ VJG
'1RGP FKCNQI DQZ
kdkImqEd1tI.Imaqe - kdkImqAdm1nI.Imaqe

'5GV VJG K(KNG6[RG XCTKCDNG VQ VJG HKNG V[RG TGVWTPGF D[ VJG
'1RGP FKCNQI DQZ
1ntF1eTye - kdkImqAdm1nI.F1terIndex

'+PXQMG VJG 5CXG#U OGVJQF WUKPI VJG PGY HKNG PCOG CPF HKNG V[RG
kdkImqEd1tI.SaveAs kdkImqEd1tI.Imaqe. 1ntF1eTye

'PF 5GNGEV
%CPEGN2TGUUGFA'*
'PF 5WD
Adding Imaging Using Act iveX Cont rols
115
Changing t he Color, Compression, Resolut ion, and Size
If necessary, start the Convert project and open an image file.
To change the color type, compression type, resolution, and/ or size of
the displayed image, click the Page button. The cmdConvert_
Click() event procedure fires and executes the code in Case 1 of the
Select Case statement.
The procedure invokes the ShowPageProperties method of the Image
Edit control, which displays the Page Properties dialog box. As long as
the False parameter is included in the call to ShowPageProperties
method, the dialog box can be used to specify a new color type,
compression type, resolution, and/ or size for the image page.
The ShowPageProperties method returns an integer that indicates
whether the user has pressed the OK or Cancel button on the dialog
box (the standard vbOK and vbCancel constants are available for use).
The cmdConvert_Click() event procedure assigns this value to the
intResponse local var iable.
Chapt er 4
116
The procedure evaluates the value of the intResponse var iable. If users
click the OK button, it saves the altered image using the Save method of
the Image Edit control. If users click the Cancel button, the event
procedure exits without saving the image.
2TKXCVG 5WD EOF%QPXGTVA%NKEM+PFGZ #U +PVGIGT)
&KO KPV(KNG6[RG #U +PVGIGT
&KO KPV4GURQPUG #U +PVGIGT

5GNGEV %CUG +PFGZ

%CUG 1 '2CIG DWVVQP



'&KURNC[ VJG 5JQY2CIG2TQRGTVKGU FKCNQI DQZ VQ NGV WUGTU EQPXGTV VJG
'KOCIG
1ntResonse - kdkImqEd1tI.ShowPaqeProert1esFase)
+H KPV4GURQPUG - XD1- 6JGP
'7UGT ENKEMGF 1- QP VJG FKCNQI DQZ UQ UCXG VJG EQPXGTVGF KOCIG
kdkImqEd1tI.Save
'NUG+H KPV4GURQPUG - XD%CPEGN 6JGP
'7UGT ENKEMGF %CPEGN QP VJG FKCNQI DQZ UQ GZKV YKVJQWV UCXKPI
'ZKV 5WD
'PF +H

'PF 5GNGEV
%CPEGN2TGUUGFA'*
'PF 5WD
Adding Imaging Using Act iveX Cont rols
117
Copying An Image
The Image Copy demonstration project shows how to add a Clipboard
copy function to your image- enabled applications. Before walking
through the demonstration project, read the following section, which
explains the concept of using the Clipboard with image data.
Clipboard Funct ions Def ined
Youre probably familiar with using the Clipboard to copy, cut, and paste
text data within your development environment or word processor.
Using the Clipboard with image data is similar.
The Imaging ActiveX controls provide several properties, methods, and
events that let you add Clipboard functions to your image- enabled
applications. With them, your users can:
s
Copy or cut image and/ or annotation data to the Clipboard.
s
Paste image or annotation data from the Clipboard onto an image
displayed in the Image Edit control or into any application that
supports the pasting of image data (for example, Microsoft Word,
WordPad, Exchange, or Excel).
Depending on how you code your application, you can let your users
copy or cut an entire image page, a selected portion of an image page, or
selected annotations.
The following sections br iefly descr ibe the properties, methods, and
events of the Image Edit control youll find useful when adding
Clipboard functions to your applications. (R efer to Chapters 7 through
11 in this guide for more infor mation.)
Clipboard Copy and Cut
ClipboardCopy method Copies image or annotation data to the
Clipboard.
ClipboardCut method Copies image or annotation data to the
Clipboard and then removes the data from the Image Edit control.
Clipboard Past e
IsClipboardDataAvailable method Checks to see if image or
annotation data is present in the Clipboard. You can use this method to
see if data is available for pasting.
Chapt er 4
118
ClipboardPaste method Pastes image or annotation data from the
Clipboard onto an image in the Image Edit control.
CompletePaste method Completes a Clipboard paste operation,
making the pasted image or annotation data a part of the or iginal image.
PasteCompleted event Fires when the pasted image or annotation
data is committed to a location on the target image.
PasteClip event Fires when the pasted image or annotation data is
too large to fit within the confines of the target image.
Image Select ion
SelectionRectangle property Sets whether a selection rectangle is
drawn when an end user clicks the left mouse button and drags the
mouse pointer over a displayed image. Can be used to select a portion of
an image to copy or cut to the Clipboard.
DrawSelectionRect method Draws a selection rectangle on an
image programmatically.
SelectionRectDrawn event Fires after a selection rectangle has
been drawn by the end user or by the DrawSelectionRect method.
Annot at ion Select ion
AnnotationType property When set to the Select Annotations
annotation type, lets end users select one or more annotations for
copying or cutting to the Clipboard (or for some other Imaging
purpose).
Draw method Draws an annotation. Can be used to select
annotations programmatically by drawing a Select Annotations
annotation type.
MarkSelect event Fires after an end user or the program selects one
or more annotations for copying or cutting to the Clipboard (or for some
other Imaging pur pose, such as ZoomToSelection, for example).
Not e: A select ion rect angle can be used t o select a port ion of an image
w it h or w it hout annot at ions; how ever, it cannot be used t o
select annot at ions alone.
Not e: The Select Annot at ions annot at ion t ype select s annot at ions
exclusively. It does not select t he underlying image dat a.
Adding Imaging Using Act iveX Cont rols
119
Example
Users of your application may want to copy an image page to the
Clipboard so they can paste the image into a word processing document.
Scenario
Assume Susan is wr iting a follow- up letter to her insurance company
about a reimbursement claim she has yet to receive. Before she sent the
or iginal receipt, she scanned it and saved it to disk. Now she wants to
include a copy of the receipt in her follow- up letter.
With the image of the receipt displayed in your application, she copies it
to the Clipboard using the Clipboard functions you provided. Then, in
Word, she pastes the image into her letter.
Copy Image Project
The Copy Image project demonstrates copying an entire image page to
the Clipboard.
The project consists of one for m and the following controls:
s
One Image Admin control
s
One Image Edit control
s
One Picture Box control
s
Two Frame controls
The f ile name f o r t he Copy
Image project is
Imgcopy.vbp.
Chapt er 4
120
It uses the following methods in the Image Edit control to provide the
image copy function:
Display To display the image in the Image Edit control.
ClipboardCopy To copy the image page to the Clipboard.
Copying t he Image Page
Start the Image Copy project. The Form_Load() event procedure
displays an Open dialog box to let you select the TIFF image file you
want to copy.
After you select the image file, the procedure invokes the Display
method to display the image in the Image Edit control (which is inside
the Copied To Clipboard frame).
Next, the procedure invokes the ClipboardCopy method of the Image
Edit control, passing to it the following parameters:
s
The Left and Top coordinates of the image relative to the Image Edit
control (0,0).
s
The Width and Height of the image in pixels, as provided by the
current values of the ImageScaleWidth and ImageScaleHeight
properties of the Image Edit control.
Adding Imaging Using Act iveX Cont rols
121
Finally, the procedure obtains the current image content of the Clipboard
using Visual Basics GetData method and displays it in the PictureBox
control (which is inside the Data In Clipboard frame) I.
2TKXCVG 5WD (QTOA.QCF)
&KO XPV6GOR #U 8CTKCPV
&KO NPI42QUKVKQP #U .QPI
&KO UPI.GHV%JCT #U 5KPING UPI4KIJV%JCT #U 5KPING



'%JGEM HQT XCNKF 6+(( HKNG
+H MFM+OI#FOKP1(KNG6[RG 1 6JGP
)Q6Q (KNGA'*
'NUG
'7UG VJG (KV6Q OGVJQF VQ OCMG VJG FKURNC[GF KOCIG HKV KPVQ VJG YKFVJ
'QH VJG +OCIG 'FKV EQPVTQN
MFM+OI'FKV1(KV6Q (+6A61A9+&6*

'&KURNC[ VJG KOCIG
kdkImqEd1tI.D1say

'%QR[ VJG YJQNG KOCIG QPVQ VJG %NKRDQCTF
kdkImqEd1tI.O1boardOoy 0. 0. kdkImqEd1tI.ImaqeScaeW1dth.
kdkImqEd1tI.ImaqeScaeHe1qht

')GV VJG KOCIG FCVC HTQO VJG VJG %NKRDQCTF CPF FKURNC[ KV KP
'VJG 2KEVWTG$QZ EQPVTQN VQ OCMG UJQY KV YCU EQRKGF
RKE+OCIG - %NKRDQCTF)GV&CVC)
'PF +H
'ZKV 5WD
(KNGA'*
/UI$QZ 3WKVVKPI VJG RTQITCO PQY 2NGCUG UGNGEV C 6+(( HKNG VQ WUG VJG A
RTQITCO
'3WKV VJG RTQITCO
'PF
'PF 5WD
Chapt er 4
122
Print ing An Image
The Pr int Image demonstration project shows how to add image
pr inting to your image- enabled applications. Before walking through the
demonstration project, read the following section, which explains the
concept of pr inting an image file. (R efer to Chapters 7 through 11 in this
guide for more infor mation.)
Image Print ing Def ined
Pr inting an image file is very similar to pr inting a word processing
document.
You can use the ShowPrintDialog method of the Image Admin control
to present a Print dialog box to the end user. With it and the Print
Options dialog box that can be invoked from it the end user can
select:
s
The pr inter to use.
s
The pages to pr int.
s
The number of copies to pr int, and whether to collate.
s
The output for mat to use.
s
The page or ientation to use.
s
Whether to pr int annotations.
The PrintImage method of the Image Edit control perfor ms the actual
pr int operation. Its parameters let you set the start page, end page, output
for mat, annotation pr int preference, and pr inter to use.
Example
Users of your application may want to pr int an image file on a particular
pr inter and have complete control over the process of doing so.
Adding Imaging Using Act iveX Cont rols
123
Scenario
Assume Geoff is using your application to view an image of a technical
drawing. As he views it, he annotates it with his comments.
After enter ing his last comment, Geoff realizes that he is supposed to
meet Susan for lunch in just 15 minutes. He would like her to take a look
at the technical drawing too only he doesnt want her to see his
annotated comments.
On the File menu of your application, Geoff clicks Print. Then, on the
Print dialog box, he clicks the Options button.
On the Print Options dialog box, he unchecks the Print displayed
annotations and zones check box and then clicks OK to return to the
Print dialog box.
On the Print dialog box, Geoff selects the pr inter he wants use and
specifies the page range and number of copies to pr int. When he clicks
OK, your application pr ints the drawing without Geoff s annotations.
Chapt er 4
124
Print Image Project
The Pr int Image project demonstrates pr inting an image file.
The project consists of one for m and the following controls:
s
One Image Admin control
s
One Image Edit control
s
Two Command button controls in a control array
And it uses the following Imaging methods to provide the pr int image
function:
ShowPrintDialog (Image Admin) To display a Print dialog box
to the end user.
PrintImage (Image Edit) To actually pr int the image.
The f ile name f o r t he Print
Image project is Print.vbp.
Adding Imaging Using Act iveX Cont rols
125
Print ing an Image File
Start the Pr int Image project. The Form_Load() event procedure
displays an Open dialog box to let you select the TIFF image file you
want to pr int.
After you select the image file, the procedure displays it in the Image Edit
control.
To pr int the image, click the Print button. The cmdPrint_Click()
event procedure fires and executes the code in Case 0 of the Select
Case statement.
The procedure invokes the ShowPrintDialog method of the Image
Admin control, passing to it the handle of the parent window.
The ShowPrintDialog method displays a Print dialog box, which lets
you specify the pr int options mentioned earlier.
Not e: Even t hough passing t he handle t o t he parent w indow is
opt ional, f or best result s always include it w hen you invoke t he
Show Print Dialog met hod.
Chapt er 4
126
After you click the OK button on the Print dialog box, the Image
Admin control sets several of its pr int- related properties to values that
correspond to the selections made on the Print and Print Options
dialog boxes. (Keep in mind that the Pr int Image project does not use all
of these properties.)
You can set t he p rin t -relat ed
propert ies t o pref er red values
prior t o invoking t he Print
dialog box. Doing so let s you
preset dialog bo x f ields t o
def ault set t ings.
Print -Relat ed Propert ies Set By t he Print and Print Opt ions
Dialog Boxes
Image Admin
Propert y
Set
Associat ed Field
and
Dialog Box
Value
Propert y
Cont ains
Pr intAnnotations
a
Print displayed
annotations and
zones check box
on the Print
Options dialog
box
True or False
Indicating whether to
pr int annotations
Pr intCollate Collate check box
on the Print dialog
box
True or False
Indicating whether to
collate image pages
Pr intEndPage
a
Pages to text box
on the Print dialog
box
The ending page
number in the range
of pages to pr int
Pr intNumCopies Number of
copies text box on
the Print dialog
box
The number of
copies to pr int
Pr intOr ientation Print
orientation list
box on the Print
Options dialog
box
The page
or ientation:
0 Portrait
1 Landscape
2 Automatic
Pr intO utputFor mat
a
Print format list
box on the Print
Options dialog
box
The output for mat to
use:
0 Pixel to pixel
1 Actual size
2 Fit to page
3 Best fit
b
Adding Imaging Using Act iveX Cont rols
127
Pr intR angeOption The following
option buttons on
the Print dialog
box:
s
All pages
s
Current page
s
Selection
s
Pages
Whether to pr int:
0 All pages
1 R ange of pages
2 Cur rent page
3 Selection
Pr intStartPage
a
Pages from text
box on the Print
dialog box
The start page
number in a range of
pages to pr int
Pr intToFile Print to file check
box on the Print
dialog box
True or False
Indicating whether to
pr int to a file
a. You can include the values of these properties in your call to the
PrintImage method to set the range of pages to print, determine
whether to print annotations, and to set the output format. The
remaining properties affect the print operation directly.
b. Available with Imaging for Windows Professional Edition Version
2.0 and greater.
Print -Relat ed Propert ies Set By t he Print and Print Opt ions
Dialog Boxes (cont inued)
Image Admin
Propert y
Set
Associat ed Field
and
Dialog Box
Value
Propert y
Cont ains
Chapt er 4
128
The procedure continues by evaluating the value of the
PrintRangeOption property. It invokes the PrintImage method of the
Image Edit control with the StartPage and EndPage parameter values that
are appropr iate for the PrintRangeOption value selected on the Print
dialog box (as descr ibed in the following table).
Each invocation of the PrintImage method also includes the
OutputFor mat and Annotation parameter values supplied by the
PrintOutputFormat and PrintAnnotations properties of the Image
Admin control.
Once invoked, the PrintImage method pr ints the image to the pr inter
or file specified.
St art Page and EndPage Paramet er Values Passed
Print RangeOpt ion
Const ant (Lit eral)
St art Page
Paramet er
EndPage
Paramet er
Pr intAll (0) The value of the
PrintStartPage
property of Image
Admin control
The value of the
PrintEndPage
property of Image
Admin control
Pr intR ange (1) The value of the
PrintStartPage
property of Image
Admin control
The value of the
PrintEndPage
property of Image
Admin control
Pr intCur rent (2) The value of the
Page property of
Image Edit control
The value of the
Page property of
Image Edit control
Adding Imaging Using Act iveX Cont rols
129
2TKXCVG 5WD EOF2TKPVA%NKEM+PFGZ #U +PVGIGT)
5GNGEV %CUG +PFGZ

%CUG 0 '2TKPV
1P 'TTQT )Q6Q 2TKPVA'*
'&KURNC[ VJG 2TKPV FKCNQI DQZ
kdkImqAdm1nI.ShowPr1ntD1aoq frmPr1ntImaqe.hWnd
'7UGT RTGUUGF 1- EQPVKPWG YKVJ RTKPV
+H MFM+OI#FOKP15VCVWU%QFG - 0 6JGP

'%JGEM QP YJKEJ QRVKQP VJG WUGT UGNGEVGF VJGP RTKPV
'KOCIG WUKPI VJG +OCIG 'FKV EQPVTQN
+H kdkImqAdm1nI.Pr1ntRanqeOt1on - Pr1ntA 6JGP
kdkImqEd1tI.Pr1ntImaqe kdkImqAdm1nI.Pr1ntStartPaqe.
kdkImqAdm1nI.Pr1ntEndPaqe. kdkImqAdm1nI.Pr1ntOututFormat.
kdkImqAdm1nI.Pr1ntAnnotat1ons
'PF +H

+H kdkImqAdm1nI.Pr1ntRanqeOt1on - Pr1ntRanqe 6JGP
kdkImqEd1tI.Pr1ntImaqe kdkImqAdm1nI.Pr1ntStartPaqe.
kdkImqAdm1nI.Pr1ntEndPaqe. kdkImqAdm1nI.Pr1ntOututFormat.
kdkImqAdm1nI.Pr1ntAnnotat1ons
'PF +H

+H kdkImqAdm1nI.Pr1ntRanqeOt1on - Pr1ntOurrent 6JGP
kdkImqEd1tI.Pr1ntImaqe kdkImqEd1tI.Paqe. kdkImqEd1tI.Paqe.
kdkImqAdm1nI.Pr1ntOututFormat. kdkImqAdm1nI.Pr1ntAnnotat1ons
'PF +H

'PF +H
%CUG 1 ''ZKV
''PF VJG RTQITCO
'PF
'PF 5GNGEV

'PF 5WD P
Chapt er 4
130
Scanning an Image Using a Templat e
The Template Scanning demonstration project shows how to add
template scanning to your image- enabled applications. Before walking
through the demonstration project, read the following section, which
explains the concept of template scanning. (R efer to Chapters 7 through
11 in this guide for more infor mation.)
Templat e Scanning Def ined
When the Imaging software operates in the Template Scanning mode, it
saves scanned images to files that are named and incremented
automatically.
Each file name is based on a template, which consists of:
s
A path to where the images are saved.
s
A file name prefix , which is used to generate the file names.
The end user of the application usually provides the path and prefix.
R esponding to input from your end user, you can place the Imaging
software in Template Scanning mode by setting the ScanTo property of
the Image Scan control to the appropr iate value. You can then specify the
template by setting the Image property of the Image Scan control to the
path and prefix provided.
For example, if the user wants image files to be saved to the
c:\claims\automobile path using file names prefixed with auto, enter the
following str ing in the Image property of the Image Scan control:
imgScan1.Image = c:\claims\automobile\auto
Using this template, the Imaging software will save images to files named
auto00001.tif, auto00002.tif, and so on in the c:\ claims\ automobile
folder (TIFF file for mat assumed).
The file type as well as the setting of the PageCount and MultiPage
properties of the Image Scan control deter mines the number of image
files generated and the number of image pages saved per file.
When scanning images using the BMP file type, each image page is
always saved to a separate file. For example:
c:\claims\automobile\auto00001.bmp
c:\claims\automobile\auto00002.bmp
c:\claims\automobile\auto00003.bmp
This occurs because the BMP file type does not support multiple image
pages per file.
The ScanTo propert y also has
set t ings t hat per mit scanning
direct ly t o a f ile (non-Templat e
Scanning). When scanning t o a
f ile, co nsider using t he
Show ScanNew and t he
Show ScanPage met hods of
t he Imag e Scan cont rol t o
quickly add scanning f unct ions
t o your applicat ions.
Adding Imaging Using Act iveX Cont rols
131
When scanning images using the TIFF or AWD file types which do
support multiple image pages per file the setting of the PageCount
and MultiPage properties of the Image Scan control deter mines the
number of image files created and the number of pages in each image file.
(R efer to the following table.)
For example, if you set the PageCount property to 5 and the
MultiPage property to True, and then you scan 20 pages, the Imaging
software creates four image files with five pages in each one.
Example
Users of your application may want to use a scanner equipped with an
automatic document feeder (ADF) to automatically scan multiple pages
into one or more image files.
Scenario
Assume Glor ia has five 10- page documents she wants to scan using her
ADF- equipped scanner and your application.
She wants each 10- page document to be saved to its own TIFF image file
in the c:\ employees path, and she wants the file name of each document
to be prefixed with the word review.
PageCount and Mult ipage Propert y Inf luence
PageCount
Set t ing
Mult iPage
Set t ing
Number of
Image Files
Pages In
Image File
0 True 1 All pages
scanned
0 False One file for
each page
scanned
1
X
a
True Total number
of pages
scanned
divided by X
X
X False X 1
a. Any value greater than 0.
Chapt er 4
132
Because you provided a way for users to:
s
Specify the desired path,
s
Enter the file prefix,
s
Select the file type,
s
Set the PageCount property, and
s
Set the MultiPage property,
Glor ia was able to specify that:
s
All documents are saved in the c:\employees folder.
s
Each file name begins with the word review.
s
Each document is scanned and saved as T IFF.
s
Each document contains 1 0 pages.
s
Each image file contains multiple image pages.
When Glor ia commences scanning, your application:
1 Sets the ScanTo property of the Image Scan control to 3
(DisplayAndUseFileTemplate).
2 Creates the template by concatenating the path, a backslash, and the
template prefix and by setting the Image property of the Image
Admin control to the resulting str ing: c:\employees\review.
3 Sets the FileType property of the Image Admin control to T IFF.
4 Sets the PageCount property of the Image Admin control to 1 0 .
5 Sets the MultiPage property of the Image Admin control to True.
6 Scans 5 0 pages and saves each set of 1 0 scanned pages to 5 individual
TIFF image files each one generated and incremented using the
template specified:
c:\employees\review00001.tif
c:\employees\review00002.tif
c:\employees\review00003.tif
c:\employees\review00004.tif
c:\employees\review00005.tif
Not e: A ScanTo propert y set t ing of 4 (UseFileTemplat eOnly) also
enables t emplat e scanning.
Adding Imaging Using Act iveX Cont rols
133
Templat e Scan Project
The Template Scan project demonstrates scanning to a template.
The project consists of the following for ms and modules:
frmFileType Enables the user to select the desired file type.
frmHelp Presents a br ief help message to the user.
frmMain Lets the user enter the template prefix, specify the number
of pages per file, commence scanning, and view the first page of the
image file.
frmPaperSize Enables the user to specify the desired paper size.
frmPath Enables the user to specify the desired template path.
modMain Contains global constant definitions and global var iable
declarations.
The scanning functions exist in the Main for m (fr mMain), which
contains the following controls:
s
One Image Scan control
s
One Image Edit control
s
Two text box and label controls
The f ile name f or t he Templat e
Scan project is
Template.vbp.
Chapt er 4
134
s
One Command button control
s
Three menus
The for m uses the following methods of the Image Scan control to
provide the scanning functions:
ShowSelectScanner To select the scanner to use.
StartScan To scan images.
Templat e Scanning
Start the Template Scan project. The Main for m appears.
In the File Prefix text box, enter the prefix you want for the template.
Then, in the Pages per File text box, enter the number of pages you
want each image file to contain.
On the File menu:
s
Click File Type. On the File Type for m, click the file type you
want and then click OK. Depending on the option button you
clicked, the cmdOK_Click() event of the File Type for m
(fr mFileType) sets the FileType property of the Image Scan control
contained on the Main for m (fr mMain) to the file type
specified.
Adding Imaging Using Act iveX Cont rols
135
2TKXCVG 5WD EOF1-A%NKEM)
'5GV VJG (KNG 6[RG RTQRGTV[ QH VJG +OCIG 5ECP
'EQPVTQN QP HTO/CKP CEEQTFKPI VQ (KNG 6[RG QRVKQP
'DWVVQP QP VJKU HQTO +P CFFKVKQP UGV VJG 'PCDNGF
'RTQRGTV[ QH VJG NCDGN CPF VGZV DQZ EQPVTQNU CEEQTFKPIN[
+H QRV6KHH8CNWG 6JGP
frmMa1n!kdkImqScanI.F1eTye - TIFF
HTO/CKP!NDN2CIGU'PCDNGF - 6TWG
HTO/CKP!VZV2CIGU'PCDNGF - 6TWG
'NUG+H QRV$/28CNWG 6JGP
frmMa1n!kdkImqScanI.F1eTye - BMPB1tma
HTO/CKP!NDN2CIGU'PCDNGF - (CNUG
'5GV VGZV DQZ VQ 1 DGECWUG $/2 KU C
'UKPINGRCIG HKNG HQTOCV
HTO/CKP!VZV2CIGU6GZV - 1
HTO/CKP!VZV2CIGU'PCDNGF - (CNUG
'NUG+H QRV#9&8CNWG 6JGP
frmMa1n!kdkImqScanI.F1eTye - AWDM1crosoftFax
HTO/CKP!NDN2CIGU'PCDNGF - 6TWG
HTO/CKP!VZV2CIGU'PCDNGF - 6TWG
'PF +H
7PNQCF /G
'PF 5WD
Chapt er 4
136
s
Click Path. On the Folder dialog box, specify the template path,
which is where the image files are saved, and then click OK. The
cmdOK_Click() event of the Path for m (fr mPath) sets the global
var iable, gstrFolder, to the path specified. (Later, the
cmdStartScan_Click() event of the Main for m uses the value of
gstrFolder to set the Image property of the Image Scan control).
On the Options menu:
s
Click Paper Size. On the Paper Size dialog box, click the paper
size you expect to scan and then click OK. Depending on the option
button you clicked, the cmdOK_Click() event of the Paper Size
for m (fr mPaperSize) sets the global var iable, gsngAspect, to the size
specified. It then calls the Form_Resize() event of the Main for m,
which uses the value of gsngAspect, to resize the Main for m and
its controls (not shown).
2TKXCVG 5WD EOF1-A%NKEM)
'5GV VJG INQDCN RCVJ XCTKCDNG VQ VJG RCVJ URGEKHKGF
qstrFoder - d1rPath.Path

'5GV VJG %CRVKQP QH VJG /CKP HQTO VQ VJG RCVJ URGEKHKGF
HTO/CKP%CRVKQP - IUVT(QNFGT IUVT%/CKP%CRVKQP

'7PNQCF VJG 2CVJ HQTO
7PNQCF /G
'PF 5WD
Adding Imaging Using Act iveX Cont rols
137
2TKXCVG 5WD EOF1-A%NKEM)
'5GV VJG INQDCN #URGEV XCTKCDNG VQ GKVJGT
'VJG UK\G UGNGEVGF WUKPI CP QRVKQP DWVVQP
'QT VJG EWUVQO XCNWGU GPVGTGF
+H QRV.GVVGT 6JGP
qsnqAsect - II / 8.5
'NUG+H QRV.GICN 6JGP
qsnqAsect - I4 / 8.5
'NUG+H QRV1VJGT 6JGP
+H %5PIVZV9KFVJ6GZV) 1 6JGP
VZV9KFVJ6GZV - 1
$GGR
'PF +H
+H %5PIVZV*GKIJV6GZV) 1 6JGP
VZV*GKIJV6GZV - 1
$GGR
'PF +H
OUPI6OR9KFVJ - %5PIVZV9KFVJ6GZV)
OUPI6OR*GKIJV - %5PIVZV*GKIJV6GZV)
IUPI1VJGT9KFVJ - %5PIVZV9KFVJ6GZV)
IUPI1VJGT*GKIJV - %5PIVZV*GKIJV6GZV)
qsnqAsect - qsnqOtherHe1qht / qsnqOtherW1dth
'PF +H
'*KFG VJKU HQTO TGUK\G HTO/CKP CPF TGUGV VJG
'+OCIG 'FKV EQPVTQN VQ $GUV (KV
HTO2CRGT5K\G*KFG
frmMa1n.FormRes1ze
'PF 5WD
Chapt er 4
138
s
Click Scan Options to apply compression. The
mnuCompressionOptions_Click() event in the
Main for m invokes the ShowScanPreferences method
of the Image Scan control. The method displays a Scan Options
dialog box that lets you specify the compression you want.
2TKXCVG 5WD OPW%QORTGUUKQP1RVKQPUA%NKEM)
'+PXQMG VJG 5JQY5ECP2TGHGTGPEGU OGVJQF YJKEJ
'FKURNC[U VJG 5ECP 1RVKQPU FKCNQI DQZ
kdkImqScanI.ShowScanPreferences
'PF 5WD
Adding Imaging Using Act iveX Cont rols
139
s
Click Select Scanner to select the scanner you want to use. The
mnuSelectScanner_Click() event in the Main for m invokes the
ShowSelectScanner method of the Image Scan control. The
method displays a Select Scanner dialog box that lets you select the
scanner you want.
2TKXCVG 5WD OPW5GNGEV5ECPPGTA%NKEM)

'+PXQMG VJG 5JQY5GNGEV5ECPPGT OGVJQF YJKEJ
'FKURNC[U VJG 5GNGEV 5ECPPGT FKCNQI DQZ
kdkImqScanI.ShowSeectScanner
'PF 5WD
Chapt er 4
140
s
Click Stop Button to have the Imaging software display a Stop
button while scanning.
The mnuStopButton_Click() event in the Main for m sets the
StopScanBox property to True or False (as appropr iate) to either
display, or not display, the Stop button. The Stop button enables you
to abort a scanning operation in progress.
2TKXCVG 5WD OPW5VQR$WVVQPA%NKEM)
'5GV VJG 5VQR5ECP$QZ RTQRGTV[ KP CEEQTFCPEG YKVJ
'VJG %JGEMGF UVCVWU QH VJG OPW5VQR$WVVQP OGPW
'UGNGEVKQP
+H OPW5VQR$WVVQP%JGEMGF 6JGP
OPW5VQR$WVVQP%JGEMGF - (CNUG
kdkImqScanI.StoScanBox - Fase
'NUG
OPW5VQR$WVVQP%JGEMGF - 6TWG
kdkImqScanI.StoScanBox - True
'PF +H
'PF 5WD
Adding Imaging Using Act iveX Cont rols
141
To begin scanning, click the Start Scan button. The
cmdStartScan_Click() event procedure in the Main
for m fires and executes its code.
The procedure sets several properties of the Image Scan control to
enable template scanning:
DestImageControl Set to the same value as the ImageControl
property of the Image Edit control to per mit image display while
scanning.
ScanTo Set to DisplayAndUseFileTemplate (literal 3) to select
template scanning.
Image Set to the template, which is a concatenated str ing containing:
The path (as specified on the Path for m and assigned to the
gstrFolder global var iable),
A backslash (\), and
The file name prefix (as specified in the File Prefix text box).
PageCount Set to the value entered in the Pages per File text box
to establish the number of pages per file.
MultiPage Set to True to per mit the scanning of multiple image
pages.
Next, the procedure invokes the StartScan method of the Image Scan
control, which scans multiple image pages:
s
To the appropr iate number of image files.
s
Using auto- incremented path and file names that begin with the
template specified.
s
Containing the number of image pages specified.
Not e: Set t ing t he Dest ImageCont rol propert y t o t he value of t he
ImageCont rol propert y is essent ial w henever you w ant t o
display t he image being scanned. It may be used f or all t ypes of
scanning not just t emplat e scanning.
Chapt er 4
142
2TKXCVG 5WD EOF5VCTV5ECPA%NKEM)

1P 'TTQT )Q6Q 5ECPA'*

'.KPM VJG +OCIG 5ECP CPF +OCIG 'FKV EQPVTQNU VQ RGTOKV FKURNC[
'YJKNG UECPPKPI
kdkImqScanI.DestImaqeOontro - "kdkImqEd1tI"

'5GV VJG 5ECP6Q RTQRGTV[ VQ GPCDNG VGORNCVG UECPPKPI
kdkImqScanI.ScanTo - D1sayAndUseF1eTemate

'%QPECVGPCVG VJG RCVJ DCEMUNCUJ CPF VGORNCVG RTGHKZ 6JGP CUUKIP VJG
'UVTKPI VQ VJG +OCIG RTQRGTV[
kdkImqScanI.Imaqe - qstrFoder "\" txtPref1x.Text

'#UUKIP VJG 2CIGU RGT (KNG XCNWG VQ VJG 2CIG%QWPV RTQRGTV[
kdkImqScanI.PaqeOount - txtPaqes

'5GV VJG /WNVK2CIG RTQRGTV[ VQ GPCDNG OWNVKRCIG UECPPKPI
kdkImqScanI.Mut1Paqe - True

'%QOOGPEG UECPPKPI
kdkImqScanI.StartScan

'ZKV 5WD
5ECPA'*

'&KURNC[ VJG GTTQT OGUUCIG
NDN5VCVWU%CRVKQP - '4414 'TT&GUETKRVKQP
$GGR
'PF 5WD
Adding Imaging Using Act iveX Cont rols
143
Managing an Image File Using Thumbnails
The Thumbnail Sorter demonstration project shows how to use the
Image Thumbnail control to reorganize multipage image files. Before
walking through the demonstration project, read the following section,
which explains the basics of working with thumbnails. (R efer to
Chapters 7 through 11 in this guide for more infor mation.)
Thumbnails Def ined
The Image Thumbnail control lets you view each page of an image file
in miniature boxes called thumbnails. There is one thumbnail image for
each page in the file.
Each thumbnail has a caption beneath it that indicates its page position
within the image file and an annotation indicator if one or more
annotation marks exist on the corresponding image page.
In addition to viewing image pages, the Image Thumbnail control in
conjunction with the Image Admin control also lets you provide
image file management functions to your end users. These functions
enable them to:
s
Select an image page for display, edit, manipulation, deletion, or some
other Imaging function.
s
R eorganize pages within the image file.
s
Drag and drop image pages to and from other applications that
support drag- and- drop.
Example
Users of your application may want to view image files as a ser ies of
thumbnail images. They may also want to manage image files using drag
and drop.
Scenario
Assume Chr is and his staff regularly review large fax files that contain
mostly bluepr int drawings.
Chr is is concer ned that in the middle of any of these files there might be
a letter, or other piece of important infor mation, that could go
unnoticed when someone is scrolling through the file.
Using your application, Chr is and his staff can quickly review each fax
file by looking at its thumbnail images. When they find pages that have
important infor mation, they can drag and drop them into an another
The Image Thumbnail cont rol
has several propert ies t hat
enab le you t o assign dif f erent
f ont s, colors, and st yles t o t he
capt ions, as w ell as t o t he
cont rol it self .
Chapt er 4
144
Image Thumbnail control, whose ThumbDrop() event contains code
that routes the image pages to the appropr iate personnel.
Thumbnail Sort er Project
The Thumbnail Sorter project demonstrates using thumbnails to manage
an image file. Specifically, it allows you to:
s
R eorganize images pages within the file.
s
Drag and drop image pages from Explorer.
s
Delete image pages from the file by dragging and dropping them into
another Image Thumbnail control.
The project consists of one for m and the following controls:
s
One Image Admin control
s
Two Image Thumbnail controls
The f ile name f o r t he
Thumbnail Sort p roject is
Thumbnail.vbp.
Not e: Only Imaging f or Window s Prof essional Edit ion support s
reorganizing image pages by dragging and dropping t hem
wit hin t he Image Thumbnail cont rol.
Adding Imaging Using Act iveX Cont rols
145
s
Three Command button controls
s
Two Text Box box controls
s
Two Label controls
s
One Frame control
The project uses the following Imaging methods to provide the
thumbnail file management functions:
DisplayThumbs (Image Thumbnail control) To display the
pages of an image file as a ser ies of thumbnail images.
Insert (Image Admin control) To insert one or more selected
pages into the current image file.
InsertThumbs (Image Thumbnail control) To refresh the Image
Thumbnail control with the inserted pages.
DeletePages (Image Admin control) To delete one or more
selected pages from the current image file.
DeleteThumbs (Image Thumbnail control) To refresh the Image
Thumbnail control without the deleted pages.
Sort ing an Image File (Using Specif ied Page Numbers)
Start the Thumbnail Sorter project. The Form_Load() event procedure
displays an Open dialog box to let you select the TIFF image file you
want to work with. Be sure to select a multipage image file.
After you select the image file, the procedure:
s
Sets the Image property of the Image Thumbnail control to the
complete path and file name you selected (as supplied by the Image
property of the Image Admin control).
s
Invokes the DisplayThumbs method of the Image Thumbnail
control to display each page of the file as a thumbnail in the Image
Thumbnail control located inside the Thumbnails frame.
s
Sets the AutoSelect property of the Image Thumbnail control to
True to have the control handle all thumbnail selections made using
the mouse.
Not e: The Thumbnail Sort er project also uses t he Drag (ext ender)
met hod, w hich is provided by t he f rame t hat cont ains t he Image
Thumbnail cont rol. When invoked, it begins a drag operat ion.
Chapt er 4
146
s
Sets the EnableDragDrop property of the Image Thumbnail
control to a literal value of 15, which is a bit- wise combination of the
settings descr ibed in the following table.
s
Gets the number of thumbnail images displayed from the
ThumbCount property of the Image Thumbnail control.
s
Sets up another Image Thumbnail control to serve as a trash bin by
setting its ThumbWidth and ThumbHeight properties to the
desired dimensions, and its Image property to a bitmap of a trash
bin.
The EnableDragDrop
propert y let s you set t he
desired drag-and-drop
behavior.
Not e: The EnableDragDrop propert y value det ermines t he drag-and-
drop behavior of t he Thumbnail Sort er applicat ion, w hich is
described in t he sect ions ent it led Sort ing an Image File (Using
Drag and Drop) and Delet ing Image Pages (Using Drag and
Drop) .
Combined EnableDragDrop Propert y Set t ings
Lit eral Value Set t ing Descript ion
1 Enable drag using left mouse button
2 Enable drag using r ight mouse button
4 Enable drop into
8 Enable dropping of image files
R esult = 15 DropFilesDropDragLeftR ight
Adding Imaging Using Act iveX Cont rols
147
In the Insert Page text box, enter the number of the page you want to
insert before another page in the file. Then in the Before Page text box,
enter the number of the page you want the Insert page to appear before.
2TKXCVG 5WD (QTOA.QCF)
&KO UVT2CVJ0COG #U 5VTKPI
&KO UVT6GOR #U 5VTKPI
&KO UVT4KIJV%JCT #U 5VTKPI UVT.GHV%JCT #U 5VTKPI
&KO KPV42QUKVKQP #U +PVGIGT

'+PXQMG VJG 5JQY(KNG&KCNQI DQZ


MFM+OI#FOKP15JQY(KNG&KCNQI 1RGP&NI

'PF +H
'&KURNC[ CP GTTQT OGUUCIG KH VJG KOCIG HKNG KU PQV 6+((
+H MFM+OI#FOKP1(KNG6[RG 1 6JGP
)Q6Q (KNGA'*
'NUG
'5GV VJG +OCIG RTQRGTV[ QH VJG 6JWODPCKN EQPVTQN
kdkImqThumbna1.Imaqe - kdkImqAdm1nI.Imaqe
')GV VJG RCVJ QH VJG CRRNKECVKQP
UVT2CVJ0COG - #RR2CVJ

'&KURNC[ C VJWODPCKN HQT GCEJ KOCIG RCIG KP VJG HKNG
kdkImqThumbna1.D1sayThumbs

'5GV #WVQ5GNGEV VQ VTWG VQ GPCDNG FTCI CPF FTQR CPF
''PCDNG&TCI&TQR VQ &TQR(KNGU&TQR&TCI.GHV4KIJV NKVGTCN 1b)
kdkImqThumbna1.AutoSeect - True
kdkImqThumbna1.EnabeDraqDro - I5

')GV VJG VJWODPCKN RCIG EQWPV
mnqThumbOount - kdkImqThumbna1.ThumbOount

'5GV WR CP +OCIG 6JWODPCKN EQPVTQN CU C VTCUJ DKP
'VQ RTQXKFG C YC[ VQ FGNGVG RCIGU
kdkImqThumbna1Trash.ThumbW1dth - 50
kdkImqThumbna1Trash.ThumbHe1qht - 50
kdkImqThumbna1Trash.Imaqe - strPathName "\trashb1n.bm"

'PF 5WD
Chapt er 4
148
For example, to insert page 4 before page 2, enter 4 in the Insert Page
text box and 2 in the Before Page text box.
Click the Execute button. The cmdExecute_Click() event
procedure fires and executes its code.
The procedure perfor ms the following actions:
s
Gets the complete path and file name of the current image file from
the Image property of the Image Thumbnail control and assigns it to
the strName local var iable.
s
Gets the Insert page number from the Insert Page text box and
assigns it to the lngInsertPage local var iable.
s
Gets the Insert Before page from the Before Page text box and
assigns it to the lngInsertBeforePage local var iable.
s
Invokes the Insert method of the Image Admin control, passing to it
the:
Path and file name of the cur rent image file (from strName).
Insert Page number (from lngInsertPage).
Insert Before page number (from lngInsertBeforePage).
1 (which specifies the number of pages to insert).
The Insert method inserts a copy of the Insert page before the Insert
Before page in the cur rent image file.
s
Invokes the InsertThumbs method of the Image Thumbnail
control, passing to it the:
Insert Before page number (from lngInsertBeforePage).
1 (which specifies the number of pages to insert).
The InsertThumbs method refreshes the control. Were you to set a
breakpoint after invoking this method, youd see two copies of the
Insert page in the Image Thumbnail control.
s
Deter mines the page number of the unwanted, leftover copy of the
image page (from the value of lngInsertPage) so it can be deleted
from the file.
If the unwanted page is after the Insert Before page, the procedure
increments lngInsertPage by one to delete the cor rect page.
Not e: You must call t he Insert met hod of t he Image Admin cont rol
bef ore calling t he Insert Thumbs met hod of t he Image
Thumbnail cont rol.
Adding Imaging Using Act iveX Cont rols
149
s
Invokes the DeletePages method of the Image Admin control,
passing to it the:
Number of the page to delete (from lngInsertPage).
1 (which specifies the number of pages to delete).
The DeletePages method deletes the unwanted, leftover copy of
the image page from the file.
s
Invokes the DeleteThumbs method of the Image Thumbnail
control, passing to it the:
Number of the page to delete (from lngInsertPage).
1 (which specifies the number of pages to delete).
The DeleteThumbs method refreshes the control without the
unwanted page.
Not e: You must call t he Delet ePages met hod of t he Image Admin
cont rol bef ore calling t he Delet eThumbs met hod of t he Image
Thumbnail cont rol.
Chapt er 4
150
2TKXCVG 5WD EOF'ZGEWVGA%NKEM)
&KO UVT0COG #U 5VTKPI
&KO NPI+PUGTV2CIG #U .QPI
&KO NPI+PUGTV$GHQTG2CIG #U .QPI

')GV VJG RCVJ CPF HKNG PCOG QH VJG FKURNC[GF KOCIG
strName - kdkImqThumbna1.Imaqe

')GV VJG +PUGTV RCIG CPF VJG +PUGTV $GHQTG RCIG
nqInsertPaqe - OLnqtxtInsertPaqe.Text)
nqInsertBeforePaqe - OLnqtxtInsertBeforePaqe.Text)

'%JGEM VQ UGG KH VJG +PUGTV RCIG KU VQ DG KPUGTVGF
'DGHQTG KVUGNH +H KV KU CDQTV RTQEGUUKPI
+H NPI+PUGTV2CIG - NPI+PUGTV$GHQTG2CIG 1T NPI+PUGTV2CIG - NPI+PUGTV$GHQTG2CIG 1 6JGP
'ZKV 5WD
'PF +H

'2NCEG VJG +PUGTV RCIG DGHQTG VJG +PUGTV $GHQTG RCIG KP VJG EWTTGPV
'KOCIG HKNG
kdkImqAdm1nI.Insert strName. nqInsertPaqe. nqInsertBeforePaqe. I

'4GHTGUJ VJG +OCIG 6JWODPCKN EQPVTQN VQ FKURNC[ VJG TGQTFGTGF
'KOCIG HKNG
kdkImqThumbna1.InsertThumbs nqInsertBeforePaqe. I

'&GNGVG VJG NGHVQXGT RCIG
+H UVT0COG - MFM+OI6JWODPCKN+OCIG 6JGP
'+H VJG +PUGTV2CIG PWODGT KU ITGCVGT VJCP VJG +PUGTV $GHQTG
'PWODGT KPETGOGPV VJG NPI+PUGTV2CIG XCTKCDNG D[ 1 VQ UGV
'VJG CRRTQRTKCVG RCIG HQT FGNGVKQP
+H NPI+PUGTV2CIG NPI+PUGTV$GHQTG2CIG 6JGP
NPI+PUGTV2CIG - NPI+PUGTV2CIG 1
'PF +H
'&GNGVG VJG NGHVQXGT RCIG HTQO VJG KOCIG HKNG CPF VJG +OCIG
'6JWODPCKN EQPVTQN
kdkImqAdm1nI.DeetePaqes nqInsertPaqe. I
kdkImqThumbna1.DeeteThumbs nqInsertPaqe. I
'PF +H
'PF 5WD
Adding Imaging Using Act iveX Cont rols
151
Sort ing an Image File (Using Drag and Drop)
If necessary, start the Thumbnail Sorter project and select a multipage
image file.
Point to the thumbnail of an image page you want to insert before
another page in the file. Then hold down the left mouse button. The
MouseDown() event procedure of the Image Thumbnail control fires
and invokes the Drag (extender) method of Visual Basic, which starts the
Drag operation.
Next, drag the thumbnail (or image file) to the desired position and
release the left mouse button. The ThumbDrop() event procedure of
the Image Thumbnail control fires and perfor ms the following actions:
s
Gets the complete source path and file name from the
ThumbDropNames property of the Image Thumbnail control for
each image page being inserted and assigns it to the strName local
var iable.
If youre dragging and dropping pages within the cur rent image file,
the ThumbDropNames property returns the path and file name of
the displayed image file.
If youre dragging and dropping pages from Explorer, the Thumb-
DropNames property returns the path and file name of the source
image file.
s
Gets the Insert page number from the ThumbDropPages property
of the Image Thumbnail control for each image page being inserted,
and assigns it to the lngInsertPage local var iable.
You can select mult iple
t humbnails by holding dow n
t he Shif t or Ct rl keys.
2TKXCVG 5WD MFM+OI6JWODPCKNA/QWUG&QYP$[8CN $WVVQP #U +PVGIGT A
$[8CN 5JKHV #U +PVGIGT $[8CN : #U 5KPING $[8CN ; #U 5KPING A
$[8CN 6JWOD0WODGT#U .QPI)

'+PXQMG VJG &TCI QRGTCVKQP
kdkImqThumbna1.Draq
'PF 5WD
Not e: As an alt er nat ive, you can point t o an image f ile in Explorer and
t hen hold dow n t he lef t mouse but t on.
Chapt er 4
152
s
Invokes the Insert method of the Image Admin control, passing to it
the:
Path and file name of the cur rent image file (from strName).
Insert Page number (from lngInsertPage).
Insert Before page number (from the InsertBefore argument of
the ThumbDrop() event).
1 (which specifies the number of pages to insert).
The Insert method inserts a copy of the Insert page before the Insert
Before page in the cur rent image file.
s
Invokes the InsertThumbs method of the Image Thumbnail
control, passing to it the:
Insert Before page number (from InsertBefore).
1 (which specifies the number of pages to insert).
The InsertThumbs method refreshes the control. As in the previous
section, were you to set a breakpoint after invoking this method,
youd see two copies of the Insert page in the Image Thumbnail con-
trol.
s
Deter mines the page number of the unwanted, leftover copy of the
image page (from the value of lngInsertPage) so it can be deleted
from the file.
If the unwanted page is after the Insert Before page, the procedure
increments lngInsertPage by one to delete the cor rect page.
s
Invokes the DeletePages method of the Image Admin control,
passing to it the:
Number of the page to delete (from lngInsertPage).
1 (which specifies the number of pages to delete).
The DeletePages method deletes the unwanted, leftover copy of
the image page from the file.
Not e: You must call t he Insert met hod of t he Image Admin cont rol
bef ore calling t he Insert Thumbs met hod of t he Image
Thumbnail cont rol.
Not e: You must call t he Delet ePages met hod of t he Image Admin
cont rol bef ore calling t he Delet eThumbs met hod of t he Image
Thumbnail cont rol.
Adding Imaging Using Act iveX Cont rols
153
s
Invokes the DeleteThumbs method of the Image Thumbnail
control, passing to it the:
Number of the page to delete (from lngInsertPage).
1 (which specifies the number of pages to delete).
The DeleteThumbs method refreshes the control without the
unwanted page.
Chapt er 4
154
2TKXCVG 5WD MFM+OI6JWODPCKNA6JWOD&TQR$[8CN +PUGTV$GHQTG #U .QPI A
$[8CN &TQR%QWPV #U .QPI $[8CN 5JKHV #U +PVGIGT)
&KO : #U +PVGIGT
&KO UVT0COG #U 5VTKPI
&KO NPI+PUGTV2CIG #U .QPI
'/QXG CNN UGNGEVGF RCIGU QT KPUGTV HTQO 'ZRNQTGT
(QT : - 0 6Q &TQR%QWPV 1
')GV VJG RCVJ CPF PCOG QH VJG HKNG EQPVCKPKPI VJG +PUGTV RCIG
strName - kdkImqThumbna1.ThumbDroNamesX)
')GV VJG +PUGTV RCIG
nqInsertPaqe - kdkImqThumbna1.ThumbDroPaqesX)

'%JGEM VQ UGG KH VJG +PUGTV RCIG KU VQ DG KPUGTVGF
'DGHQTG KVUGNH +H KV KU CDQTV RTQEGUUKPI
+H UVT0COG - MFM+OI6JWODPCKN+OCIG 6JGP
+H NPI+PUGTV2CIG - +PUGTV$GHQTG 1T NPI+PUGTV2CIG - +PUGTV$GHQTG 1 6JGP
'ZKV 5WD
'PF +H
'PF +H

'2NCEG VJG +PUGTV RCIG DGHQTG VJG +PUGTV $GHQTG RCIG KP VJG KOCIG HKNG
kdkImqAdm1nI.Insert strName. nqInsertPaqe. InsertBefore. I

'4GHTGUJ VJG +OCIG 6JWODPCKN EQPVTQN VQ FKURNC[ VJG TGQTFGTGF KOCIG HKNG
kdkImqThumbna1.InsertThumbs InsertBefore. I

'&GNGVG VJG NGHVQXGT RCIG
+H UVT0COG - MFM+OI6JWODPCKN+OCIG 6JGP
'+H VJG +PUGTV2CIG PWODGT KU ITGCVGT VJCP VJG +PUGTV $GHQTG
'PWODGT KPETGOGPV VJG NPI+PUGTV2CIG XCTKCDNG D[ 1 VQ UGV
'VJG CRRTQRTKCVG RCIG HQT FGNGVKQP
+H NPI+PUGTV2CIG +PUGTV$GHQTG 6JGP
NPI+PUGTV2CIG - NPI+PUGTV2CIG 1
'PF +H
'&GNGVG VJG NGHVQXGT RCIG HTQO VJG KOCIG HKNG CPF VJG +OCIG
'6JWODPCKN EQPVTQN
kdkImqAdm1nI.DeetePaqes nqInsertPaqe. I
kdkImqThumbna1.DeeteThumbs nqInsertPaqe. I
'PF +H
0GZV :
'PF 5WD
Adding Imaging Using Act iveX Cont rols
155
Delet ing Image Pages (Using Drag and Drop)
If necessary, start the Thumbnail Sorter project and select a multipage
image file.
Point to the thumbnail of an image page you want to delete. Then hold
down the left mouse button. The MouseDown() event procedure of the
Image Thumbnail control fires and invokes the Drag (extender) method
of Visual Basic, which starts the Drag operation.
Next, drag the thumbnail to the Image Thumbnail control resembling a
trash bin and release the left mouse button. The ThumbDrop() event
procedure of the Image Thumbnail (trash bin) control fires and perfor ms
the following actions for each selected page in the For...Next loop:
s
Gets the complete path and file name from the ThumbDropNames
property of the Image Thumbnail control for each image page being
deleted and assigns it to the strName local var iable.
s
Gets the Delete page number from the ThumbDropPages property
of the Image Thumbnail control for each image page being deleted
and assigns it to the lngDeletePage local var iable.
s
Makes sure that only pages from the current image file are deleted by
compar ing the value returned by the Image property of the source
Image Thumbnail control to the value retur ned by the
ThumbDropNames property of the destination Image Thumbnail
(trash bin) control (from strName). If the path and file name values
dont match, the event procedure is exited.
This action prevents using the Thumbnail Sorter to delete image files
from Windows Explorer.
You can select mult iple
t humbnails by holding dow n
t he Shif t or Ct rl keys.
2TKXCVG 5WD MFM+OI6JWODPCKNA/QWUG&QYP$[8CN $WVVQP #U +PVGIGT A
$[8CN 5JKHV #U +PVGIGT $[8CN : #U 5KPING $[8CN ; #U 5KPING A
$[8CN 6JWOD0WODGT #U .QPI)

'+PXQMG VJG &TCI QRGTCVKQP
kdkImqThumbna1.Draq
'PF 5WD
Not e: The DropCount argument of t he ThumbDrop() event provides
t he array-maximum value. Subt ract ing 1 f rom DropCount is
required because t he For...Next loop is 0-relat ive.
Chapt er 4
156
s
Invokes the DeletePages method of the Image Admin control,
passing to it the:
Number of the page to delete (from lngDeletePage-X).
1 (which specifies the number of pages to delete).
The DeletePages method deletes the image page from the file.
s
Invokes the DeleteThumbs method of the source Image Thumbnail
control, passing to it the:
Number of the page to delete (from lngDeletePage-X).
1 (which specifies the number of pages to delete).
The DeleteThumbs method refreshes the control without the
deleted page.
Subt ract ing t he Value of X
When calling the DeletePages and DeleteThumbs methods, the
procedure subtracts the value of counter X from the page number to
ensure that the proper page is deleted from the file and the control. The
necessity of this action becomes apparent when you have selected more
than one page for deletion.
For example, assume you delete pages two and three from a five- page file.
The first- page- to- delete value passed to both methods is 2
[(lngDeletePage = 2) minus (X = 0)]. The DeletePages method deletes
page 2 from the file and the DeleteThumbs method refreshes the
control without the deleted page.
The second- page- to- delete value passed to both methods is also 2
[(lngDeletePage = 3) minus (X = 1)]. Subtracting 1 from the
lngDeletePage value of 3 compensates for the page that was previously
deleted.
Not e: You must call t he Delet ePages met hod of t he Image Admin
cont rol bef ore calling t he Delet eThumbs met hod of t he Image
Thumbnail cont rol.
Adding Imaging Using Act iveX Cont rols
157
2TKXCVG 5WD MFM+OI6JWODPCKN6TCUJA6JWOD&TQR$[8CN +PUGTV$GHQTG #U .QPI A
$[8CN &TQR%QWPV #U .QPI $[8CN 5JKHV #U +PVGIGT)
&KO : #U +PVGIGT
&KO UVT0COG #U 5VTKPI
&KO NPI&GNGVG2CIG #U .QPI
'&GNGVG VJG UGNGEVGF RCIGU
(QT : - 0 6Q &TQR%QWPV 1
')GV VJG RCVJ CPF PCOG QH VJG HKNG EQPVCKPKPI VJG &GNGVG RCIG
strName - kdkImqThumbna1Trash.ThumbDroNamesX)
')GV VJG &GNGVG RCIG
nqDeetePaqe - kdkImqThumbna1Trash.ThumbDroPaqesX)

'+H RCIG FTQRRGF HTQO 'ZRNQTGT GZKV VJG RTQEGFWTG
+H strName <> kdkImqThumbna1.Imaqe 6JGP
'ZKV 5WD
'NUG
'&GNGVG VJG UGNGEVGF RCIG HTQO VJG KOCIG HKNG CPF
'VJG UQWTEG +OCIG 6JWODPCKN EQPVTQN
kdkImqAdm1nI.DeetePaqes nqDeetePaqe - X. I
kdkImqThumbna1.DeeteThumbs nqDeetePaqe - X. I
'PF +H
0GZV :
'PF 5WD T
Chapt er 4
158
Unloading a Mult ipage Image File
The Unload demonstration project shows how to save the individual
pages of a multipage image file as a ser ies of single- page files; in effect,
extracting or unloading the pages of a multipage image file. Before
walking through the demonstration project, read the following sections,
which explain the concept of multipage image files and descr ibe the
properties and methods that enable you to add page management and
manipulation functions to your applications.
R efer to Chapters 7 through 11 in this guide for more infor mation,
particularly with respect to file- type support across the var ious versions
of Imaging for Windows.
Mult ipage Image Files Def ined
Some image file types, such as BMP, can contain only one image page
per file.
Adding Imaging Using Act iveX Cont rols
159
Other file types, such as AWD and TIFF, can contain several image pages
per file.
The following table descr ibes the multipage support provided by the file
types that the Imaging software can read and read/ wr ite.
Mult ipage Support By File Type
File
Type
Support s Mult iple
Pages?
Read/Writ e
St at us
AWD
a
Yes R ead/ Wr ite
BMP No R ead/ Wr ite
DCX Yes R ead Only
GIF No R ead Only
JPG No R ead Only
PCX No R ead Only
TIFF Yes R ead/ Wr ite
WIFF Yes R ead Only
Chapt er 4
160
Page-Relat ed Propert ies and Met hods
The Imaging ActiveX controls have several properties and methods that
enable you to work with multipage image files either to create them
or perfor m some sort of Imaging action on their individual pages.
The following list br iefly descr ibes the properties and methods youll find
useful when working with multipage image documents. (R efer to
Chapters 7 through 11 in this guide for more specific information.)
Image Admin
PageCount property R eturns the number of pages in an image file.
PageNumber property R eturns or sets a page number in an image
file.
PageType property R eturns the page type also known as the
color type or data type of a specified page.
Append method Adds one or more pages to an image file.
DeletePages method Deletes a range of pages from an image file.
Replace method R eplaces one or more pages in an image file.
Image Edit
Page property R eturns or sets the page number of an image file
where an imaging action was or will be perfor med.
PageCount property R eturns the number of pages in the displayed
image file.
XIF Yes R ead Only
a. Not available on Windows NT systems
Mult ipage Support By File Type (cont inued)
File
Type
Support s Mult iple
Pages?
Read/Writ e
St at us
Not e: Because each t humbnail image represent s an image page, t he
Image Thumbnail cont rol in conjunct ion w it h t he Image
Admin cont rol is part icularly usef ul f or w orking w it h image
pages. (Ref er t o M anaging an Image File Using Thumbnails t o
see a sample applicat ion.)
Adding Imaging Using Act iveX Cont rols
161
PageType property R etur ns the page type of the image specified in
the Image property and the page specified in the Page property of the
Image Edit control.
ConvertPageType method Converts a displayed image page to a
specific page type.
SavePage method Saves the displayed image page to the path and
file name specified.
ShowPageProperties method Displays the Page Properties
dialog box, which enables users to view or modify the properties of the
displayed image page (color, compression, resolution, and size).
Image Scan
MultiPage property Deter mines whether multiple image pages will
be scanned to an image file.
Page property R eturns or sets the starting page for a scanning
session.
PageCount property R etur ns or sets the number of pages scanned
per image file. Works in conjunction with the MultiPage property to
deter mine how many pages are scanned to how many files. (R efer to the
PageCount and Multipage Property Influence table earlier in this
chapter for more infor mation.)
PageOption property R etur ns or sets whether a page will be
appended, inserted, or overwr itten dur ing a scanning session.
ShowScanPage method Displays the Scan Page dialog box, which
lets users scan a page into an image file.
Image Thumbnail
FirstSelectedThumb property R etur ns the page number of the
first selected thumbnail.
LastSelectedThumb property R eturns the page number of the last
selected thumbnail.
SelectedThumbCount property R etur ns the number of
thumbnails currently selected.
ThumbCount property R etur ns the total number of pages in the
current image file.
Chapt er 4
162
ThumbDropNames property R eturns the file name(s) of image
pages dropped on the Thumbnail control.
ThumbDropPages property R etur ns a list of pages for the file
name(s) dropped on the Thumbnail control.
ThumbSelected property R eturns or sets the selection status of a
specified thumbnail.
DeleteThumbs method R efreshes the Thumbnail control without
the image pages that have been deleted from an image file.
GetManualThumbPage method R eturns the page within the
image file corresponding to the thumbnail ar ray subscr ipt.
InsertThumbs method R efreshes the Thumbnail control with the
image pages that have been inserted into the current image file.
Example
Users of your application may want to unload a multipage image file
when the individual pages have no logical relationship to each other or
when the individual pages need to be routed to different people.
Scenario
As descr ibed in an earlier scenar io, Chr is regularly reviews large
multipage fax files as part of his job.
Sometimes Chr is encounters pages that contain memos, letters, or for ms
that are of interest to different people but have no relationship with the
remainder of the file.
Using your application, Chr is can quickly unload these pages and save
them to disk as individual image files or send them to the appropr iate
people via e- mail if you have included e- mail support in your
application.
Adding Imaging Using Act iveX Cont rols
163
Unload Project
The Unload project demonstrates unloading the pages of a multipage
image file and saving them to disk as a ser ies of single- page image files.
The project consists of one for m and the following controls:
s
One Image Admin control
s
One Image Edit control
s
Two Command button controls
s
One list box control
And it uses the following methods of the Image Admin control to
provide the unload functions:
Append To create the individual image files.
Delete To remove existing image files.
VerifyImage To see if an image file already exists.
Unloading an Image File
Start the Unload project. The Form_Activate() event procedure
displays an Open dialog box to let you select the TIFF image file you
want to unload. Be sure to select a multipage image file.
After you select the image file, the Unload for m appears.
The f ile name f o r t he Unload
project is Unload.vbp.
Chapt er 4
164
To unload the image file, click the Unload button. The
cmdUnload_Click() event procedure fires and executes its code.
The procedure begins by setting two local str ing var iables to the path and
file name of the multipage image file you selected (the source file). The
strSourceFile var iable will retain the path and file name throughout
the procedure. The strPrefix var iable will be gradually parsed until it
contains only the first three letters of the source image file name
becoming a prefix of the destination file names.
The procedure continues by obtaining the number of image pages in the
source file from the PageCount property of the Image Edit control,
assigning it to the intPageCount local var iable. It also obtains the
current path, assigning it to the strCurrentPath local var iable. It is
into this path that the individual destination file names will be wr itten.
Next, the procedure parses the strPrefix var iable until it consists of a
three- character prefix:
s
First, it gets r id of the path infor mation.
s
Second, it gets rid of all of the remaining characters including the
file extension, which is assigned to the strExt var iable for later use.
Before building the individual (Unloaded) file names, the procedure
appends a slash to the cur rent path var iable, strCurrentPath.
With all of these preliminar ies out of the way, the procedure is now ready
to build the Unloaded file names.
A For...Next statement executes for each page in the image file
starting at 1 and continuing until it exceeds the maximum number of
pages in the image file (from intPageCount).
For each iteration of the For...Next loop, the procedure concatenates the
following six items to build an Unloaded path and file name, which it
assigns to the strUnloadedFileName local var iable (the examples
assume a source path and file name of c:\Images\Faxes.tif):
1 Current path and slash (from strCurrentPath).
E x ample: c:\Images\
2 Three- character prefix (from strPrefix).
E x ample: c:\Images\Fax
3 Pag (a hard- coded preface to the page number).
E x ample: c:\Images\FaxPag.
4 Current page number (from strPageNum, which is the counter
value converted to a str ing).
Adding Imaging Using Act iveX Cont rols
165
E x ample: c:\Images\FaxPag1
5 . (the dot before the file extension).
E x ample: c:\Images\FaxPag1.
6 File extension (from strExt).
E x ample: c:\Images\FaxPag1.tif
Now that the complete path and file name exist for the unloaded page,
the procedure assigns the Unloaded path and file name (from
strUnloadedFileName) to the Image property of the Image Admin
control.
Next, the procedure invokes the VerifyImage method of the Image
Admin control to see if the Unloaded file already exists in the current
path. If it does, the procedure invokes the Delete method of the Image
Admin control to remove it.
The procedure invokes the Append method of the Image Admin
control to add the source page to the unloaded file, creating it
automatically.
Finally, the procedure adds the path and file name of the first Unloaded
image to the list box control and executes the next iteration in the
For...Next loop (the second Unloaded image).
The procedure invokes t he
Verif yImage met ho d w it h a
paramet er value of 0 (Verif y
Exist ence). Ot her paramet er
valu es let you check an image
f iles read/w rit e at t ribut es.
Chapt er 4
166
2TKXCVG 5WD EOF7PNQCFA%NKEM)
&KO KPV2CIG%QWPV #U +PVGIGT KPV2CIG0WODGT #U +PVGIGT
&KO KPV5NCUJ2QU #U +PVGIGT KPV&QV2QU #U +PVGIGT
&KO KPV8GTKH['ZKUVGPEG #U +PVGIGT
&KO UVT2TGHKZ #U 5VTKPI UVT%WTTGPV2CVJ #U 5VTKPI
&KO UVT5QWTEG(KNG #U 5VTKPI UVT7PNQCFGF(KNG0COG #U 5VTKPI
&KO UVT'ZV #U 5VTKPI UVT2CIG0WO #U 5VTKPI

')GV VJG RCVJ CPF HKNG PCOG QH VJG UQWTEG HKNG
strSourceF1e - kdkImqEd1tI.Imaqe
strPref1x - kdkImqEd1tI.Imaqe

')GV VJG PWODGT QH RCIGU KP VJG UQWTEG HKNG
1ntPaqeOount - kdkImqEd1tI.PaqeOount
')GV VJG EWTTGPV RCVJ
UVT%WTTGPV2CVJ - %WT&KT

''UVCDNKUJ CP CRRTQRTKCVG RTGHKZ HQT VJG 7PNQCFGF HKNG PCOGU
KPV5NCUJ2QU - 7
'(KTUV GNKOKPCVG VJG EJCTCEVGTU VQ VJG NGHV QH VJG UNCUJGU
&Q 9JKNG KPV5NCUJ2QU 0
KPV5NCUJ2QU - +P5VT1 UVT2TGHKZ > 1)
UVT2TGHKZ - 4KIJVUVT2TGHKZ .GPUVT2TGHKZ) KPV5NCUJ2QU)
.QQR
'5GEQPF GNKOKPCVG VJG EJCTCEVGTU VQ VJG TKIJV QH VJG FQV
KPV&QV2QU - +P5VT1 UVT2TGHKZ 1)
UVT'ZV - 4KIJVUVT2TGHKZ .GPUVT2TGHKZ) KPV&QV2QU)
+H KPV&QV2QU 4 6JGP
UVT2TGHKZ - .GHVUVT2TGHKZ o)
'NUG
UVT2TGHKZ - .GHVUVT2TGHKZ KPV&QV2QU 1)
'PF +H
'#RRGPF C UNCUJ VQ VJG EWTTGPV RCVJ URGEKHKECVKQP
KPV5NCUJ2QU - +P5VT1 UVT%WTTGPV2CVJ > 1)
+H KPV5NCUJ2QU .GPUVT%WTTGPV2CVJ) 6JGP
UVT%WTTGPV2CVJ - UVT%WTTGPV2CVJ >
'PF +H
%QPVKPWGF PGZV RCIG)
Adding Imaging Using Act iveX Cont rols
167
'$WKNF CPF RQRWNCVG QPG KOCIG HKNG HQT GCEJ QH VJG RCIGU KP VJG UQWTEG KOCIG
'HKNG
(QT KPV2CIG0WODGT - 1 6Q KPV2CIG%QWPV

')GV VJG EWTTGPV RCIG PWODGT
UVT2CIG0WO - 5VT!KPV2CIG0WODGT)
'$WKNF VJG 7PNQCFGF RCVJ CPF HKNG PCOG
UVT7PNQCFGF(KNG0COG - UVT%WTTGPV2CVJ UVT2TGHKZ 2CI UVT2CIG0WO A
UVT'ZV
'#UUKIP VJG 7PNQCFGF RCVJ CPF HKNG PCOG VQ VJG +OCIG RTQRGTV[
kdkImqAdm1nI.Imaqe - strUnoadedF1eName
KPV8GTKH['ZKUVGPEG - 0
'+H VJG 7PNQCFGF HKNG GZKUVU FGNGVG KV
+H kdkImqAdm1nI.Ver1fyImaqe1ntVer1fyEx1stence) - True 6JGP
kdkImqAdm1nI.Deete strUnoadedF1eName
'PF +H

'2QRWNCVG VJG 7PNQCFGF KOCIG HKNG
kdkImqAdm1nI.Aend strSourceF1e. 1ntPaqeNumber. I

'#FF VJG PGY KOCIG RCVJ CPF HKNG PCOG VQ VJG NKUV DQZ EQPVTQN
NUV(KNGU#FF+VGO UVT7PNQCFGF(KNG0COG

0GZV KPV2CIG0WODGT
'PF 5WD
I
5
Developing Client -Server Applicat ions
This chapter explains how to use the Imaging ActiveX controls to
develop applications that can access and interact with E astman S oftware
Imaging 1.x and Imaging 3.x servers.
It also explains how to add zoom and annotation functions to your
applications. Even if you are not going to include Imaging server access
in your applications, youll find the sections on these functions useful.
In This Chapt er
Imaging Server Concept s ........................................................... 170
Imaging 1.x Server Programming Considerat ions ....................... 173
Imaging 3.x Server Programming Considerat ions ....................... 189
Demonst rat ion Project ............................................................... 192
Chapt er 5
170
Imaging Server Concept s
This sect ion explains t he
basic concept s of Imaging 1.x
and Imaging 3.x server
access.
Developing applications that can access and interact with E astman
S oftware Imaging 1.x and Imaging 3.x servers is possible with the Imaging
ActiveX controls. Using the controls, you can enable your users to:
s
R ead and display image files and server documents from Imaging 1.x
servers.
s
Wr ite image files and server documents to Imaging 1.x servers.
s
R ead and display server documents from Imaging 3.x servers.
s
Save 1.x image files and server documents and 3.x server documents
to local and network dr ives.
Before getting into the specifics, read the following sections that:
s
List the file types supported by each Imaging server.
s
Descr ibe the standard, server- related dialog boxes available with the
Imaging ActiveX controls.
s
Explain the difference between image files and server documents.
s
Descr ibe how your program can interact with each Imaging server.
Not e: Imaging Server Access is available w it h Imaging f or Window s
Prof essional Edit ion V1.1 and great er.
To use t he Imaging Act iveX cont rols w it h Imaging servers, you
and your users must inst all and conf igure Imaging Server Access
w hen inst alling Imaging f or Window s Prof essional Edit ion.
Not e: Because a w ide-ranging discussion of each Imaging server is
beyond t he scope of t his chapt er, East man Sof t w are, Inc.
recommends t hat you also review t he document at ion t hat came
w it h t he server you and your users use.
Developing Client -Server Applicat ions
171
File Type Support
The Imaging 1.x and Imaging 3.x servers support the file types descr ibed
in the following table.
St andard Dialog Boxes
Several methods in the Image Admin control display server- related dialog
boxes to your end users. These dialog boxes enable your users to:
s
Log onto the desired server either Imaging 1.x or Imaging 3.x.
s
Set Imaging 1.x server options.
s
Browse for Imaging 1.x file and document volumes.
s
Browse the Imaging 1.x file and document volumes for files and
documents to open.
s
Query Imaging 1.x document volumes by document name, location,
creation date, modification date, or keywords to locate documents to
open.
s
Query Imaging 3.x servers by document name or field values to
locate documents to open.
s
Save 1.x image files and server documents and 3.x server documents
to an Imaging 1.x file volume, an Imaging 1.x document volume, or
a local or network dr ive.
Imaging Server File Types
Server File Types Support ed
Imaging 1.x TIFF 6.0
BMP
DCX (read only)
GIF (read only)
JPG (read only)
PCX (read only)
WIFF (read only)
XIF (read only)
Imaging 3.x TIFF 4.0 (black and white only)
Chapt er 5
172
Image Files and Server Document s
An Image file is simply a binary file that contains one or more images. You
or your users can use operating system commands to save, organize, copy,
rename, delete, and otherwise operate on files of this type.
A S erver document is a collection of related images, logically organized as
pages within the document. The Imaging software stores the actual
images as image files; a server document simply contains references or
pointers to the location and name of each associated image page.
Int eract ing wit h Imaging 1.x Servers
When interacting with Imaging 1.x servers, your program can read
images from and wr ite images to image file or document volumes.
Image File Volume
Otherwise known as a file repository, a file volume is the location where
the actual image files are stored.
Your program can process image files in the file repository directly, using
a file specification. File specifications consist of a server name, volume
name, one or more directory names (optional), and a file name in the
following for mat:
Image://server/file volume:/directory/filename.tif
Document Volume
For merly known as a document manager database, a document volume is
where server documents are stored. A document volume does not
contain the actual image files, only references to the files in the file
repository.
Server documents are stored using a familiar hierarchy. Documents are
stored within a Folder; Folders are stored within a Drawer; and Drawers
are stored within a Cabinet; using the following for mat:
Image://server/doc volume:\cabinet\drawer\folder\doc
Developing Client -Server Applicat ions
173
Int eract ing wit h Imaging 3.x Servers
When interacting with Imaging 3.x servers, your program can read
documents from Imaging 3.x servers.
Users cannot edit these documents unless they save them on their local
or network dr ives first or on an Imaging 1.x server if one is available to
them.
Imaging 3.x servers store documents using a flat syntax that consists of a
prefix and document name; for example, Imagex://claim234.
Imaging 1.x Server Programming Considerat ions
This sect ion describes t he
Imaging 1.x f unct ions
provided by t he Imaging
Act iveX cont rols.
Several properties and methods in the Imaging ActiveX controls let you
provide Imaging 1.x server access functions to your end users.
Specifically, they per mit your users to:
s
Log onto the server.
s
Set server options.
s
Browse for Imaging 1.x file and document volumes.
s
Browse the Imaging 1.x file and document volumes for files and
documents to open.
s
Query Imaging 1.x document volumes by document name, location,
creation date, modification date, or keywords to locate documents to
open.
s
Save 1.x image files and server documents to Imaging 1.x file or
document volumes or to local or network dr ives.
The following sections descr ibe each function in detail by pointing out
the properties and methods you can use.
Logging Ont o t he Server
Before users can interact with an Imaging 1.x server, they must log onto
it. The Image Admin control provides a LoginToServer method that
lets you programmatically log your users onto an Imaging 1.x server.
In your call to the LoginToServer method, you can optionally display
the standard Server Login dialog box, which per mits users to enter
their user name and password and then click OK to log onto the server.
Chapt er 5
174
The Username text box can accommodate up to 20 alphanumer ic
characters; the Password text box can contain up to 36 alphanumeric
characters.
You can also bypass the dialog box and simply pass the user name and
password as parameters to the LoginToServer method, most likely in
response to a user completing and closing a logon dialog box of your own
design.
If a user is not logged on and attempts to access the server, the Imaging
software displays the standard Server Login dialog box automatically
thereby prompting the user to log onto the server.
Set t ing Imaging Server Opt ions
Setting server options is a task that users should perfor m after they install
your program and whenever necessary thereafter.
You, or your users, should specify:
s
The path to the 1.x file repository, where your program stores new or
copied image files that compr ise server documents.
s
Whether to force lower- case path and file names.
s
Whether to link server documents to the or iginal image files or to
copies of the or iginal files.
s
Whether to delete image files that were linked to deleted server
document pages.
The Image Admin control provides a Show1xServerOptDlg method
that lets you display the standard Imaging Server Options dialog box
to your end users. The dialog box lets them set server options.
The Image Admin con t ro l also
provides a LogOf f Server
met hod t hat let s you pro gram-
mat ically log your users of f an
Imaging 1.x server.
Developing Client -Server Applicat ions
175
When users click OK on the Imaging Server Options dialog box, the
Image Adman control sets several of its server- related properties to values
that cor respond to the selections made on the dialog box. The following
table lists the properties set.
Imaging 1.x Server-Relat ed Propert ies Set By t he Server
Opt ions Dialog Box
Image Admin
Propert y
Set
Associat ed Field
on Dialog Box
Value
Propert y
Cont ains
FileStgLoc1x File location for
document pages
text box
The path to the file
repository, where
your program stores
new or copied image
files that compr ise
server documents.
ForceLowerCase1x Force lower-case
file names check
box
True or False
Indicating whether
paths and file
names are con-
verted to lower case
before being passed
to the Imaging 1.x
server.
Chapt er 5
176
If desired, you can set these properties in advance to present default
dialog box settings to your users.
You can also bypass the standard dialog box and set these properties
within your code most likely in response to a user completing and
closing a server options dialog box of your own design.
ForceFileLinking1x Link files on
reference check
box
True or False
Indicating whether
pages being added
to an Imaging 1.x
server document
from an ex isting 1 . x
image file are linked
(True) or copied
(False) by reference.
ForceFileDeletion1x Delete files with
pages check box
True or False
Indicating whether
the file referenced
by an Imaging 1x
server document
page is deleted
when the docu-
ment page is
deleted.
Imaging 1.x Server-Relat ed Propert ies Set By t he Server
Opt ions Dialog Box (cont inued)
Image Admin
Propert y
Set
Associat ed Field
on Dialog Box
Value
Propert y
Cont ains
Developing Client -Server Applicat ions
177
The following sections explain each server option setting and related
property in detail.
File Locat ion f or Document Pages
(FileSt gLoc1x Propert y)
When your program saves a server document page, it may have to create a
file that contains the actual image. Such files must reside somewhere on
an Imaging 1.x server and only your users know exactly where that
should be. As a result, you need to let your users enter the location where
your program stores these files.
The FileStgLoc1x property of the Image Admin control contains the
location where your program stores the new image files. You can set this
property yourself in response to user input or you can have users set it via
the Imaging Server Options dialog box.
Depending on how you code your program, the following methods use
this location to save images: the SaveAs and SavePage methods of the
Image Edit control; the SaveAs method of the Image Thumbnail
control; and the Append, Replace, and Insert methods of the Image
Not e: Updat e List of Server Volumes
There are no propert ies or met hods associat ed w it h t he Updat e
list of server volumes aut omat ically check box or t he
Updat e Now but t on on t he Server Opt ions dialog box. Bot h
invoke a f acilit y t hat updat es t he list of server volumes in t he
current domain. Users can access t his list by clicking t he Brow se
but t on on t he dialog box. They use t he list t o locat e and ent er
t he desired f ile locat ion f or document pages.
Hide Server File Volumes
Likew ise, t here are no propert ies or met hods associat ed w it h t he
Hide server volume f iles check box. This check box specif ies
w het her Imaging 1.x server f ile volumes are displayed or hidden
on t he Open dialog box, w hich you can display by invoking t he
Show FileDialog met hod of t he Image Admin cont rol.
Hiding server f ile volumes is usef ul w hen users only w ant t o
brow se server document volumes.
Invoke t he Show 1xServerOpt Dlg met hod if you w ant t o pro-
vide t he Updat e List of Server Volumes f unct ion and t he
Hide Server File Volumes f unct ion t o your end users.
Chapt er 5
178
Admin control. Each of these methods creates a new image file with a
unique file name in the following situations:
s
When a page from a local or redirected file is being inserted,
appended, or saved to an Imaging 1.x server document.
s
When the ForceFileLinking1x property is set to False and a page
from an Imaging 1.x image file or server document is being inserted,
appended, replaced, or saved in another Imaging 1.x server
document.
Force Lower-Case File Names
(ForceLowerCase1x Propert y)
Older Imaging 1.x 16- bit clients have traditionally converted path and
file names to lower- case when communicating with the Imaging 1.x file
system.
To maintain backward compatibility with the 16- bit clients and to ensure
that Imaging for Windows clients can access Imaging 1.x file repositor ies
created by the 16- bit clients, Imaging for Windows includes a facility
that perfor ms this conversion.
The ForceLowerCase1x property of the Image Admin control
deter mines whether your program converts path and file names to lower-
case when communicating with the Imaging 1.x file system. You can set
this property yourself in response to user input or you can have users set
it via the Imaging Server Options dialog box.
When the ForceLowerCase1x property is set to True, case conversion
occurs. When set to False, no case conversion occurs.
Link Files On Ref erence
(ForceFileLinking1x Propert y)
As stated earlier, an Imaging 1.x server document is basically a list of
references to the files that contain the actual images.
Certain operations, such as that perfor med by the Append method of
the Image Admin control, allow your program to add pages to an
Imaging 1.x server document.
Not e: You or your users should set t he ForceLow erCase1x propert y
t o False unless you or t hey have specif ic compat ibilit y problems
w it h older document volumes (document manager dat abases).
Developing Client -Server Applicat ions
179
There are two different ways to add such a page:
s
Linking the document directly to the actual image file, as long as the
file resides in a 1.x file volume (link on reference).
s
Copying the page to another image file and then linking the
document to the copied image file (copy on reference).
The ForceFileLinking1x property of the Image Admin control
deter mines how pages being added to an Imaging 1.x server document
are referenced. You can set this property yourself in response to user
input or you can have users set it via the Imaging Server Options
dialog box.
Then to add pages to a 1.x server document, use one of the following:
the Append, Replace, or Insert method of the Image Admin control;
the SaveAs or SavePages method of the Image Edit control; or the
SaveAs method of the Image Thumbnail control.
When you do, the value of the ForceFileLinking1x property and where
the source image file resides deter mine the behavior of the Imaging
software, as follows:
s
When the ForceFileLinking1x property is set to True and the
source image file resides on an Imaging 1.x server, the Imaging
software links the document to the source image file where the file
resides on the server.
s
When the ForceFileLinking1x property is set to False and the
source image file resides on an Imaging 1.x server, the Imaging
software copies the image file to the location specified within the
FileStgLoc1x property. Then it links the document to the copied
file.
s
R egardless of the setting of the ForceFileLinking1x property, when
the source image file resides outside of an Imaging 1.x server (for
example, on a local or redirected dr ive), the Imaging software copies
the image file to the location specified within the FileStgLoc1x
property. Then it links the document to the copied file.
s
When the SaveAs or SavePage method is used to save changes to an
existing 1.x server document page, the Imaging software replaces the
or iginal file page regardless of the setting of the ForceFileLinking1x
property (unless the or iginal file is wr ite- protected).
Chapt er 5
180
Delet e Files Wit h Pages
(ForceFileDelet ion1x Propert y)
When users delete a page from an Imaging 1.x server document, they
may also want to delete the linked image file.
The ForceFileDeletion1x property of the Image Admin control
deter mines whether the Imaging software deletes the file referenced by a
deleted Imaging 1x server document page. You can set this property
yourself in response to user input or you can have users set it via the
Imaging Server Options dialog box. The Delete or DeletePages
method of the Image Admin control perfor ms the actual deletion.
When set to True, the Imaging software deletes the source file linked to
an Imaging 1.x server document when a user deletes the cor responding
document page.
When set to False, the Imaging software does not delete the linked
source file when a user deletes the corresponding document page.
Ref erent ial Int egrit y Behavior
The Imaging software ignores the True setting of the ForceFile
Linking1x property when two or more pages of a server document are
linked to the same image file and not all of these pages have been deleted
from the document. The Imaging software does not delete the linked
image file because one or more pages in the document are still linked to
the file.
Example
Assume a server document named Claims contains 5 pages and that
pages 1 and 4 in the document are linked to the autoclaims.tif
image file.
Assume you delete page 1 of Claims.
Even though the ForceFileDeletion1x property is set to True, the
Imaging software does not delete autoclaims.tif. Why? Because the
file contains the image that is still linked to page 4 of the Claims
document.
Not e: Keep in mind t hat t he ref erent ial int egrit y behavior of t he
ForceFileDelet ion1x propert y provides prot ect ion against
inadvert ent ly delet ing image f iles t hat are ref erenced wit hin t he
same document only. It provides no prot ect ion against delet ing
image f iles t hat are ref erenced wit hin t wo or more document s.
Developing Client -Server Applicat ions
181
Browsing f or Volumes or Image Files and Server Document s
The Image Admin control provides two ways to browse Imaging 1.x
servers. Using them, you can let your users:
s
Browse the server for image file or server document volumes, or
s
Browse the server for image files and/ or server documents.
Browsing f or Volumes
The Browse1x method of the Image Admin control displays a dialog
box that lets your users browse the Imaging 1.x server for the file and/ or
document volumes they want.
Use this method whenever you want users to select a desired volume for
a particular pur pose in your program. A good example of using this
method exists on the Server Options dialog box, which is descr ibed in
the previous section. After users click the Browse button, they can use
the Browse 1.x dialog box to navigate to and then select the location
where they want new image files to be stored.
Chapt er 5
182
In your call to the Browse1x method, you can specify:
s
Whether to browse:
File volumes By passing the BrowseFiles constant or a literal
value of 0.
Document volumes By passing the BrowseDocuments
constant or a literal value of 1.
Both file and document volumes By passing the
BrowseBoth constant or a literal value of 2.
s
A str ing that becomes the title bar caption of the dialog box (for
example, Browse Imaging 1.x Server in the preceding figure).
s
Another str ing that instructs the user to browse the server (for
example, Select the desired path in the preceding figure).
s
The handle to the parent window (optional).
After users make their selection and click OK, the Imaging software
wr ites the path selected to the Browse1xReturnedPath property of the
Image Admin control.
The Imaging software also wr ites the type of volume selected to the
Browse1xReturnedPathType property, which can contain one of the
following integer values:
0 To indicate that users selected a file volume.
1 To indicate that users selected a document volume.
Browsing f or Files and Document s
As you know from Chapter 4, the ShowFileDialog method of the
Image Admin control displays an Open dialog box that lets users browse
for and then select (open) the image file they want to display.
When you install Imaging 1.x Server Access, the Imaging software alters
the Open dialog box slightly by adding a Look for list box that lets users
select for browsing and display:
Desktop Files The image files stored on local or network dr ives.
1.x Files and Documents The image files or server documents
stored on Imaging 1.x servers.
Invoke the ShowFileDialog method, therefore, whenever you want
users to browse for and then select an Imaging 1.x file or server
document they want to display.
Keep in mind t hat t he Get
VolumeType met hod of t he
Image Admin cont rol let s you
det ermine w het her a specif ied
Imaging 1.x volume is a f ile
volume or a document volume.
The Look f or list box also
cont ains a 3.x Document s
select ion. When clicked, a
message appears inst ruct ing
users t o click t he Find but t on
t o perf or m a query.
Developing Client -Server Applicat ions
183
When users select 1.x Files and Documents from the Look for list box,
they can use the Look in list box to browse the file and document
volumes in the cur rent domain, as illustrated in the following figure2
Chapt er 5
184
Once users select the desired directory or folder, the area below the
Look in box lists the files or documents contained within it, as illustrated
in the following figure.
When users select the desired file or document and then click Open, the
Imaging software wr ites the path and name of the file or document to
the Image property of the Image Admin control.
Use the Image property and the Display method of the Image Edit
control and/ or the Image property and the DisplayThumbs method of
the Image Thumbnail control to display the image file or document.
R efer to Chapters 4, 8, and 11 for more infor mation about displaying
images and thumbnails as well as for more infor mation about the
ShowFileDialog method.
Developing Client -Server Applicat ions
185
Querying f or 1.x Server Document s
The ShowFindDialog method of the Image Admin control displays a
dialog box that enables users to query Imaging 1.x document volumes
for the documents they want.
Pr ior to your call to the ShowFindDialog method, you can set the
Init1xFindDir property of the Image Admin control to the name of the
document volume you want to initially display in the Look in list box (as
a default). If desired, you can also include a cabinet; cabinet and drawer;
or cabinet, drawer, and folder.
In your call to the ShowFindDialog method, you can specify the
handle to the parent window. Doing so sets the state of the dialog box to
application-modal; not doing so sets the state of the dialog box to modeless.
Clicking t he Find but t o n on
t he Open dialog box
(described in t he previous
sect ion) also displays t h e Find
Image Document dialog box.
Not e: Ref er t o t he East man Sof t ware Imaging f or Windows
Prof essional Edit ion Get t ing St art ed Guide f or inst ruct ions on
how t o use t he Find Image Document dialog box t o f ind
Imaging 1.x server document s.
Chapt er 5
186
After users make their selection and click Open, the Imaging software
wr ites the path and name of the document to the Image property of the
Image Admin control.
Use the Image property and the Display method of the Image Edit
control and/ or the Image property and the DisplayThumbs method of
the Image Thumbnail control to display the Imaging 1.x server
document.
R efer to Chapters 4, 8, and 11 for more infor mation about displaying
images and thumbnails and for more infor mation about the
ShowFindDialog method.
Saving 1.x Image Files and Server Document s
As you know, the ShowFileDialog method of the Image Admin control
also displays a dialog box that lets users enter the path and name for the
image files they want to save.
When you install Imaging 1.x Server Access, the Imaging software alters
the SaveAs dialog box slightly by adding a Look for list box that lets
users select for saving:
Desktop Files Image files on their PCs.
1.x Files and Documents Image files or server documents on
Imaging 1.x servers.
The ImgQuery and
ImgQueryEnd met hods of t he
Image Admin cont rol enable
you t o query a 1.x document
volume prog rammat ically. The
Demonst rat ion Pro ject
sect ion of t his chapt er
describes and demonst r at es
t hese met hods.
Not e: The Imaging sof t w are does not alt er t he value of t he
Init 1xFindDir propert y.
Developing Client -Server Applicat ions
187
When users select 1.x Files and Documents, they can use the Look in
list box to browse file and document volumes in the cur rent domain, as
illustrated in the following figure.
Chapt er 5
188
Once users select the desired directory or folder, the area below the
Look in box lists the files or documents contained within it, as illustrated
in the following figure.
When users select or enter the name of the file or document and then
click Save, the Imaging software wr ites the path and name of the file or
document to the Image property of the Image Admin control.
Use the Image property and the SaveAs or SavePage method of the
Image Edit control to save the image file or server document.
R efer to Chapter 8 for more infor mation about saving images and the
ShowFileDialog method.I
Developing Client -Server Applicat ions
189
Imaging 3.x Server Programming Considerat ions
This sect ion describes t he
Imaging 3.x f unct ions t hat
are provided by t he Imaging
Act iveX cont rols.
Several properties and methods in the Imaging ActiveX controls let you
provide Imaging 3.x server access functions to your end users.
Specifically, they per mit your users to:
s
Log onto the server.
s
Query Imaging 3.x servers by document name as well as by Class and
Index field values.
The following sections descr ibe each function in detail by pointing out
the properties and methods you can use.
Logging Ont o t he Server
Before users can interact with an Imaging 3.x server, they must log onto
it. The Image Admin control provides a LoginToServer method that
lets you programmatically log your users onto the Imaging 3.x server
specified in the Domain property.
In your call to the LoginToServer method, you can optionally display
the standard Server Login dialog box, which per mits users to enter
their user name, password, and desired domain and then click OK to log
onto the server.
The Username, Password, and Domain text boxes can contain up to
80 alphanumer ic characters.
The Domain propert y is
init ialized t o eit her an empt y
st ring o r t he name of t he
Imaging 3.x server last
accessed.
Chapt er 5
190
You can also bypass the dialog box and simply pass the user name and
password as parameters to the LoginToServer method, most likely in
response to a user completing and closing a logon dialog box of your own
design.
If a user is not logged on and attempts to access the server, the Imaging
software displays the standard Server Login dialog box automatically
thereby prompting the user to log onto the server.
Querying 3.x Server document s
The ShowFindDialog method of the Image Admin control displays a
dialog box that enables users to query an Imaging 3.x server for the
documents they want.
In your call to the ShowFindDialog method, you can specify the
handle to the parent window. Doing so sets the state of the dialog box to
application-modal; not doing so sets the state of the dialog box to modeless.
The Image Admin con t ro l also
provides a LogOf f Server
met hod t hat let s you pro gram-
mat ically log your users of f an
Imaging 3.x server.
Not e: If t he unif ied logon f acilit y is enabled on t he Imaging 3.x server
being accessed, t here is no need t o explicit ly call t he
LoginToServer met hod. Each user w ill be logged on
aut omat ically using t he Window s user name and passw ord.
If users at t empt t o access
Imaging 3.x document s via t he
Open dialog box, t he Imaging
sof t w are prompt s t hem t o click
t he Find but t on t o access t he
Find Image Document dialog
box.
Not e: Ref er t o t he East man Sof t ware Imaging f or Windows
Prof essional Edit ion Get t ing St art ed Guide f or inst ruct ions on
how t o use t he Find Image Document dialog box t o f ind
Imaging 3.x server document s.
Developing Client -Server Applicat ions
191
After users make their selection and click Open, the Imaging software
wr ites the path and name of the document to the Image property of the
Image Admin control.
Use the Image property and the Display method of the Image Edit
control and/ or the Image property and the DisplayThumbs method of
the Image Thumbnail control to display the Imaging 3.x server
document.
R efer to Chapters 4, 8, and 11 for more infor mation about displaying
images and thumbnails and for more infor mation about the
ShowFindDialog method.
The ImgQuery and
ImgQueryEnd met hods of t he
Image Admin cont rol enable
you t o query a 3. x server
programmat ically. The
Demonst rat ion Project
sect ion of t his chapt er
describes and demonst r at es
t hese met hods.
Chapt er 5
192
Demonst rat ion Project
This sect ion demonst rat es
how t o add Imaging 1.x
server access f unct ions t o
your image-enabled
applicat ions.
While a wide-ranging
discussion of Imaging server
access f unct ions is beyond
t he scope of t his chapt er, t he
inf ormat ion present ed here
is suf f icient t o get st art ed.
The demonst rat ion project
was developed using
Microsof t Visual Basic,
Version 5.0.
Even if you are not going t o
include Imaging server
access in your applicat ions,
youll f ind t he sect ions on
adding zoom and
annot at ion f unct ions usef ul.
To help you use the Imaging ActiveX controls to interact with Imaging
1.x servers, Eastman Software, Inc. has prepared a demonstration project
called Image Server that shows you how to:
s
Set server options.
s
Browse for Imaging 1.x file and document volumes.
s
Browse Imaging 1.x file and document volumes for files and
documents to open.
s
Query Imaging 1.x document volumes to locate documents to open.
s
Zoom an image.
s
Invoke the standard annotation tool palette.
s
Show and hide annotations.
Before walking through the demonstration project, read the following
sections, which explain the concepts of zooming an image and of
working with annotations. Chapter 4 of this guide explains the concepts
of displaying an image in the Image Edit control and of multipage image
files.
Zooming an Image Def ined
Zoom options affect the way images appear in an Image Edit control.
You can zoom an entire image page or just a portion of an image page.
Zooming an Ent ire Image Page
The Zoom property of the Image Edit control lets you set usually in
response to user input the zoom factor that is applied to image pages
when they're displayed or refreshed. The property supports a range of
zoom factors from 2 to 6500 percent.
Not e: The on-line help syst em and Chapt ers 7 t hrough 11 of t his guide
ident if y t he propert ies, met hods, event s, paramet ers, and
const ant s t hat are available in each version of Imaging f or
Window s.
Keep in mind t hat Imaging 1.x server access is available t o users
of Imaging f or Window s Prof essional Edit ion Version 1.1 and
great er.
You can provide your users
w it h even mo re cont rol over a
displayed image by using t he
Fit To met hod of t he Image
Edit cont rol in addit ion t o t he
Zoom propert y. (Ref er t o
Chapt er 4 f or more
inf ormat ion.)
Developing Client -Server Applicat ions
193
After you set the Zoom property, invoke the Display method or
Refresh method of the Image Edit control (as appropr iate) to display
the image at the new zoom factor.
Most image application developers make zoom functions available to
their end users. These functions let users maximize or minimize the
image page so it can be seen more clearly, which is particularly important
when users will be reading scanned documents or faxes.
Zooming a Port ion of an Image Page
The SelectionRectangle property and the ZoomToSelection method
of the Image Edit control let you provide your users with a zoom- to-
selection function. The zoom- to- selection function enables them to
zoom a selected portion of an image page rather than the entire image
page.
After you set the SelectionRectangle property to True, users can draw
a selection rectangle on the portion of an image page they want to zoom.
Then usually in response to users clicking a menu item you invoke
the ZoomToSelection method.
The ZoomToSelection method scales the selected portion of the image
so it fits into the current size of the Image Edit control. Then it updates
the Zoom property with the zoom factor it applied.
Example
Users of your application may want control over the display of image
documents to make them easy to read.
Scenario
As descr ibed in Chapter 4, Eileen receives several scanned business
documents in her role as product manager for a major computer
company.
Because the documents contain important infor mation, she really needs
to be able to read them, which is why you included all of Image Edits
fit- to options in the first version of your application.
But now you realize that users like Eileen need even more control over
how image files or documents are displayed. So, in the second version of
your application, you include a wide range of zoom options in addition
to the fit- to options provided earlier. Users can now select the fit- to or
zoom option that produces the best display quality.
Chapt er 5
194
Annot at ions Def ined
The Image Edit and Image Annotation Tool Button controls provide
several ways to add annotation functions to your image- enabled
applications. Using them you can:
s
Create an annotation tool palette of your own design.
s
Invoke a single method that displays a fully- functional, standard
annotation tool palette to your users.
s
Implement custom annotations programmatically.
The method you choose depends on the annotation requirements of
your users.
Annotations are digitized versions of the marks or items commonly
applied to paper- based documents; for example, highlighting, rubber
stamps, lines, and post- it notes. People typically use annotations to
emphasize important portions of documents or to add their comments to
documents being circulated for review.
Digital annotations go well beyond the capabilities of paper- based
annotations. With digital annotations, users can:
s
Add, move, and delete annotations at will.
s
Modify their attr ibutes such as color, size, text, and visibility.
s
Use them to add hypertext links to other pages in the same file, to
other files, and to pages on the World Wide Web.
The following table lists the annotation types that are available with the
Imaging ActiveX controls.
Imaging f or Windows Annot at ion Types
Example Annot at ion Type
Freehand Line Draws a free-
hand line on a portion of an
image for emphasis
Straight Line Underlines
text, demarcates a section of a
page, or draws callout lines on an
image
Developing Client -Server Applicat ions
195
Filled Rectangle Covers a
portion of an image (may be used
to redact an image; that is, to
per manently cover the parts of an
image that you don't want other
people to see)
Hollow Rectangle Places a
border around areas of an image
for emphasis
Image Embedded Embeds a
copy of another image (the tool
button in the example) onto the
displayed image
Image Reference Places
another image onto the displayed
image by reference (the image
annotation is not a copy, it is a
linked reference to an external
file)
Text Enters text directly onto
an image (the directive from
Geoff in the example)
Text From File Enters text
from a file onto an image
Text Stamp Places a rubber
stamp text annotation directly
onto an image (the Approved
7/ 22/ 98 stamp in the example)
Imaging f or Windows Annot at ion Types (cont inued)
Example Annot at ion Type
Chapt er 5
196
Users can save annotations separately from the image data within TIFF
image files only.
Attach-a-Note Enters text
onto a Filled R ectangle annota-
tion and then places it onto an
image (the note from Kim in the
example)
Hyperlink Enters a hypertext
link directly onto an image;
invokes the Link To dialog box,
which lets users specify the
desired destination (an image
page or Web page as in the
example)
OCR Zone Draws an OCR
Text or Picture zone on an
image. When drawn, the OCR
engine recognizes only the area
indicated by Text zones (1 in the
example) and retains only those
graphics indicated by Picture
zones (2 in the example).
Select Annotations Selects
existing annotation marks for
copying, deleting, modifying,
moving, or resizing (the dotted
line sur rounding the Attach- a-
Note annotation in the example)
Imaging f or Windows Annot at ion Types (cont inued)
Example Annot at ion Type
Developing Client -Server Applicat ions
197
Users can also merge annotations 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.
Image Annot at ion Tool But t on Cont rol
The Image Annotation Tool Button control lets you create a custom
annotation tool bar or palette. Each control is actually a button that
invokes an annotation type when your end user clicks it.
Your custom annotation tool bar or palette can contain buttons that
provide:
s
Discrete annotation types; for example, a Freehand Line annotation
type and a R ubber Stamp annotation type.
s
The same annotation type with different annotation styles; for
example, two buttons that each invoke an Attach- a- Note annotation
one with a yellow background and black text, the other with
a red background and white text.
s
A combination of both.
The Image Edit control shares several properties and one method with
the Image Annotation Tool Button control. Together they let you
manage annotation functions when creating a tool bar or palette of your
own design. R efer to the next section for more infor mation.
Image Edit Cont rol
The Image Edit control has a fully- functional, standard annotation
tool palette as well as several properties, methods, and events that let
you provide a wide range of annotation functions to your end users.
When using a Filled Rect angle
annot at ion t o redact imag es,
make sure t hat your users
select t he o paque f ill st yle and
t hat t hey bur n- in t he anno -
t at ion t o cover t he image
permanent ly.
Not e: Hyperlink and OCR Zone annot at ions are available w it h Imaging
f or Window s Prof essional Edit ion.
Chapt er 5
198
St andard Annot at ion Tool Palet t e
You can invoke the ShowAnnotationToolPalette method to display
the standard annotation tool palette to your users. The following
illustration lists the annotation types the tool palette provides.
Once displayed, users can r ight- click a button on the tool palette to set
an annotations properties. Then they can left- click the button to draw
the annotation.
Programmat ic Annot at ions
The Image Edit control also has an array of properties, methods, and
events that enable you to add annotation functions to your applications
programmatically. The properties, methods, and events also let you and
your users edit and manage existing annotations whether they were
drawn programmatically, drawn using the Image Annotation Tool Button
control, or drawn using the standard annotation tool palette.
The remainder of this section br iefly descr ibes the properties, methods,
and events of the Image Edit and Image Annotation Tool Button controls
youll find useful when adding annotation functions to your applications.
(R efer to Chapters 7 through 11 in this guide for more infor mation
particularly with respect to the properties, methods, events, and
annotation types that are available with the version of Imaging for
Windows you and your users are running.)
Not e: The Highlight er annot at ion is act ually a Filled Rect angle
annot at ion w it h it s t ransparent propert y select ed and it s
background color propert y set t o yellow.
Hyperlink
Highlight er
Text From File
Text
Hollow Rect angle
Rubber St amp
At t ach-a-Not e
Filled Rect angle
St raight Line
Freehand Line
Select Annot at ions and Zones
Developing Client -Server Applicat ions
199
Propert ies, Met hods, and Event s of Bot h t he Image Edit
Cont rol and t he Image Annot at ion Tool But t on Cont rol
AnnotationBackColor property R etur ns or sets the background
color of an Attach- a- Note annotation.
AnnotationFillColor property R eturns or sets the color used to fill
a Filled R ectangle annotation.
AnnotationFillStyle property R eturns or sets the pattern used to
fill Image Embedded, Image R eference, and Filled R ectangle
annotations.
AnnotationFont property R eturns or sets font object properties for
all text- related annotation types.
AnnotationFontColor property R etur ns or sets the font color for
all text- related annotation types.
AnnotationImage property R etur ns or sets the fully- qualified file
name of the image file used in Image Embedded and Image R eference
annotations.
AnnotationLineColor property R etur ns or sets the line color for
Straight Line, Freehand Line, and Hollow R ectangle annotations.
AnnotationLineStyle property R etur ns or sets the line style for
Straight Line, Freehand Line, and Hollow R ectangle annotations.
AnnotationLineWidth property R etur ns or sets the line width for
Straight Line, Freehand Line, and Hollow R ectangle annotations.
AnnotationStampText property R eturns or sets the stamp text to
be placed on an image by the Text Stamp annotation type. The stamp
text can consist of text, text macros (like the current date and time), or a
combination of both.
AnnotationTextFile property R etur ns or sets the fully- qualified
file name of the text file to be placed on an image by the Text From File
annotation type.
AnnotationType property R etur ns or sets the type of annotation
to draw.
Draw method Draws the annotation.
Chapt er 5
200
Remaining Propert ies, Met hods, and Event s of t he Image Edit
Cont rol
AnnotationGroupCount property R etur ns the number of
annotation groups that are on an image page.
AnnotationOcrType property R eturns or sets the type of OCR
zone to be drawn on an image page.
OcrZoneVisibility property Deter mines the visibility of OCR
zones on the image page.
AddAnnotationGroup method Adds a new annotation group to
an image page.
BurnInAnnotations method Burns annotations onto an image
page, per manently incorporating them into the image.
DeleteAnnotationGroup method Deletes an annotation group
and its associated annotations, and then redisplays the image.
DeleteSelectedAnnotations method Deletes selected annotations
from an image page.
EditSelectedAnnotationText method Displays a dialog box that
lets end users modify Text, Attach- a- Note, and Hyperlink annotations.
ExecuteTextEditCommand method Executes commands on the
Text Edit dialog box when the Image Edit control is operating in the
Text Edit mode (which is invoked using the EditSelected
AnnotationText method).
EditingTextAnnotation event Fires immediately after the Image
Edit control enters or exits the Text Edit mode.
GetAnnotationGroup method R eturns the name of the
annotation group based on the index specified.
GetAnnotationMarkCount method R etur ns the number of
annotation marks on an image page or in an annotation group.
GetCurrentAnnotationGroup method R etur ns the name of the
annotation group to which subsequent annotations will belong.
GetRubberStampItem method R etur ns the item number of the
currently selected rubber stamp according to its position on the Rubber
Stamp Properties dialog box and in the shortcut menu of the
standard annotation tool palette.
Use t he Bur nInAnnot at ions
met hod w it h care because
once annot at ions are bur ned-
in, t hey cannot be removed or
modif ied as annot at ion dat a.
The Edit Select ed
Annot at ionText met hod is
very usef ul. It enables user s t o
modif y t ext annot at ions. You
should consider using it
w het her users draw
annot at ions f rom t he
st andard annot at ion t ool
palet t e, a t ool p alet t e of your
ow n design, or f rom f u nct ions
you provide programmat ically.
For non-t ext annot at ions, use
t he Show At t ribs
Dialog met hod. It enables
users t o modif y non-t ext
annot at ions.
Developing Client -Server Applicat ions
201
SetRubberStampItem method Sets the item number for a rubber
stamp annotation according to its position on the Rubber Stamp
Properties dialog box and in the shortcut menu of the standard
annotation tool palette. It also activates the R ubber Stamp annotation
type.
GetRubberStampMenuItems method R eturns the menu items of
the R ubber Stamp tool on the standard annotation tool palette.
ShowRubberStampDialog method Shows the Rubber Stamp
Properties dialog box, which permits end users to create, delete, and
edit rubber stamp annotation properties.
GetSelectedAnnotationBackColor method R eturns the
background color of a selected Attach- a- Note annotation.
SetSelectedAnnotationBackColor method Sets the background
color of a selected Attach- a- Note annotation.
GetSelectedAnnotationFillColor method R etur ns the color used
to fill a selected Filled R ectangle annotation.
SetSelectedAnnotationFillColor method Sets the color used to
fill a selected Filled R ectangle annotation.
GetSelectedAnnotationFillStyle method R etur ns the style used
to fill selected Image Embedded, Image R eference, and Filled R ectangle
annotations.
SetSelectedAnnotationFillStyle method Sets the style used to fill
selected Image Embedded, Image R eference, and Filled R ectangle
annotations.
GetSelectedAnnotationFont method R eturns font object
properties for selected text- related annotation types.
SetSelectedAnnotationFont method Sets font object properties
for selected text- related annotation types.
GetSelectedAnnotationFontColor method R etur ns the font
color used in selected text- related annotation types.
SetSelectedAnnotationFontColor method Sets the font color to
use in selected text- related annotation types.
GetSelectedAnnotationImage method R eturns the fully-
qualified file name of the image being used in selected Image Embedded
and Image R eference annotations.
Chapt er 5
202
GetSelectedAnnotationLineColor method R eturns the line
color used in selected Straight Line, Freehand Line, and Hollow
R ectangle annotations.
SetSelectedAnnotationLineColor method Sets the line color to
use in selected Straight Line, Freehand Line, and Hollow R ectangle
annotations.
GetSelectedAnnotationLineStyle method R eturns the line style
used in selected Straight Line, Freehand Line, and Hollow R ectangle
annotations.
SetSelectedAnnotationLineStyle method Sets the line style to use
in selected Straight Line, Freehand Line, and Hollow R ectangle
annotations.
GetSelectedAnnotationLineWidth method R eturns the line
width (in pixels) used in selected Straight Line, Freehand Line, and
Hollow R ectangle annotations.
SetSelectedAnnotationLineWidth method Sets the line width to
use in selected Straight Line, Freehand Line, and Hollow R ectangle
annotations.
GetSelectedAnnotationOcrType method R eturns the OCR type
of a selected OCR zone annotation.
SetSelectedAnnotationOcrType method Changes the OCR type
of a selected OCR Zone annotation.
HideAnnotationGroup method Hides the specified annotation
group.
ShowAnnotationGroup method Shows the specified annotation
group.
HideAnnotationToolPalette method Hides the standard
annotation tool palette.
ToolPaletteHidden event Fires immediately after the standard
annotation tool palette is hidden.
ShowAnnotationToolPalette method Shows the standard
annotation tool palette.
SelectTool method Selects an annotation tool from the standard
annotation tool palette.
ToolSelected event Fires immediately after the user selects a tool
from the standard annotation tool palette.
Developing Client -Server Applicat ions
203
LoadAnnotations method Loads annotations from a file and places
them on the displayed image page.
SaveAnnotations method Saves annotations on the displayed image
page to a file.
RemoveAllOCRMarks method R emoves OCR zones from all
image pages in the displayed image document.
SelectAnnotationGroup method Selects all annotation marks
within a specific annotation group on an image page.
SelectFirstOcrZone method Selects the first OCR zone on the
displayed image page.
SelectNextOcrZone method Selects the next OCR zone on the
displayed image page.
SetCurrentAnnotationGroup method Sets the annotation group
to which subsequent annotations will belong.
ShowAttribsDialog method Shows an annotation attr ibutes dialog
box, which lets end users change the properties of a selected annotation
mark.
HyperlinkGoToDoc event Fires when users click a Hyperlink
annotation that is linked to a page in an external image file.
HyperlinkGoToPage event Fires when users click a Hyperlink
annotation that is linked to a page within the cur rent image file.
MarkEnd event Fires immediately after the user or the program
completes the drawing of an annotation mark.
MarkMove event Fires immediately after the user or the program
moves or resizes an annotation mark.
MarkSelect event Fires immediately after the user or the program
selects an annotation mark.
ToolTip event Fires immediately after a tool tip is displayed on the
standard annotation tool palette.
The Show At t ribsDialog
met hod is very usef ul. It
enab les user s t o edit exist ing
non-t ext annot at ions. You
should consider using it
w het her users draw
annot at ions f rom t he
st andard annot at ion t ool
palet t e, a t ool p alet t e of your
ow n design, o r f rom f u nct ions
you provide programmat ically.
For t ext annot at ions, use t he
Edit Select edAnnot at ionText
met hod. It enables users t o
modif y t ext annot at ions.
Chapt er 5
204
Example
Users of your application may want to annotate image files with
important comments. They may also want to link image pages to related
Web pages.
Scenario
Kim manages a QA (quality assurance) group in a software company that
produces applications for engineer- to- order manufactur ing fir ms around
the world. Some of the development and testing of the applications is
perfor med in the United States, the remainder is perfor med in Ireland.
As part of their jobs, Kim and her staff regularly distr ibute and peer-
review scanned specification and test plan documents. Because the QA
group is spread across two continents, each analyst relies on e- mail
exclusively to exchange the image documents.
Because you included e- mail and image annotation functions in your
program, Kim and her staff can use it to retr ieve, annotate, and send the
image documents. Analysts use its text- related annotation types to enter
their review comments directly on the documents. And they use its
Hyperlink annotation type to link their comments to related reference
pages on the companys intranet site.
The Image Server Project
As stated previously, the Image Server project demonstrates:
s
Setting server options.
s
Browsing for Imaging 1.x file and document volumes.
s
Browsing Imaging 1.x file and document volumes for files and
documents to open.
s
Querying Imaging 1.x document volumes for documents to open.
s
Zooming an image.
s
Invoking the standard annotation tool palette.
s
Showing and hiding annotations.
The f ile name f o r t he Image
Ser ver project is
ImgServr.vbp.
Developing Client -Server Applicat ions
205
The project consists of the following for ms and modules:
frmMain Lets users open image files that reside on their PCs or
image files and server documents that reside on Imaging 1.x servers. It
also lets users browse Imaging 1.x servers for file or document volumes,
as well as zoom and annotate the image files or documents they open.
frm1xCDFD Enables users to query an Imaging 1.x document
volume for documents by location, using the following hierarchy:
Cabinet\Drawer\Folder\Document
frm1xQuery Enables users to query an Imaging 1.x document
volume for documents by name, creation date, modification date, or
keyword.
The project uses the following Imaging controls:
s
One Image Admin control
s
One Image Edit control
It uses the following methods of the Image Admin control to provide
setup, open, browse, and query functions:
Chapt er 5
206
Show1xServerOptDlg method To display the Imaging Server
Options dialog box, which lets users set Imaging 1.x server options.
ShowFileDialog method To display the Open dialog box, which
lets users select the image files or server documents they want to open.
Browse1x method To display the Browse 1.x dialog box, which
lets users browse the Imaging 1.x server for server file and/ or document
volumes.
CreateDirectory method To create a cabinet, drawer, and/ or
folder.
ConvertDate method To convert conventional (Gregor ian) dates to
Julian dates when using the ImgQuery method to query 1.x document
volumes.
ImgQuery method To query Imaging 1.x document volumes.
ImgQueryEnd method To complete a query and free associated
resources.
And it uses the following methods in the Image Edit control to provide
the image display and annotation functions:
Display method To display the image file or server document
specified in the Image property of the Image Edit control.
Refresh method To redisplay the cur rent image in the Image Edit
control.
ShowAnnotationToolPalette method To show the standard
annotation tool palette.
HideAnnotationToolPalette method To hide the standard
annotation tool palette.
ShowAnnotationGroup method To show annotations.
HideAnnotationGroup method To hide annotations.
Set t ing Server Opt ions
Start the Image Server project. On the Server menu, click Imaging
Server Options.
The mnuServerItem_Click() event procedure of fr mMain executes
the appropr iate code in its Select Case statement (as shown in the
following code snippet). Each Case expression corresponds to the Index
value of an option on the Server menu.
Developing Client -Server Applicat ions
207
In this case, the procedure invokes the Show1xServerOptDlg method
of the Image Admin control, which displays the Imaging Server
Options dialog box descr ibed in the Setting Imaging Server Options
section of this chapter.
Make the appropr iate entr ies on the Imaging Server Options dialog
box and then click OK.
2TKXCVG 5WD OPW5GTXGT+VGOA%NKEM+PFGZ #U +PVGIGT)
&KO UVT2CVJ #U 5VTKPI
&KO UVT2CVJ6[RG #U 5VTKPI
1P 'TTQT 4GUWOG 0GZV

5GNGEV %CUG +PFGZ

%CUG 0 '#EEGUU +OCIKPI 5GTXGT 1RVKQPU FKCNQI DQZ

kdkImqAdm1nI.ShowIxServerOtDq



'PF 5GNGEV

'PF 5WD
Chapt er 5
208
Browsing f or Imaging 1.x File and/or
Document Volumes
To browse an Imaging 1.x server, on the Server menu, click:
Browse 1.x Files To browse for file volumes.
Browse 1.x Documents To browse for document volumes.
Browse 1.x Files and Documents To browse for both file and
document volumes.
The mnuServerItem_Click() event procedure of fr mMain (shown in
the following code snippet) executes the appropr iate code in the Case
2,3,4 statement depending on the Index value of the Server menu
option clicked. For each Index value, the procedure invokes the Browse
1.x method of the Image Admin control with the appropr iate parameter
values:
Browse1xScope parameter Deter mines the volume type to
browse:
Index = 2 passes the BrowseFiles constant (literal 0).
Index = 3 passes the BrowseDocuments constant (literal 1).
Index = 4 passes the BrowseBoth constant (literal 2).
Title parameter Deter mines the text that appears in the title bar of
the Browse1.x dialog box:
Index = 2 passes Browse 1.x File Volumes.
Index = 3 passes Browse 1.x Document Volumes.
Index = 4 passes Browse 1.x File and Document
Volumes.
Caption parameter Deter mines the prompt that appears in the title
bar of the Browse 1.x dialog box. Each invocation of the Browse1.x
method passes Select the Desired Path.
hParentWnd parameter Assigns a parent window handle to the
Browse 1.x dialog box. Each invocation of the Browse1.x method
passes frmMain.hWnd, which is the handle to the main for m.
The Browse1x method displays the Browse 1.x dialog box descr ibed in
the Browsing for Volumes section of this chapter.
Browse the file and/ or document volumes. Then make your selection
and click OK. The Imaging software wr ites the path selected to the
Browse1xReturnedPath property of the Image Admin control and the
type of path selected to the Browse1xReturnedType property.
When t he u ser clicks Cancel, a
Cancel is pressed er ror
condit ion occurs. The
mnuServerIt em_Click() event
show s you how t o h andle it .
Developing Client -Server Applicat ions
209
2TKXCVG 5WD OPW5GTXGT+VGOA%NKEM+PFGZ #U +PVGIGT)
&KO UVT2CVJ #U 5VTKPI
&KO UVT2CVJ6[RG #U 5VTKPI
1P 'TTQT 4GUWOG 0GZV

5GNGEV %CUG +PFGZ

%CUG 0 '#EEGUU +OCIKPI 5GTXGT 1RVKQPU FKCNQI DQZ
MFM+OI#FOKP15JQY1Z5GTXGT1RV&NI

%CUG o 4 '$TQYUG 1Z (KNG &QEWOGPV QT (KNG CPF &QEWOGPV 8QNWOGU
+H +PFGZ - 6JGP
kdkImqAdm1nI.BrowseIx BrowseF1es. "Browse I.x F1e Voumes".
"Seect the Des1red Path". frmMa1n.hWnd
'NUG+H +PFGZ - o 6JGP
kdkImqAdm1nI.BrowseIx BrowseDocuments.
"Browse I.x Document Voumes".
"Seect the Des1red Path". frmMa1n.hWnd
'NUG
kdkImqAdm1nI.BrowseIx BrowseBoth.
"Browse I.x F1e and Document Voumes".
"Seect the Des1red Path". frmMa1n.hWnd
'PF +H
+H 'TT0WODGT - %#0%'.A24'55'& 6JGP 'o7bb - %CPEGN RTGUUGF
'ZKV 5WD
'NUG+H MFM+OI#FOKP1$TQYUG1Z4GVWTPGF2CVJ - 6JGP M0QV KPUVCNNGF
'ZKV 5WD
'NUG+H MFM+OI#FOKP15VCVWU%QFG 0 6JGP
/UI$QZ 'TT&GUETKRVKQP o +OI#FOKP GTTQT o A
*GZMFM+OI#FOKP15VCVWU%QFG) o ) XD%TKVKECN
'ZKV 5WD
'PF +H

strPath - kdkImqAdm1nI.BrowseIxReturnedPath
strPathTye - kdkImqAdm1nI.BrowseIxReturnedTye




'PF 5GNGEV

'PF 5WD
Chapt er 5
210
Opening 1.x Files and Document s
To simply browse for and then open an Imaging 1.x image file or server
document for display, on the File menu, click Open.
The mnuFileOpen_Click() event procedure of fr mMain executes its
code (as shown in the following code snippet). Specifically, it invokes the
ShowFileDialog method of the Image Admin control with the
following parameter values:
DialogOption parameter Passes the OpenDlg constant (literal 0) to
display the Open dialog box.
hParentWnd parameter Passes the handle to the main window
(frmMain.hWnd).
The ShowFileDialog method displays the standard Open dialog box
descr ibed in the Browsing for Files and Documents section earlier in
this chapter.
Browse and then make your image file or server document selection,
then click OK. The Imaging software wr ites the path and file (or
document) selected to the Image property of the Image Admin control.
Next, the cmdFileOpen_Click() event procedure invokes the public
subroutine, PerformFileOpen(kdkImgAdmin1.Image), which
opens and displays the image file or server document selected.
When t he u ser clicks Cancel, a
Cancel is pressed er ror
condit ion occurs. The
mnuFileOpen_Click() event
show s you how t o h andle it .
Developing Client -Server Applicat ions
211
2TKXCVG 5WD OPW(KNG1RGPA%NKEM)

1P 'TTQT 4GUWOG 0GZV

'
' 5GV (NCIU VQ 0 CPF VJGP UJQY VJG 1RGP FKCNQI DQZ
'
MFM+OI#FOKP1(NCIU - 0
kdkImqAdm1nI.ShowF1eD1aoq OenDq. frmMa1n.hWnd

'
' +H VJG %CPEGN DWVVQP YCU RTGUUGF GZKV VJG UWDTQWVKPG
' +H C FKHHGTGPV GTTQT QEEWTTGF FKURNC[ C OGUUCIG DQZ CPF
' GZKV VJG UWDTQWVKPG
'
+H 'TT0WODGT - %#0%'.A24'55'& 6JGP 'o7bb - %CPEGN RTGUUGF
'ZKV 5WD
'NUG+H MFM+OI#FOKP15VCVWU%QFG 0 6JGP
/UI$QZ 'TT&GUETKRVKQP o +OI#FOKP GTTQT o A
*GZMFM+OI#FOKP15VCVWU%QFG) o ) XD%TKVKECN
'ZKV 5WD
'PF +H

'
' &KURNC[ VJG KOCIG
'
%CNN 2GTHQTO(KNG1RGPMFM+OI#FOKP1+OCIG)

'PF 5WD
Chapt er 5
212
Querying 1.x Document Manager Dat abases
To query an Imaging 1.x database, on the Server menu, click:
1.x Query by Cabinet\ Drawer\ Folder\ Document To query 1.x
document manager databases by Cabinet, Drawer, Folder, and
Document.
1.x Query To query 1.x document manager databases by document
name, date, or keyword.
The following sections discuss each type of query.
Perf orming a 1.x Query by Cabinet \Drawer\Folder\Document
After you make your menu selection, the 1.x Cabinet\ Drawer\
Folder\ Document window (fr m1.xCDFD) loads without being
shown. Its Form_Load() event procedure (shown in the following code
snippet) invokes the ImgQueryEnd method of the Image Admin
control to clear any previous Imaging quer ies and to free associated
system resources.
Next, the procedure invokes the ImgQuery method to initiate a new
query, passing to it the following parameters:
vScope parameter Constant DMVOLUMES (literal 1), which sets the
method so it perfor ms a query for Imaging 1.x document manager
databases.
szQueryTerms parameter A blank str ing, which makes the
method retur n the available Imaging 1.x databases.
iDispatch parameter The object var iable, objResults, which
represents the collection object that contains the results of the query. You
can extract the results of a query by using a For Each...Next
statement in the following for mat:
For Each VariantItem In objResults
' Your code that processes each VariantItem
Next VariantItem
The query finds the available Imaging 1.x databases. Then the
Form_Load() event procedure loads them from the objResults
Not e: This port ion of t he Image Server project ref ers t o document
volumes as document manager dat abases or document
managers.
Document volumes w ere ref erred t o as document manager
dat abases in earlier versions of t he Imaging 1.x sof t w are.
Ref er t o t he on-line help as
w ell as Chapt er 8 of t his guide
f or more inf ormat ion about
t he ImgQuery met ho d of t he
Image Admin cont rol.
Developing Client -Server Applicat ions
213
object var iable into the Document Manager combo box
(cboDocManager).
The procedure ends the query by setting objResults to Nothing and
by invoking the ImgQueryEnd method. Both actions free system
resources associated with the query.
The procedure wraps up its work by:
s
Showing the 1.x Cabinet\ Drawer\ Folder\ Document window.
s
Displaying the number of document manager databases found.
s
Giving focus to the Document Manager combo box.
Chapt er 5
214
2TKXCVG 5WD (QTOA.QCF)
&KO QDL4GUWNVU #U 1DLGEV
&KO UVT5KPING2NWTCN #U 5VTKPI
&KO XPV+VGO #U 8CTKCPV



'
' 2GTHQTO CP +OI3WGT[ HQT CNN &QEWOGPV /CPCIGT FCVCDCUGU
'--------------------------------------------------------------------------
kdkImqAdm1nI.ImqOueryEnd
kdkImqAdm1nI.ImqOuery "DMVOLUMES". "". obJResuts
'
' +H CP GTTQT QEEWTTGF FKURNC[ C OGUUCIG DQZ CPF GZKV
'
+H MFM+OI#FOKP15VCVWU%QFG 0 6JGP
/UI$QZ 'TT&GUETKRVKQP o +OI#FOKP GTTQT o A
*GZMFM+OI#FOKP15VCVWU%QFG) o ) XD%TKVKECN
'ZKV 5WD
'PF +H
'
' 5VQTG VJG TGUWNVU KP VJG EDQ&QE/CPCIGT EQODQ DQZ
'
For Each vntItem In obJResuts
If vntItem <> "" Then
cboDocManaqer.AddItem vntItem
End If
Next vntItem
'
' 'PF VJG SWGT[
'
Set obJResuts - Noth1nq
kdkImqAdm1nI.ImqOueryEnd
'
' &KURNC[ VJG PWODGT QH &QEWOGPV /CPCIGTU HQWPF
'
+H EDQ&QE/CPCIGT.KUV%QWPV - 1 6JGP
UVT5KPING2NWTCN - &QEWOGPV /CPCIGT
'NUG
UVT5KPING2NWTCN - &QEWOGPV /CPCIGTU
'PF +H
NDN&QEWOGPV/CPCIGT%CRVKQP - EDQ&QE/CPCIGT.KUV%QWPV o UVT5KPING2NWTCN
'
' 5JQY VJG HQTO UGV HQEWU VQ EDQ&QE/CPCIGT
'
/G5JQY
EDQ&QE/CPCIGT5GV(QEWU
'PF 5WD
Developing Client -Server Applicat ions
215
On the 1.x Cabinet\ Drawer\ Folder\ Document window, click the
desired document manager database in the Document Managers
combo box. The cboDocManager_Click() event procedure fires and
executes its code (as shown in the following code snippet).
The basic task of this event procedure is to query the selected document
manager database for all of its cabinets and to load them in the Cabinets
combo box. To accomplish this task, it saves the path to the document
manager you selected in the mstrDocManager module var iable and
then invokes the ImgQuery method with the following parameters:
vScope parameter The result of Mid(mstrDocManager, 9),
which sets the method so it perfor ms a query on the selected document
manager.
szQueryTerms parameter The str ing findcabinets, which is
contained in the mstrQuery module var iable. This parameter value
makes the method retur n the cabinets in the referenced database.
iDispatch parameter The object var iable, objResults, which
represents the collection object that contains the results of the query.
The query finds the cabinets in the selected database and retur ns them
via the collection object in the following for mat:
Image://server/database:\cabinet
Because were only interested in cabinet names, the procedure invokes
the public function GetEndString(), which retur ns just the cabinet
names. The cboDocManager_Click() event procedure then loads the
cabinet names into the Cabinets combo box (cboCabinet).
The procedure ends the query by setting objResults to Nothing and
by invoking the ImgQueryEnd method.
The procedure wraps up its work by displaying the number of cabinets
found and giving focus to the Cabinets combo box.
Once you select a document
manager dat abase, you can
creat e a new cabinet , draw er,
and/or f old er by ent ering t he
names in t he respect ive comb o
boxes and clicking t he Creat e
but t on.
The cmdCreat e_Click() event
procedure concat enat es a
st ring cont ain ing your ent ries
and invokes t he Creat e
Direct ory met hod of t he
Image Admin cont rol t o creat e
t he cabinet , draw er, and/ or
f older yo u specif ied (code not
show n).
Not e: Using t he M id f unct ion w it h a Start value of 9 is required
because t he mstrDocManager variable cont ains t he pat h t o
t he document manager in t he f ollow ing f ormat :
Image://server/database:
... and t he ImgQuery met hod is only int erest ed in t he
server/database: part . Accordingly, t he M id f unct ion elim-
inat es t he Image:// part and ret ur ns a variant (st ring) value of
server/database:.
Chapt er 5
216
2TKXCVG 5WD EDQ&QE/CPCIGTA%NKEM)
&KO QDL4GUWNVU #U 1DLGEV
&KO UVT5KPING2NWTCN #U 5VTKPI
&KO XPV+VGO #U 8CTKCPV
.
.
.
OUVT&QE/CPCIGT - EDQ&QE/CPCIGT6GZV
'
' 2GTHQTO CP +OI3WGT[ HQT %CDKPGV PCOGU NQCF VJGO KP VJG
' EDQ%CDKPGV EQODQ DQZ
'
OUVT3WGT[ - HKPFECDKPGVU
kdkImqAdm1nI.ImqOuery M1dmstrDocManaqer. 9). mstrOuery. obJResuts
For Each vntItem In obJResuts
If vntItem <> "" Then
cboOab1net.AddItem OetEndStr1nqvntItem. "\")
End If
Next vntItem
'
' 'PF VJG SWGT[
'
Set obJResuts - Noth1nq
kdkImqAdm1nI.ImqOueryEnd
'
' &KURNC[ VJG PWODGT QH %CDKPGVU HQWPF
'
+H EDQ%CDKPGV.KUV%QWPV - 1 6JGP
UVT5KPING2NWTCN - %CDKPGV
'NUG
UVT5KPING2NWTCN - %CDKPGVU
'PF +H
NDN%CDKPGV%CRVKQP - EDQ%CDKPGV.KUV%QWPV o UVT5KPING2NWTCN
'
' 5GV VJG HQEWU VQ EDQ%CDKPGV
'
EDQ%CDKPGV5GV(QEWU

'PF 5WD
Developing Client -Server Applicat ions
217
On the 1.x Cabinet\ Drawer\ Folder\ Document window, click the
desired cabinet in the Cabinets combo box. The
cboCabinet_Click() event procedure fires and executes its code (as
shown in the following code snippet).
The basic task of this event procedure is to query the selected database
and cabinet for all of its drawers and to load them in the Drawers combo
box. To accomplish this task, it saves the path to the document manager
and cabinet you selected in the mstrDocManager and mstrCabinet
module var iables respectively. Then it invokes the ImgQuery method
with the following parameters:
vScope parameter The result of Mid(mstrDocManager, 9),
which sets the method so it perfor ms a query on the selected document
manager.
szQueryTerms parameter The concatenated str ing
"finddrawers cabinet=" & mstrCabinet, which is contained in
the mstrQuery module var iable. This parameter value makes the
method retur n the drawers in the referenced database and cabinet.
iDispatch parameter The object var iable, objResults, which
represents the collection object that contains the results of the query.
The query finds the drawers in the selected database and retur ns them via
the collection object in the following for mat:
Image://database:\cabinet\drawer
Because were only interested in drawer names, the procedure invokes the
public function GetEndString(), which retur ns just the drawer names.
The cboCabinet_Click() event procedure then loads the drawer
names into the Drawers combo box (cboDrawer).
The procedure ends the query by setting objResults to Nothing and
by invoking the ImgQueryEnd method.
The procedure wraps up its work by displaying the number of drawers
found and giving focus to the Drawers combo box.
M ake sure t hat t he Enable
Draw ers check box has a
check mark next t o it . If it does
not , t he cboCabin et _Click()
procedure perf orms a query f or
f olders.
Chapt er 5
218
2TKXCVG 5WD EDQ%CDKPGVA%NKEM)
&KO QDL4GUWNVU #U 1DLGEV
&KO UVT5KPING2NWTCN #U 5VTKPI
&KO XPV+VGO #U 8CTKCPV
.
.
.
OUVT&QE/CPCIGT - EDQ&QE/CPCIGT6GZV
OUVT%CDKPGV - EDQ%CDKPGV6GZV
'
' 2GTHQTO CP +OI3WGT[ CPF UVQTG VJG &TCYGT QT (QNFGT PCOGU
' KP VJG CRRTQRTKCVG EQODQ DQZ
'
+H EJM'PCDNG&TCYGTU8CNWG - %JGEMGF 6JGP
mstrOuery - "f1nddrawers cab1net-" & mstrOab1net
kdkImqAdm1nI.ImqOuery M1dmstrDocManaqer. 9). mstrOuery. obJResuts
For Each vntItem In obJResuts
If vntItem <> "" Then
cboDrawer.AddItem OetEndStr1nqvntItem. "\")
End If
Next vntItem
.
.
.
'PF +H
'
' 'PF VJG SWGT[
'
Set obJResuts - Noth1nq
kdkImqAdm1nI.ImqOueryEnd
.
.
.
'PF 5WD
Developing Client -Server Applicat ions
219
On the 1.x Cabinet\ Drawer\ Folder\ Document window, click the
desired drawer in the Drawers combo box. The cboDrawer_Click()
event procedure fires and executes its code (as shown in the following
code snippet).
The basic task of this event procedure is to query the selected database,
cabinet, and drawer for all of its folders and to load them in the Folders
combo box. To accomplish this task, it saves the path to the document
manager, cabinet, and drawer you selected in the mstrDocManager,
mstrCabinet, and mstrDrawer module var iables respectively. Then it
invokes the ImgQuery method with the following parameters:
vScope parameter The result of Mid(mstrDocManager, 9),
which sets the method so it perfor ms a query on the selected document
manager.
szQueryTerms parameter The concatenated str ing
"findfolders cabinet=" & mstrCabinet & ";drawer=" &
mstrDrawer, which is contained in the mstrQuery module var iable.
This parameter value makes the method retur n the folders in the
referenced database, cabinet, and drawer.
iDispatch parameter The object var iable, objResults, which
represents the collection object that contains the results of the query.
The query finds the folders in the selected database and returns them via
the collection object in the following for mat:
Image://database:\cabinet\drawer\folder
Because were only interested in folder names, the procedure invokes the
public function GetEndString(), which returns just the folder names.
The cboDrawer_Click() event procedure then loads the folder names
into the Folders combo box (cboFolder).
The procedure ends the query by setting objResults to Nothing and
by invoking the ImgQueryEnd method.
The procedure wraps up its work by displaying the number of folders
found and giving focus to the Folders combo box.
Chapt er 5
220
2TKXCVG 5WD EDQ&TCYGTA%NKEM)
&KO QDL4GUWNVU #U 1DLGEV
&KO UVT5KPING2NWTCN #U 5VTKPI
&KO XPV+VGO #U 8CTKCPV
.
.
.
OUVT&QE/CPCIGT - EDQ&QE/CPCIGT6GZV
OUVT%CDKPGV - EDQ%CDKPGV6GZV
OUVT&TCYGT - EDQ&TCYGT6GZV
'
' 2GTHQTO CP +OI3WGT[ CPF UVQTG VJG (QNFGT PCOGU KP VJG
' EDQ(QNFGT EQODQ DQZ
'
mstrOuery - "f1ndfoders cab1net-" & mstrOab1net & ":drawer-" & mstrDrawer
kdkImqAdm1nI.ImqOuery M1dmstrDocManaqer. 9). mstrOuery. obJResuts

For Each vntItem In obJResuts
If vntItem <> "" Then
cboFoder.AddItem OetEndStr1nqvntItem. "\")
End If
Next vntItem
'
' 'PF VJG SWGT[
'
Set obJResuts - Noth1nq
kdkImqAdm1nI.ImqOueryEnd
'
' &KURNC[ VJG PWODGT QH (QNFGTU HQWPF
'
+H EDQ(QNFGT.KUV%QWPV - 1 6JGP
UVT5KPING2NWTCN - (QNFGT
'NUG
UVT5KPING2NWTCN - (QNFGTU
'PF +H
NDN(QNFGT%CRVKQP - EDQ(QNFGT.KUV%QWPV o UVT5KPING2NWTCN
'
' 5GV VJG HQEWU VQ EDQ(QNFGT
'
EDQ(QNFGT5GV(QEWU

'PF 5WD
Developing Client -Server Applicat ions
221
On the 1.x Cabinet\ Drawer\ Folder\ Document window, click the
desired folder in the Folders combo box. The cboFolder_Click()
event procedure fires and executes its code (as shown in the following
code snippet).
The basic task of this event procedure is to query the selected database,
cabinet, drawer, and folder for all of its documents and to load them in
the Documents combo box. To accomplish this task, it saves the path to
the document manager, cabinet, drawer, and folder you selected in the
mstrDocManager, mstrCabinet, mstrDrawer, and mstrFolder
module var iables respectively. Then it invokes the ImgQuery method
with the following parameters:
vScope parameter The result of Mid(mstrDocManager, 9),
which sets the method so it perfor ms a query on the selected document
manager.
szQueryTerms parameter The concatenated str ing "finddocs
cabinet = " & mstrCabinet & " drawer = " & mstrDrawer
& " folder = " & mstrFolder, which is contained in the
mstrQuery module var iable. This parameter value makes the method
return the documents in the referenced database, cabinet, drawer, and
folder.
iDispatch parameter The object var iable, objResults, which
represents the collection object that contains the results of the query.
The query finds the documents in the selected database and retur ns them
via the collection object in the following for mat:
Image://database:\cabinet\drawer\folder\document
Because were only interested in document names, the procedure invokes
the public function GetEndString(), which retur ns just the document
names. The cboFolder_Click() event procedure then loads the
document names into the Documents combo box (cboDocument).
The procedure ends the query by setting objResults to Nothing and
by invoking the ImgQueryEnd method.
The procedure wraps up its work by displaying the number of documents
found and giving focus to the Documents combo box.
Chapt er 5
222
2TKXCVG 5WD EDQ(QNFGTA%NKEM)
&KO QDL4GUWNVU #U 1DLGEV
&KO UVT5KPING2NWTCN #U 5VTKPI
&KO XPV+VGO #U 8CTKCPV
.
.
.
OUVT&QE/CPCIGT - EDQ&QE/CPCIGT6GZV
OUVT%CDKPGV - EDQ%CDKPGV6GZV
OUVT&TCYGT - EDQ&TCYGT6GZV
OUVT(QNFGT - EDQ(QNFGT6GZV
'
' 2GTHQTO CP +OI3WGT[ CPF UVQTG VJG &QEWOGPV PCOGU KP VJG
' EDQ&QEWOGPV EQODQ DQZ
'
mstrOuery - "f1nddocs cab1net - " & mstrOab1net & " drawer - "
& mstrDrawer & " foder - " & mstrFoder
kdkImqAdm1nI.ImqOuery M1dmstrDocManaqer. 9). mstrOuery. obJResuts
For Each vntItem In obJResuts
If vntItem <> "" Then
cboDocument.AddItem OetEndStr1nqvntItem. "\")
End If
Next vntItem
'
' 'PF VJG SWGT[
'
Set obJResuts - Noth1nq
kdkImqAdm1nI.ImqOueryEnd
'
' &KURNC[ VJG PWODGT QH &QEWOGPVU HQWPF
'
+H EDQ&QEWOGPV.KUV%QWPV - 1 6JGP
UVT5KPING2NWTCN - &QEWOGPV
'NUG
UVT5KPING2NWTCN - &QEWOGPVU
'PF +H
NDN&QEWOGPV%CRVKQP - EDQ&QEWOGPV.KUV%QWPV o UVT5KPING2NWTCN
'
' 5GV VJG HQEWU VQ EDQ&QEWOGPV
'
EDQ&QEWOGPV5GV(QEWU

'PF 5WD
Developing Client -Server Applicat ions
223
On the 1.x Cabinet\ Drawer\ Folder\ Document window, click the
desired document in the Document combo box and then click the
Open button. The cmdOpen_Click() event procedure invokes the
public subroutine, PerformFileOpen(strDocManagerCDFD), which
opens and displays the document selected.
Perf orming a 1.x Query by Name, Dat e, or Keyword
After you select 1.x Query on the Server menu, the 1.x Query
window (fr m1.xQuery) loads without being shown. Its Form_Load()
event procedure (shown in the following code snippet) invokes the
ImgQueryEnd method of the Image Admin control to clear any
previous Imaging quer ies and to free associated system resources.
Next, the procedure invokes the ImgQuery method, passing to it the
following parameters:
vScope parameter Constant DMVOLUMES (literal 1), which sets the
method so it perfor ms a query for Imaging 1.x document manager
databases.
szQueryTerms parameter A blank str ing, which makes the
method retur n the available Imaging 1.x databases.
iDispatch parameter The object var iable, objResults, which
represents the collection object that contains the results of the query.
The query finds all of the available Imaging 1.x databases. The
Form_Load() event procedure loads them from the objResults
object var iable into the Document Manager combo box
(cboDocManager).
The procedure ends the query by setting objResults to Nothing and
by invoking the ImgQueryEnd method. Both actions free system
resources associated with the query.
Chapt er 5
224
The procedure wraps up its work by:
s
Showing the 1.x Query window.
s
Displaying the number of document manager databases found.
s
Giving focus to the Document Manager combo box.
Developing Client -Server Applicat ions
225
2TKXCVG 5WD (QTOA.QCF)
&KO QDL4GUWNVU #U 1DLGEV
&KO UVT5KPING2NWTCN #U 5VTKPI
&KO XPV+VGO #U 8CTKCPV



'
' 2GTHQTO CP +OI3WGT[ HQT CNN &QEWOGPV /CPCIGT FCVCDCUGU
'
kdkImqAdm1nI.ImqOueryEnd
kdkImqAdm1nI.ImqOuery "DMVOLUMES". "". obJResuts
'
' +H CP GTTQT QEEWTTGF FKURNC[ C OGUUCIG DQZ CPF GZKV
'
+H MFM+OI#FOKP15VCVWU%QFG 0 6JGP
/UI$QZ 'TT&GUETKRVKQP o +OI#FOKP GTTQT o A
*GZMFM+OI#FOKP15VCVWU%QFG) o ) XD%TKVKECN
'ZKV 5WD
'PF +H
'
' 5VQTG VJG TGUWNVU KP VJG EDQ&QE/CPCIGT EQODQ DQZ
'
For Each vntItem In obJResuts
If vntItem <> "" Then
cboDocManaqer.AddItem vntItem
End If
Next vntItem
'
' 'PF VJG SWGT[
'
Set obJResuts - Noth1nq
kdkImqAdm1nI.ImqOueryEnd
'
' &KURNC[ VJG PWODGT QH &QEWOGPV /CPCIGTU HQWPF
'
+H EDQ&QE/CPCIGT.KUV%QWPV - 1 6JGP
UVT5KPING2NWTCN - &QEWOGPV /CPCIGT
'NUG
UVT5KPING2NWTCN - &QEWOGPV /CPCIGTU
'PF +H
NDN&QEWOGPV/CPCIGT%CRVKQP - EDQ&QE/CPCIGT.KUV%QWPV o UVT5KPING2NWTCN
'
' 5JQY VJG HQTO UGV HQEWU VQ EDQ&QE/CPCIGT
'
/G5JQY
EDQ&QE/CPCIGT5GV(QEWU
'PF 5WD
Chapt er 5
226
On the 1.x Query window, click the desired document manager
database in the Document Managers combo box. The
cboDocManager_Click() event procedure assigns the document
manager database you selected to the mstrDocManager module var iable
(code not shown).
In the Find 1.x Document area, click the type of query you want to
perfor m.
If you clicked the:
Name option button (Query by Document) Click the desired
boolean operator and then enter the name of the document you are
trying to locate in the adjacent text box.
Date option button (Query by Date) Click whether to search for
documents that were created or modified, then click the desired boolean
operator (including before, after, and on). Finally, enter the desired date in
the adjacent text box.
Keyword option button (Query by Date) Click the desired
boolean operator and then enter, in the adjacent text box, the keyword
whose documents you want to search for. Use the date for mat set in the
R egional Settings applet of Windows 95, 98, or NT.
Click the Find button. The cmdFind_Click() event procedure fires
and executes its code (as shown in the following code snippet).
The basic task of this event procedure is to find all of the Imaging 1.x
server documents that satisfy the parameters you specified and to load
them in the list box control at the bottom of the window.
To accomplish this task, the procedure evaluates the Value property of
each option button on the for m. When it finds the option button you
clicked, it builds an appropr iate Query Terms str ing and assigns it to the
mstrQuery module var iable. (The procedure passes the value of this
var iable to the ImgQuery method later as the szQueryTerms
parameter.)
The composition of the Query Terms str ing depends on the type of
query you are perfor ming. If you are performing a:
Query by Document The str ing contains:
s
The finddocs document qualifier.
s
The selected boolean operator from the adjacent combo box.
s
The document name entered in the adjacent text box.
When you select t he Like
operat or, you can use t he
ast erisk (* ) w ildcard charact er
t o represent a gro up of
charact er s and a quest ion
mark(?) t o mat ch any single
charact er.
When building your ow n
QueryTerms st rings, be sure
t o include a space bet w een
each element .
Developing Client -Server Applicat ions
227
Query by Date The str ing contains:
s
The finddocs created or finddocs modified qualifier,
depending on whether you selected created or modified in the adjacent
combo box.
s
The selected boolean operator from the next combo box.
s
The date returned by the ConvertDate method of the Image Admin
control (which converted the Gregor ian date you entered in the
adjacent text box to a Julian date).
Query by Keyword The str ing contains:
s
The finddocs keyword qualifier.
s
The selected boolean operator from the adjacent combo box.
s
The keyword entered in the adjacent text box.
With the Query Terms str ing now composed and assigned, the
cmdFind_Click() event procedure invokes the ImgQuery method,
passing to it the following parameters:
vScope parameter The result of Mid(mstrDocManager, 9),
which sets the method so it perfor ms a query on the selected document
manager.
szQueryTerms parameter The concatenated Query Terms str ing
from the mstrQuery module var iable, which sets the method so it
perfor ms the query you specified.
iDispatch parameter The object var iable, objResults, which
represents the collection object that contains the results of the query.
The query finds the documents in the selected database and retur ns them
via the collection object in the following for mat:
Image://database:\cabinet\drawer\folder\document
The the cmdFind_Click() event procedure ends the query by setting
objResults to Nothing and by invoking the ImgQueryEnd method.
The procedure wraps up its work by displaying the documents in the list
box at the bottom of the window.
Chapt er 5
228
2TKXCVG 5WD EOF(KPFA%NKEM)
&KO QDL4GUWNVU #U 1DLGEV
&KO XPV+VGO #U 8CTKCPV
&KO UVT%QPXGTVGF&CVG #U 5VTKPI

NUV4GUWNVU%NGCT
'
' 2GTHQTO C SWGT[ UVQTG &QE PCOGU KP VJG NUV4GUWNVU NKUVDQZ
'
If otOuery0).Vaue - True Then 'Ouery by Document
mstrOuery - "f1nddocs document " &
cboName.L1stcboName.L1stIndex) & " " & txtName.Text

EseIf otOueryI).Vaue - True Then 'Ouery by Date
strOonvertedDate - kdkImqAdm1nI.OonvertDatetxtDate.Text)
mstrOuery - "f1nddocs " &
cboDateName.L1stcboDateName.L1stIndex) & " " &
cboDate.L1stcboDate.L1stIndex) & " " & strOonvertedDate

EseIf otOuery2).Vaue - True Then 'Ouery by Keyword
mstrOuery - "f1nddocs keyword " &
cboKeyword.L1stcboKeyword.L1stIndex) & " " & txtKeyword.Text
End If

kdkImqAdm1nI.ImqOuery M1dmstrDocManaqer. 9). mstrOuery. obJResuts

For Each vntItem In obJResuts
If vntItem <> "" Then
stResuts.AddItem vntItem
End If
Next
'
' 'PF VJG SWGT[
'
Set obJResuts - Noth1nq
kdkImqAdm1nI.ImqOueryEnd
'
' &KURNC[ VJG PWODGT QH FQEWOGPVU HQWPF
'
+H NUV4GUWNVU.KUV%QWPV - 0 6JGP
NDN4GUWNVU%CRVKQP - 5'.'%6A010'
'NUG+H NUV4GUWNVU.KUV%QWPV - 1 6JGP
NDN4GUWNVU%CRVKQP - 5'.'%6A5+0)7.#4
'NUG
NDN4GUWNVU%CRVKQP - 5'.'%6A2.74#.1 o NUV4GUWNVU.KUV%QWPV o 5'.'%6A2.74#.
'PF +H

'PF 5WD
Developing Client -Server Applicat ions
229
Select a document and click OK. The cmdOK_Click() event procedure
invokes the public subroutine, PerformFileOpen
(kdkImgAdmin1.Image), which opens and displays the server
document you selected (code not shown).
Zooming an Image
Open an image file or server document. After the image appears in the
Image Edit control, on the Zoom menu, click the desired zoom factor.
The mnuZoomFactorItem_Click event procedure fires and executes
the appropr iate code in its Select Case statement (as shown in the
following code snippet).
Each Case expression corresponds to the Index value of a Zoom menu
item. Further, each Case expression sets the Zoom property of the
Image Edit control to an appropr iate zoom factor.
With the Zoom property now set, the procedure completes its work by
invoking the Refresh method of the Image Edit control, which
redisplays the image at its new zoom factor.
Chapt er 5
230
2TKXCVG 5WD OPW<QQO(CEVQT+VGOA%NKEM+PFGZ #U +PVGIGT)
&KO KPV+PFGZ #U +PVGIGT
'
' 7PEJGEM CNN VJG \QQO OGPW KVGOU
'
(QT KPV+PFGZ - 0 6Q b
OPW<QQO(CEVQT+VGOKPV+PFGZ)%JGEMGF - (CNUG
0GZV KPV+PFGZ
'
' 5GV VJG \QQO HCEVQT
'
5GNGEV %CUG +PFGZ
%CUG 0 'b'
kdkImqEd1tI.Zoom - 25
%CUG 1 'b0'
kdkImqEd1tI.Zoom - 50
%CUG '7b'
kdkImqEd1tI.Zoom - 75
%CUG o '100'
kdkImqEd1tI.Zoom - I00
%CUG 4 '00'
kdkImqEd1tI.Zoom - 200
%CUG b '400'
kdkImqEd1tI.Zoom - 400
'PF 5GNGEV
'
' %JGEM VJG OGPW KVGO VJCV YCU ENKEMGF
'
OPW<QQO(CEVQT+VGO+PFGZ)%JGEMGF - 6TWG
'
' 4GHTGUJ VJG KOCIG CV VJG PGY \QQO HCEVQT
'
kdkImqEd1tI.Refresh
'PF 5WD
Developing Client -Server Applicat ions
231
Invoking t he St andard Annot at ion
Tool Palet t e
Open an image file or server document. After the image appears in the
Image Edit control, on the Annotations menu, click Show
Annotation Toolbar.
The mnuAnnotationItem_Click event procedure fires and executes
the appropr iate code in its Select Case statement (as shown in the
following code snippet).
Each Case expression corresponds to the Index value of an Annotation
menu item.
As long the corresponding menu item is not checked, the Case 1
expression invokes the ShowAnnotationToolPalette method of the
Image Edit control, which displays the standard annotation tool
palette. (R efer to theAnnotations Defined section earlier in this
chapter for more infor mation about annotations and the annotation
tool palette.)
If the corresponding menu item is checked, the Case 1 expression
invokes the HideAnnotationToolPalette method, which closes the
annotation tool palette.
Closing or hiding the standard annotation tool palette causes the
ToolPaletteHidden() event of the Image Edit control to fire. Code
within it removes the check mark from the Show Annotation Toolbar
menu item (code not shown).
If desired , you can inclu de
paramet ers in your call t o t he
Show Annot at ionTool
Palet t e met hod. The
paramet ers cont rol:
s
Wh et her user s can set
annot at ion proper t ies.
s
Wh ere t he t ool palet t e w ill
appear on t he screen.
s
The t ool t ip t ext t he
appears w hen t he mouse
poin t er hovers over a
but t on on t he t ool palet t e.
Chapt er 5
232
2TKXCVG 5WD OPW#PPQVCVKQP+VGOA%NKEM+PFGZ #U +PVGIGT)

5GNGEV %CUG +PFGZ

%CUG 0 '5JQY #PPQVCVKQPU
+H OPW#PPQVCVKQP+VGO+PFGZ)%JGEMGF - 6TWG 6JGP
OPW#PPQVCVKQP+VGO+PFGZ)%JGEMGF - (CNUG
MFM+OI'FKV1*KFG#PPQVCVKQP)TQWR
'NUG
OPW#PPQVCVKQP+VGO+PFGZ)%JGEMGF - 6TWG
MFM+OI'FKV15JQY#PPQVCVKQP)TQWR
'PF +H

%CUG 1 '5JQY #PPQVCVKQP 6QQNDCT
+H OPW#PPQVCVKQP+VGO+PFGZ)%JGEMGF - 6TWG 6JGP
OPW#PPQVCVKQP+VGO+PFGZ)%JGEMGF - (CNUG
kdkImqEd1tI.H1deAnnotat1onTooPaette
'NUG
OPW#PPQVCVKQP+VGO+PFGZ)%JGEMGF - 6TWG
kdkImqEd1tI.ShowAnnotat1onTooPaette
'PF +H

'PF 5GNGEV
'PF 5WD
Developing Client -Server Applicat ions
233
Showing and Hiding Annot at ions
Open an image file or server document. Then show the annotation tool
palette and draw some annotations on the image.
On the Annotations menu, click Show Annotations.
The mnuAnnotationItem_Click event procedure fires and executes
the appropr iate code in its Select Case statement (as shown in the
following code snippet).
Each Case expression corresponds to the Index value of an Annotation
menu item.
If the corresponding menu item is checked, the Case 0 expression
invokes the HideAnnotationGroup method of the Image Edit con-
trol, which hides all of the annotations on the image. (R efer to the
Annotations Defined section earlier in this chapter for more
infor mation about annotations.)
If the corresponding menu item is not checked, the Case 0 expression
invokes the ShowAnnotationGroup method to show all of the
annotations on the image I.
If desired , you can inclu de t he
name o f t he specif ic anno -
t at ion group t o show or
hide w hen calling t he
Show Annot at ionGroup or
HideAnnot at ionGroup
met hods.
2TKXCVG 5WD OPW#PPQVCVKQP+VGOA%NKEM+PFGZ #U +PVGIGT)

5GNGEV %CUG +PFGZ

%CUG 0 '5JQY #PPQVCVKQPU
+H OPW#PPQVCVKQP+VGO+PFGZ)%JGEMGF - 6TWG 6JGP
OPW#PPQVCVKQP+VGO+PFGZ)%JGEMGF - (CNUG
kdkImqEd1tI.H1deAnnotat1onOrou
'NUG
OPW#PPQVCVKQP+VGO+PFGZ)%JGEMGF - 6TWG
kdkImqEd1tI.ShowAnnotat1onOrou
'PF +H

%CUG 1 '5JQY #PPQVCVKQP 6QQNDCT
+H OPW#PPQVCVKQP+VGO+PFGZ)%JGEMGF - 6TWG 6JGP
OPW#PPQVCVKQP+VGO+PFGZ)%JGEMGF - (CNUG
MFM+OI'FKV1*KFG#PPQVCVKQP6QQN2CNGVVG
'NUG
OPW#PPQVCVKQP+VGO+PFGZ)%JGEMGF - 6TWG
MFM+OI'FKV15JQY#PPQVCVKQP6QQN2CNGVVG
'PF +H

'PF 5GNGEV
'PF 5WD
6
Image-Enabling Web Pages
This chapter explains how to use the Imaging ActiveX controls to
image- enable your Web pages.
The chapter begins by showing you how to declare and define the
Imaging ActiveX controls in a Java applet and HTML source file. It
continues by explaining how to access the on- line help for the controls
within Microsoft Visual J+ + . The chapter concludes by walking you
through a sample demonstration project to help you get started.
In This Chapt er
Image-Enabling a Web Page ...................................................... 236
Obt aining Help .......................................................................... 245
Demonst rat ion Project ............................................................... 247
Chapt er 6
236
Image-Enabling a Web Page
This sect ion explains how t o
use a Java applet and some
HTML source code t o image-
enable a Web page. It
assumes t hat you are using
Microsof t Visual J++ t o
develop t he applet .
Image- enabling a Web page involves a ser ies of programming steps
within two source files, specifically a:
s
Java applet source file, and a
s
HyperText Markup Language (HTML) source file.
These programming steps establish two- way communication between the
code in the Java applet and the Imaging ActiveX controls on the Web
page.
The code in the Java applet manipulates the controls on the Web page.
Within your Java source code, you can set properties, invoke methods,
and respond to events to provide a var iety of Imaging functions to your
Web page audience.
The code in the HTML file defines the controls as well as the Java applet
on the Web page. Within your HTML source code, you pass control
object references to the Java applet for processing.
Java Applet
Before you can manipulate the Imaging ActiveX controls in Java, you
must import their type librar ies as Java classes and declare an object
reference for each control. Then you must connect the logic in the Java
applet to the controls on the Web page.
Import ing Type Libraries
The process of importing type librar ies creates Java classes that represent
each Imaging ActiveX control within the applet.
You can use the Java Type Library Wizard within Visual J+ + to search for
the Imaging ActiveX control type librar ies and create the Java interfaces
for them. The interfaces allow you to access the properties, methods, and
events of the controls.
To import the Imaging ActiveX control type libraries
1 Start Visual J+ + and create a new applet project.
2 On the Tools menu, click Java Type Library Wizard.
Not e: You can image-enable Web pages using Imaging f or Window s
Prof essional Edit ion and Imaging f or Window s 98 only.
Type libraries st ore inf ormat ion
about COM object s like t he
Imaging Act iveX cont rols. This
inf ormat ion can include
classes, int erf aces,
dispint erf aces, et c.
A libr ary is select ed w hen a
check mark appears next t o it .
Image-Enabli ng a Web Page
237
3 On the Java Type Library Wizard dialog box, select the type
librar ies that cor respond to the Imaging ActiveX controls registered
on your system.
The following list shows how the Imaging ActiveX controls appear
on the wizard dialog box:
s
Kodak Image Admin Control
s
Kodak Image Edit Control
s
Kodak Image Ocr Control
s
Kodak Image Scan Control
s
Kodak Image Thumbnail Control
4 Click OK and look at the Visual J+ + Output window. The window
displays the Import statements for each Imaging ActiveX control
interface the wizard has created.
The following table lists the import statements of each Imaging
ActiveX control.
Not e: The name Wang appears inst ead of Kodak w hen using Imaging
f or Window s Prof essional Edit ion V1.0 and V1.1. (The East man
Kodak Company acquired Wang Sof t w are, t he sof t w are unit of
Wang Laborat ories, Inc. in 1997, t hereby creat ing East man
Sof t w are, Inc.)
The Image OCR cont rol is available w it h Imaging f or Window s
Prof essional Edit ion only.
Imaging Act iveX Import St at ement s
Import St at ement Imaging Act iveX Cont rol
import imgadmin.*; Image Admin
import imgedit.*; Image Annotation Tool Button
import imgedit.*; Image Edit
import imgocr.*; Image OCR
import imgscan.*; Image Scan
import imgthumb.*; Image Thumbnail
import olepro32.*; (Include once for all controls)
Chapt er 6
238
5 Copy the Imaging ActiveX import statements into the Imports area
of your Java source code.
6 In addition, include the following import statement in the Imports
area:
Import com.ms.com.Variant
As an example, the following code snippet shows the required import
statements for two Imaging ActiveX controls: Image Edit and Image
Thumbnail.
7 To see a list of the properties, methods, events, and parameter types
supported by each Imaging ActiveX control, click the appropr iate
summary.txt file inside the Output window.
The summary file you click appears within the Developer Studio.
You can set the properties, call the methods, and respond to the
events listed.
The Imaging Act iveX cont rols
use Var iant s as par amet ers.
Import ing t he com.ms.com.
Variant package creat es
Variant paramet ers.
//''''''''''''''''''''''''''''''''''''''''''''
// O[CRRNGVLCXC #RRNGV
//''''''''''''''''''''''''''''''''''''''''''''
KORQTV LCXCCRRNGV'
KORQTV LCXCCYV'
KORQTV LCXCKQ'
KORQTV LCXCPGV'
1mort 1mqed1t.^:
1mort 1mqthumb.^:
1mort oero82.^:
1mort com.ms.com.Var1ant:
Not e: The Java Type Library Wizard creat es one subf older w it hin t he
Java t rust ed library subf older t ypically c:\w indow s\java\t rust lib
f or each Imaging Act iveX t ype library import ed.
The w izard populat es each subf older w it h .class f iles, one f or
each COM class and/or int erf ace described in t he t ype library. All
of t he generat ed classes and int erf aces are part of t he Java pack-
age f or t he respect ive Imaging Act iveX t ype library.
Image-Enabli ng a Web Page
239
Declaring Object Ref erences
Declar ing an object reference for each control enables you to use that
reference when accessing the properties, methods, or events of the
control.
To declare object references for the Imaging ActiveX controls
s
Within the Main class of your Java applet, declare an object reference
for each Imaging ActiveX control you are going to use.
The following table lists the class names of each Imaging ActiveX
control.
Imaging Act iveX Class Names
Class Name Imaging Act iveX Cont rol
_DImgAdmin Image Admin
__DImgAnnTool Image Annotation Tool Button
__DImgEdit Image Edit
__DImgocr Image OCR
__DImgScan Image Scan
__DImgThumbnail Image Thumbnail
Chapt er 6
240
As an example, the following code snippet shows the proper object
reference declarations for two Imaging ActiveX controls: Image Edit
and Image Thumbnail.
Connect ing t he Applet t o t he Cont rols
Javas setControl method enables you to save an object reference to each
Imaging ActiveX control on the Web page. Saving references establishes a
connection between the Java applet code and the controls on the Web
page, making it possible for the controls to be manipulated by the Java
applet.
Scr ipting code in the HTML file invokes the setControl method when
the Web page loads. The invocation includes arguments that pass control
object references to the Java applet.
//-----------------------------------------------------
// /CKP %NCUU HQT CRRNGV O[CRRNGV
//-----------------------------------------------------
RWDNKE ENCUU O[CRRNGV GZVGPFU #RRNGV KORNGOGPVU 4WPPCDNG
]

$WVVQPD.QCF+OCIG
$WVVQPD4QVCVG
$WVVQPD0GZV2CIG
$WVVQPD2TGX2CIG

%QORQPGPV E.QCF+OCIG
%QORQPGPV E4QVCVG
%QORQPGPV E0GZV2CIG
%QORQPGPV E2TGX2CIG

KPV2CIG%QWPV

DImqEd1t theImaqe:
DImqThumbna1 theThumb:



Image-Enabli ng a Web Page
241
To connect the Imaging ActiveX controls
1 Include the setControl method in the applet source code.
2 Include code that saves each control reference passed.
The following code snippet shows saving a reference to the Image
Thumbnail control.
HTML File
To complete the process of image- enabling your Web page, you must
define the Java applet and the Imaging ActiveX controls in an HTML
file. Then you must invoke the setControl method in the Java applet to
complete the connection between the Java applet and the controls on the
Web page.
Def ining t he Applet and t he Cont rols
The process of defining the applet and the Imaging ActiveX controls
enables you to include them on your Web page.
To define an applet and the Imaging ActiveX controls
1 Create an HTML file using the program of your choice.
2 Include the usual initial HTML command elements, such as < html> ,
< head> , < title> , < body> , etc.
3 Define the Java applet by including the < applet> command element
and setting its properties.
As a minimum, the applet definition must contain the name of the
applet class (code attr ibute) as well as its initial dimensions in pixels
(width, height attr ibutes). It can also contain other attr ibutes, such as
the name of the applet (name attr ibute) and the alignment of the
applet window (align attr ibute).
RWDNKE XQKF UGV%QPVTQN1DLGEV VJWODEVN)
]
// UCXG VJG VJWOD PCKN EQPVTQN RCUUGF KP
theThumb - DImqThumbna1) thumbct:
_
Chapt er 6
242
An applet definition can also contain one or more param element
definitions along with the name and value attr ibutes of each. If
desired, you can use the param elements to pass values to the applet.
4 Define each Imaging ActiveX control you want to use by including
the < object> command element and setting its properties.
As a minimum, each object definition must contain a class identifier
(classid attr ibute), name identifier (id attr ibute), as well as its initial
dimensions in pixels (width, height attr ibutes). It can also contain
other attr ibutes, such as the alignment of the object (align attr ibute).
An object definition can also contain one or more param element
definitions along with the name and value attr ibutes of each. If
desired, you can use the param elements to pass values to the object.
CRRNGV
EQFG-O[CRRNGVENCUU
PCOG-O[CRRNGV
YKFVJ-4b
JGKIJV-40
CNKIP - VQR
RCTCO PCOG-KOCIG XCNWG-O[KOCIGVKH
/CRRNGV
You can use t he Visual J+ +
OLE/COM Object View er t o see
regist ry inf ormat ion f or each
Imaging Act iveX cont rol.
You can also use t he view er t o
copy t he class id ent if ier and
t he HTM L object def init ion t o
t he Clipboard.
QDLGEV
ENCUUKF-ENUKF'1#b$8#0ob0o101%#%b'0404009%0
KF-KOIVJWODEVTN
YKFVJ-140
JGKIJV-bb
CNKIP-NGHV

RCTCO PCOG-$CEM%QNQT XCNWG-=HHHHHH


/QDLGEV
Image-Enabli ng a Web Page
243
The following table lists the class identifiers of each Imaging ActiveX
control.
Complet ing t he Connect ion
Earlier, you included the setControl method in your Java applet to
connect the logic in the Java applet to the controls on the Web page.
Now you must invoke the setControl method with the appropr iate
parameters in order for it to perform its work.
You need to include some scr ipting code within your HTML file that
perfor ms this task. The scr ipting code invokes the setControl method in
the Java applet, passing to it an object reference to each Imaging ActiveX
control that has been defined in the HTML file.
Once invoked, the setControl method saves each object reference
passed, thereby completing the connection between the Java applet and
the controls on the Web page. You can now manipulate each control
from within your Java applet.
Imaging Act iveX Class Ident if iers
Class Ident if ier Cont rol
{009541A0- 3B81- 101C- 92F3- 040224009C02} Image
Admin
{6D940285- 9F11- 11CE- 83FD- 02608C3EC08A} Annotation
Tool Button
{6D940280- 9F11- 11CE- 83FD- 02608C3EC08A} Image
Edit
{8FC248E3- D4D9- 11CF- 8727- 0020AFA5DCA7} Image
OCR
{84926CA0- 2941- 101C- 816F- 0E6013114B7F} Image
Scan
{E1A6B8A0- 3603- 101C- AC6E- 040224009C02} Image
Thumbnail
Chapt er 6
244
To complete the connection
1 Use VBScr ipt (or some other scr ipting language) to invoke the
setControl method when the _onLoad event fires.
2 Within the call to setControl, pass an object reference to each
Imaging ActiveX control defined in the HTML file.
The following code snippet shows passing an object reference to the
Image Thumbnail control.
The w indow _onLoad event
f ires immediat ely af t er t he
brow ser f inishes loading a
w indo w or all of t he f rames
w it hin a < FRAM ESET> t ag.
UETKRV NCPIWCIG-8$5ETKRV
!
UWD 9KPFQYA1P.QCF
FQEWOGPVKOIEVNUUGV%QPVTQN KOIVJWODEVTN
GPF UWD

/UETKRV
Obt aini ng Help
245
Obt aining Help
This sect ion explains how t o
access t he on-line help
syst em of t he Imaging
Act iveX cont rols.
You can access the Imaging ActiveX Controls on- line help system within
Visual J+ + or directly from Windows Explorer.
Visual J++
Imaging ActiveX help is accessible from the Properties window when
you are editing a dialog box resource.
To access Imaging ActiveX help from the Properties window
1 Insert an Imaging ActiveX control onto a dialog box as you would
any other type of ActiveX control. Make sure the control has the
focus.
2 On the View menu, click Properties. The Properties window
appears.
3 Click the desired property in the Properties window and then press
F1. The help topic for the selected property appears.
Not e: Several met hods in t he Imaging Act iveX cont rols present dialog
boxes t o t he end user. Each dialog box provides it s ow n cont ext -
sensit ive help, w hich t he user can invoke by clicking t he
quest ion mark at t he t op of t he dialog box and t hen t he desired
cont rol.
Not e: You can navigat e t o t he ot her t opics of t he help syst em by
clicking t he Help Topics but t on.
Keep in mind t hat it is only t he design-t ime propert ies t hat
appear in t he Propert ies w indow.
If t he propert y you select is an ext ender propert y, t he cont ent s
w indow f or t he Imaging Act iveX help syst em appears.
Chapt er 6
246
Windows Explorer
To access Imaging ActiveX help from Windows Explorer
1 Navigate to the folder where you installed Windows.
2 Open the System subfolder.
3 Click the imgocxd.hlp file. The contents window for the Imaging
ActiveX help system appears.
From the contents window, you can navigate to the topics that
descr ibe the properties, methods, and events of the controls.
Access t he Imaging Act iveX
help syst em f rom Explorer
w hen you cannot access it
w it hin Visual J+ + .
Not e: When using Imaging f or Window s Prof essional Edit ion V1.0 and
V1.1, t he name of t he help f ile is wangocxd.hlp.
Demonst rat ion Project
247
Demonst rat ion Project
This sect ion demonst rat es
how t o use t he Imaging
Act iveX cont rols wit hin a
Java applet and HTML source
f ile t o image-enable a Web
page.
While a wide-ranging
discussion of Imaging
f unct ions is beyond t he
scope of t his chapt er, t he
inf ormat ion present ed here
is suf f icient t o get st art ed.
The demonst rat ion applet
along wit h it s companion
HTML code was
developed using Microsof t
Visual J++, Version 1.1.
To help you use the Imaging ActiveX controls to image- enable a Web
page, Eastman Software, Inc. has prepared a demonstration project
called Imgctls that shows you how to:
s
Display an image file in an Image Edit control and in an Image
Thumbnail control.
s
R otate an image page.
s
Navigate the pages of a multipage image file.
Before walking through the demonstration project, read the following
sections, which explain the concepts of rotating an image and working
with thumbnail captions. Chapter 4 in this guide explains the concepts of
displaying an image in the Image Edit and Image Thumbnail controls
and of multipage image files.
Rot at ing an Image Def ined
The Image Edit control provides several methods that let you add image
rotation functions to your image- enabled applet or application.
Most image application developers make rotation functions available to
their end users. Doing so lets users rotate one or more image pages to
the r ight or to the left so the pages may be viewed in their proper
or ientation.
Not e: The on-line help syst em and Chapt ers 7 t hrough 11 of t his guide
ident if y t he propert ies, met hods, event s, paramet ers, and
const ant s t hat are available in each version of Imaging f or
Window s.
Keep in mind t hat image-enabling a Web page is available t o
users of Imaging f or Window s Prof essional Edit ion and Imaging
f or Window s 98 only.
Chapt er 6
248
The following list br iefly descr ibes the methods youll find useful when
including rotation functions in your applet or application (refer to
Chapters 7 through 11 in this guide for more specific information).
Rotate Displays a dialog box that lets end users rotate one or all of the
pages in an image document file. End users can specify the degree of
rotation applied as well as the direction.
Rotate All R otates all of the pages in an image document file to the
degree and in the direction specified and then saves the file.
Rotate Right R otates an image page 90 degrees to the r ight, or to
the degree specified.
Rotate Left R otates an image page 90 degrees to the left, or to the
degree specified.
You can also use t he Flip
met hod t o rot at e an image
page by 180 degrees.
Not e: The Rot at e met hod is available w it h all versions of Imaging f or
Window s Prof essional Edit ion. The Rot at eAll met hod is avail-
able w it h Imaging f or Window s Prof essional Edit ion Version 2.0
only.
Not e: Specif ying a rot at ion ot her t han 90 degrees is available w it h
Imaging f or Window s Prof essional Edit ion and Imaging f or
Window s 98 only.
Demonst rat ion Project
249
Thumbnail Capt ions Def ined
As you know from reading Chapter 4, the Image Thumbnail control lets
users view each page of an image document file in miniature boxes called
thumbnails there is one thumbnail image for each page in the file.
You may not know that each thumbnail image can optionally have a
caption beneath it that indicates its page position within the image file as
well as an annotation indicator that shows whether one or more
annotation marks exist on a cor responding image page.
Annot at ion
Indicat or
Capt ion
Chapt er 6
250
The caption can be customized if desired (as was done in the preceding
figure). You can use the Image Thumbnail controls reserved symbols
such as the number sign (# ) and the aster isk (*) to represent each
page number as well as the total number of pages in the image file.
For example, you can display captions such as:
s
Page 1 of 20
s
Page 2 of 20
s
Page 3 of 20
by specifying the following custom str ing:
Page # of *
As you might guess, the Image Thumbnail control provides several
properties that let you manage captions. Customizing and for matting
captions can add a nice, professional appearance to your image- enabled
applets and applications.
The following list br iefly descr ibes the properties youll find useful when
working with thumbnail captions (refer to Chapters 7 through 11 in this
guide for more specific infor mation).
ThumbCaptionColor Sets the text color of thumbnail captions.
ThumbCaptionFont R etur ns a font object, or sets the font
properties of thumbnail captions.
ThumbCaption Sets an optional custom caption str ing.
ThumbCaptionStyle Deter mines the type of caption that appears.
Demonst rat ion Project
251
Example
Users of your applet (or application for that matter) may want to rotate
an image page to apply the proper or ientation.
They may also want to draw attention to the pages of an image file that
have been annotated with important comments so their readers wont
miss important infor mation.
Scenario
Assume Amy uses one of your applications to scan several technical
documents in her role as a mechanical engineer for a major aeronautics
company. The letter- size, technical documents contain descr iptions and
drawings of flight surface components.
The descr iptions appear in portrait or ientation, while the drawings
appear in landscape or ientation. Because all of the pages in the document
are the same size, Amy scans them together using her automatic
document feeder (ADF)- equipped scanner.
After each document has been scanned, Amy annotates several image
pages with her technical comments. Then she publishes the documents
to the companys intranet page so employees in the field can view them
using Internet Explorer and your image- enabled Java applet.
Because you included Image Edits Rotate method in your applet, users
can rotate the drawings by 90 degrees to make them appear r ight- side up.
And they can rotate a descr iption page by 180 degrees to cor rect those
rare occasions when Amy inadvertently scanned a page upside down.
Further, because you included an Image Thumbnail control in your
applet and you set it to indicate when annotations are present, readers can
easily spot the pages that contain Amys annotated comments.
Chapt er 6
252
The Imgct rls Project
As mentioned earlier, the Imgctrls project demonstrates:
s
Displaying a multipage image document file on a Web page.
s
R otating an image page 90 degrees to the r ight.
s
Navigating the image document file.
The following figure shows the Imgctls project running in Microsoft
Internet Explorer.
The f ile name f o r t he
demonst rat ion project is
Imgctls.dsw.
Demonst rat ion Project
253
Project Overview
The Imgctrl project consists of the following source files:
Imgctls.html Contains the HTML and VBScr ipt code.
Imgctls.java Contains the Java applet code.
And it consists of the following components:
s
One Image Edit control
s
One Image Thumbnail control
s
Four Button objects
The project uses the following methods in the Image Edit and Image
Thumbnail controls to provide the display, rotate, and navigation
functions:
Display (Image Edit control) Displays the image file specified in
the Image property of the Image Edit control.
FitTo (Image Edit control) Scales the image relative to the Image
Edit control.
RotateRight (Image Edit control) R otates the image 90 degrees
to the r ight.
DisplayThumbs (Image Thumbnail control) Displays the pages
of the image file as a series of thumbnail images.
Not e: The Imgct ls Java applet is mult it hreaded. It s execut es a marquee
in addit ion t o it s Imaging f unct ions. Because it is beyond t he
scope of t his book t o discuss mult it hreading, any code
associat ed w it h it is ignored. If necessary, ref er t o your Java
document at ion f or inf ormat ion about mult it hreading.
Chapt er 6
254
St art ing Imgct ls
Start the Imgctls project by opening the Imgctls.html file in Inter net
Explorer. The browser begins loading the code.
In the Browser
First, the code within Imgctls.html directs the browser to define the
Imgctls applet. Once the browser defines the applet, it begins executing.
Then the code directs the browser to define the Image Edit control and
the Image Thumbnail control.
The applet definition contains the code, name, width, height, and align
attr ibutes for the Imgctls Java applet, as shown in the following code
snippet. (Note that the code passes no values to the applet via the param
element.)
CRRNGV
EQFG-KOIEVNUENCUU
PCOG-KOIEVNU
YKFVJ-4b0
JGKIJV-b0
CNKIP - VQR
RCTCO PCOG-KOCIG XCNWG-
/CRRNGV
Demonst rat ion Project
255
Each Imaging ActiveX control object definition contains the classid, id,
width, height, align, and hspace attr ibutes for the Image Edit and Image
Thumbnail controls, as shown in the following code snippet.
When the browser finishes loading the HTML code, its _onLoad event
fires. VBScr ipt within the _onLoad event invokes the setControl
method in the now- running applet, passing to it references to the Image
Edit and Image Thumbnail controls that were defined earlier.
In the Applet
Once the browser defined the Imgctls applet, it began executing. By
convention, whenever an applet executes, it invokes several methods in
ser ies: its constructor, init(), paint(), and start().
First, the Imgctls applet invokes the imgctls() method, which is its
constructor. Since there are no initialization tasks to perfor m there,
nothing happens.
QDLGEV
ENCUUKF-ENUKFb&940809(1111%'8o(&0b08%o'%08#
KF-KOIGFKVEVTN
YKFVJ-4b0
JGKIJV-bb
CNKIP-NGHV

/QDLGEV
QDLGEV
ENCUUKF-ENUKF'1#b$8#0ob0o101%#%b'0404009%0
KF-KOIVJWODEVTN
YKFVJ-140
JGKIJV-bb
CNKIP-TKIJV
JURCEG-4

/QDLGEV
UETKRV NCPIWCIG-8$5ETKRV
!
UWD 9KPFQYA1P.QCF
FQEWOGPVKOIEVNUUGV%QPVTQN KOIGFKVEVTN KOIVJWODEVTN
GPF UWD

/UETKRV
Chapt er 6
256
Next, the applet invokes the Init() method, which starts the execution of
the marquees thread; and then the paint() method, which draws the
contents of the applet window on the Web page and displays an
animation.
As soon as the applet window becomes visible on the Web page, the
applet invokes the start() method. Code within the start() method starts
the execution of the Imgctls applets thread.
When the browser finishes loading the HTML source code, its _onLoad
event fires. VBScr ipt within the _onLoad event invokes the setControl
method in the applet, passing to it references to the Image Edit and
Image Thumbnail controls defined in the HTML source code.
RWDNKE XQKF RCKPV)TCRJKEU I)
]
// #0+/#6+10 5722146
// 6JG HQNNQYKPI EQFG FKURNC[U C UVCVWU OGUUCIG WPVKN
// CNN VJG KOCIGU CTG NQCFGF 6JGP KV ECNNU FKURNC[+OCIG
// VQ FKURNC[ VJG EWTTGPV KOCIG
//
KH OAH#NN.QCFGF)
]
4GEVCPING T - IIGV%NKR4GEV)
IENGCT4GEVTZ T[ TYKFVJ TJGKIJV)
FKURNC[+OCIG#PKOCVKQPI)
_
// 61&1 2NCEG CFFKVKQPCN CRRNGV 2CKPV EQFG JGTG
_
RWDNKE XQKF UVCTV)
]
KH OAKOIEVNU -- PWNN)
]
OAKOIEVNU - PGY 6JTGCFVJKU)
OAKOIEVNUUVCTV)
_
_
Demonst rat ion Project
257
The setControl method saves these references. This action completes
the connection between the Imgctls applet and the HTML source code,
enabling the Imgctls applet to manipulate the Image Edit and Image
Thumbnail controls on the Web page.
With the functioning Imgctls applet now on your browser, you can begin
using it.
Loading an Image
To load an image, click the Load Image button on the applet window.
The action method evaluates the target argument to deter mine which
button you clicked. When you click the Load Image button, the code
invokes the LoadImage() method.
// #EEGRV VJG KOCIG CPF VJWODPCKN EQPVTQNU RCUUGF HTQO
// 9KPFQYA1P.QCF
RWDNKE XQKF UGV%QPVTQN1DLGEV KOCIG%VN 1DLGEV VJWODEVN)
]
// UCXG VJG KOCIG EQPVTQN RCUUGF KP
VJG+OCIG - A&+OI'FKV) KOCIG%VN

// UCXG VJG VJWOD PCKN EQPVTQN RCUUGF KP
VJG6JWOD - A&+OI6JWODPCKN) VJWODEVN
_
The act ion met hod of t he
applet class is overr idd en t o
int ercept t he act ion event s f or
all of t he but t ons at t ached t o
t he applet . One of t he
argument s passed t o act ion,
called target, cont ains a
ref eren ce t o t he but t on
clicked.
RWDNKE DQQNGCP CEVKQP'XGPV GXGPV 1DLGEV QDLV[RG)
]

KH GXGPVVCTIGV -- D.QCF+OCIG)
]
.QCF+OCIG)
O[%QPVGZVUJQY5VCVWU&QPG)
_

TGVWTP VTWG
_
Chapt er 6
258
The LoadImage() method (shown in the following code snippet) uses
several properties and methods to display the image document file in the
Image Edit and Image Thumbnail controls.
Specifically, it perfor ms the following tasks:
s
Sets the Image property of the Image Edit control to the value of the
sImage var iable. (You can assign the complete path and file name of
a multipage TIFF image file on your PC to the sImage var iable.)
s
Invokes the FitTo method of the Image Edit control, passing to it a:
Literal value of 1, which sets the initial fit- to setting of the Image
Edit control to the Fit to Width option.
Var iant containing the boolean value of False, which prevents the
method from refreshing the Image Edit control.
s
Sets the ImagePalette property of the Image Edit control to the
Common palette (literal value of 1 assigned to BackGround) to
prevent flicker.
s
Sets the DisplayScaleAlgorithm property of the Image Edit control
to the value of the wiScaleOptimize constant (literal 4), which
displays black- and- white images in gray scale for greater clar ity.
s
Invokes the Display method of the Image Edit control, which
displays the image specified in the Image property at the fit- to, image
palette, and display- scale options specified.
s
Sets the PageCount var iable to the value of the PageCount
property of the Image Edit control, which contains the total number
of image pages in the image document file. (The applet will use the
PageCount value later when navigating a multipage image
document.)
s
Sets the height and width of the individual thumbnail images by
setting the ThumbHeight and ThumbWidth properties of the
Image Thumbnail control.
s
Sets the Image property of the Image Thumbnail control to the
value of the sImage var iable, so the thumbnail control displays the
same image file as the Image Edit control.
s
Sets the ThumbCaptionStyle property of the Image Thumbnail
control to the value of the SimpleWithAnno constant (literal 2),
which displays a left- justified page number caption beneath each
thumbnail image along with an annotation indicator for those image
pages that have annotations.
s
Sets the ScrollDirection property of the Image Thumbnail control
to the value of the Vertical constant (literal 1), which enables the
end user to scroll the individual thumbnail images vertically.
Set t ing t he DisplayScale
Algorit hm propert y t o
Opt imize is t he recommended
w ay t o make black-and- w h it e
images appear in gr ay scale.
Color images cont inue t o
appear in co lor using t his
set t ing.
Demonst rat ion Project
259
s
Uses the ThumbCaptionFont property of the Image Thumbnail
control to retur n a thumbnail caption font object. The applet uses the
font object to change two of its properties. Specifically, it changes the
thumbnail caption font size to 4 points, and the thumbnail caption
font name to Cour ier New.
s
Invokes the DisplayThumbs method of the Image Thumbnail
control to display the thumbnail images, passing to it:
A ThumbNumber parameter value of 1 (from vPage), which sets
thumbnail image number 1 as the first thumbnail image to which
the Option parameter setting (descr ibed next) applies.
An Option parameter value of 1 (from Pos), which sets the
position of the thumbnails to the middle row within the control.
s
For page 1, sets the ThumbSelected property of the Image
Thumbnail control to True which automatically selects or gives
focus to the first thumbnail image within the control.
Chapt er 6
260
RTKXCVG XQKF .QCF+OCIG)
]
VT[
]
// TGVTKGXG KOCIG CPF UCXG CU VGOR HKNG

O[%QPVGZVUJQY5VCVWU.QCFKPI +OCIG U+OCIG)

theImaqe.utImaqesImaqe):

// UGV VJG KOCIG UECNG
8CTKCPV X1RVKQP - PGY 8CTKCPV)
X1RVKQPRWV$QQNGCPHCNUG)
UJQTV V[RG - 1
theImaqe.F1tTotye. vOt1on):

// UGV VJG KOCIG RCNGVVG VQ WUG VJG DCEMITQWPF
// VQ RTGXGPV HNKEMGT
UJQTV $CEM)TQWPF - 1
theImaqe.SetImaqePaetteBackOround):

// FKURNC[ VJG KOCIG WUKPI UECNG VQ ITC[
KPV 5ECNG6Q)TC[ - &KURNC[5ECNG%QPUVCPVUYK5ECNG1RVKOK\G
theImaqe.utD1sayScaeAqor1thmScaeToOray):

// FKURNC[ VJG KOCIG
theImaqe.D1say):
// IGV VJG PWODGT QH RCIGU
PaqeOount - theImaqe.qetPaqeOount):

E4QVCVGGPCDNG)
E.QCF+OCIGFKUCDNG)
EQPVKPWGF QP VJG PGZV RCIG)
Demonst rat ion Project
261
KH 2CIG%QWPV 1)
E0GZV2CIGGPCDNG)

// UGV VJG VJWODPCKN UK\G
KPV *GKIJV - 7b
KPV 9KFVJ - b
theThumb.utThumbHe1qhtHe1qht):
theThumb.utThumbW1dthW1dth):
// WUG VJG UCOG KOCIG CU FKURNC[GF KP VJG +OCIG %QPVTQN
theThumb.utImaqesImaqe):
// WUG VJG 5KORNG9KVJ#PPQ ECRVKQP VQ FKURNC[ RCIG PWODGT
// WPFGT VJWODPCKN
UJQTV %CRVKQP - %CRVKQP5V[NG%QPUVCPVU5KORNG9KVJ#PPQ
theThumb.utThumbOat1onStyeOat1on):


// UETQNN VJG VJWODPCKNU XGTVKECNN[
UJQTV 5ETQNN8GTVKECN - 5ETQNN%QPUVCPVU8GTVKECN
theThumb.utScroD1rect1onScroVert1ca):

// FKURNC[ VJG HKTUV VJWODPCKN RCIG
8CTKCPV X2CIG - PGY 8CTKCPV)
8CTKCPV X2QU - PGY 8CTKCPV)

KPV 2CIG - 1
UJQTV 2QU - 1
X2CIGRWV+PV2CIG)

// UGV VJG HQPV CPF UK\G QH VJG ECRVKQP KPKVKCNK\KPI KV HTQO VJG
//FGHCWNV VJWODPCKN HQPV
QNGRTQo(QPV VJG(QPV
theFont - theThumb.qetThumbOat1onFont)
NQPI (QPV5K\G - 4
theFont.utS1zeFontS1ze):
5VTKPI (QPV0COG - %QWTKGT 0GY
theFont.utNameFontName):

X2QURWV5JQTV2QU)
theThumb.D1sayThumbsvPaqe. vPos):
theThumb.utThumbSeectedI. true):
_
ECVEJ 6JTQYCDNG G)
_
Chapt er 6
262
Rot at ing t he Image
To rotate the image, click the Rotate Page button on the applet
window.
The action method evaluates the target argument to deter mine which
button you clicked. When you click the Rotate Page button, the
method invokes the RotateRight method of the Image Edit control
without passing a parameter. By default, the RotateRight method
rotates the image 90 degrees to the r ight.
Navigat ing t he Image Document File
To navigate the image, click the Next Page or Previous Page button
on the applet window. The action method (shown in the following code
snippets) evaluates the target argument to deter mine which button you
clicked.
When you click the Next Page button, the method assigns the cur rent
page number provided by the value of the Page property of the
Image Edit control to the CurrentPage local var iable.
As long as the value of CurrentPage is less than the maximum number
of pages in the file (as provided by the value of the PageCount var iable),
the method sets the Page property of the Image Edit control to the
value of CurrentPage + 1. Then it invokes the Display method of
the Image Edit control to display the next page. (Note that the
CurrentPage var iable now represents the previous page.)
RWDNKE DQQNGCP CEVKQP'XGPV GXGPV 1DLGEV QDLV[RG)
]
// TQVCVG RCIG
KH GXGPVVCTIGV -- D4QVCVG)
]
VT[
]
8CTKCPV X2CTCO - PGY 8CTKCPV)
// UGV XCTKCPV VQ PQ RCTCOGVGT RCUUGF
X2CTCOPQ2CTCO)
theImaqe.RotateR1qhtvParam):
_
ECVEJ 6JTQYCDNG G)
]
_
_

_
Demonst rat ion Project
263
After enabling or disabling the Next Page and Previous Page buttons
as you would expect, the method deals with the Image Thumbnail
control.
As the user navigates the multipage image file, having the Image
Thumbnail control synchronize automatically with the Image Edit
control would be nice. Using the ThumbSelected property of the
Image Thumbnail control, the method perfor ms this task by selecting the
thumbnail image that cor responds to the image page cur rently being
displayed.
Synchronizing the Image Thumbnail control with the Image Edit
control is actually a three step process:
1 The method sets the ThumbSelected property to the value of the
CurrentPage var iable with a Selected value of False. This action
removes the selected highlight from the thumbnail image that
corresponds to the previous page.
2 The method sets the ThumbSelected property to the value of
CurrentPage + 1 with a Selected value of True. This action
applies the selected highlight to the thumbnail image that cor-
responds to the currently displayed page.
3 The method invokes the DisplayThumbs method of the Image
Thumbnail control, passing to it:
A ThumbNumber parameter value of CurrentPage + 1 (from
vPage), which displays the thumbnail image that corresponds to
the page cur rently being displayed in the Image Edit control.
An Option parameter value of 1 (from vPos), which sets the
position of the individual thumbnail images to the middle row
within the control.
Chapt er 6
264
RWDNKE DQQNGCP CEVKQP'XGPV GXGPV 1DLGEV QDLV[RG)
]
// FKURNC[ PGZV RCIG
KH GXGPVVCTIGV -- D0GZV2CIG)
]
VT[
]
// IGV VJG EWTTGPV RCIG
1nt OurrentPaqe - theImaqe.qetPaqe):
// RQUKVKQP VQ PGZV RCIG
KH %WTTGPV2CIG 2CIG%QWPV)
]
// UGV VJG RCIG VQ VJG PGZV RCIG
theImaqe.utPaqeOurrentPaqe I):
// FKURNC[ VJG RCIG
theImaqe.D1say):
_
KH%WTTGPV2CIG 1 -- 2CIG%QWPV)
E0GZV2CIGFKUCDNG)
GNUG
E0GZV2CIGGPCDNG)
E2TGX2CIGGPCDNG)
theThumb.utThumbSeectedOurrentPaqe . fase):
theThumb.utThumbSeectedOurrentPaqe I. true):

8CTKCPV X2CIG - PGY 8CTKCPV)
8CTKCPV X2QU - PGY 8CTKCPV)
X2CIGRWV+PV%WTTGPV2CIG1)
X2QURWV5JQTVUJQTV)1)
theThumb.D1sayThumbsvPaqe. vPos):
_
ECVEJ 6JTQYCDNG G)
]
_

_

_
Demonst rat ion Project
265
When you click the Previous Page button, the method assigns the
current page number provided by the value of the Page property of
the Image Edit control to the CurrentPage local var iable.
As long as the value of CurrentPage is greater than the first page in the
file, the method sets the Page property of the Image Edit control to the
value of CurrentPage - 1. Then it invokes the Display method of
the Image Edit control to display the previous page. (Note that the
CurrentPage var iable now represents the nex t page.)
After enabling or disabling the Next Page and Previous Page buttons
as you would expect, the method deals with synchronizing the Image
Thumbnail control:
1 The method sets the ThumbSelected property to the value of the
CurrentPage var iable with a Selected value of False. This action
removes the selected highlight from the thumbnail image that
corresponds to the nex t page.
2 The method sets the ThumbSelected property to the value of
CurrentPage - 1 with a Selected value of True. This action
applies the selected highlight to the thumbnail image that
corresponds to the currently displayed page.
3 The method invokes the DisplayThumbs method of the Image
Thumbnail control, passing to it:
A ThumbNumber parameter value of CurrentPage - 1 (from
vPage), which displays the thumbnail image that corresponds to
the page displayed in the Image Edit control.
An Option parameter value of 1 (from vPos), which sets the
position of the individual thumbnail images to the middle row
within the control.
Chapt er 6
266
RWDNKE DQQNGCP CEVKQP'XGPV GXGPV 1DLGEV QDLV[RG)
]
KH GXGPVVCTIGV -- D2TGX2CIG)
]
VT[
]
// IGV VJG EWTTGPV RCIG FKURNC[GF
1nt OurrentPaqe - theImaqe.qetPaqe):
KH %WTTGPV2CIG 1)
]
// UGV VQ RTGXKQWU RCIG
theImaqe.utPaqeOurrentPaqe - I):
// FKURNC[ VJG RCIG
theImaqe.D1say):
_
KH%WTTGPV2CIG 1-- 1)
E2TGX2CIGFKUCDNG)
GNUG
E2TGX2CIGGPCDNG)
E0GZV2CIGGPCDNG)
theThumb.utThumbSeectedOurrentPaqe . fase):
theThumb.utThumbSeectedOurrentPaqe - I. true):
8CTKCPV X2CIG - PGY 8CTKCPV)
8CTKCPV X2QU - PGY 8CTKCPV)
X2CIGRWV+PV%WTTGPV2CIG 1)
X2QURWV5JQTVUJQTV)1)
theThumb.D1sayThumbsvPaqe. vPos):
_
ECVEJ 6JTQYCDNG G)
]
_
_

_
7
Image Edit /Image Annot at ion Cont rols
This chapter descr ibes the properties, methods, and events for the Image
Edit and Image Annotation controls. This chapter also descr ibes prop-
erties, methods, and events which are common to the Image OCR ,
Image Scan, Image Admin, and Image Thumbnail controls. See the
overview in this chapter for more infor mation.
In This Chapt er
Overview ................................................................................... 273
Image Edit Cont rol Overview ..................................................... 275
Image Annot at ion Tool But t on Overview .................................... 277
Annot at ionBackColor Propert y................................................... 279
Annot at ionFillColor Propert y ...................................................... 280
Annot at ionFillSt yle Propert y ....................................................... 281
Annot at ionFont Propert y ........................................................... 282
Annot at ionFont Color Propert y ................................................... 285
Annot at ionGroupCount Propert y ............................................... 286
Annot at ionImage Propert y ......................................................... 288
Annot at ionLineColor Propert y.................................................... 289
Annot at ionLineSt yle Propert y ..................................................... 291
Annot at ionLineWidt h Propert y .................................................. 292
Annot at ionOcrType Propert y ...................................................... 294
Annot at ionSt ampText Propert y .................................................. 295
Chapt er 7
268
Annot at ionText File Propert y ....................................................... 297
Annot at ionType Propert y............................................................ 298
Aut oRef resh Propert y ................................................................. 302
BorderSt yle Propert y .................................................................. 304
CompressionInf o Propert y .......................................................... 304
CompressionType Propert y ......................................................... 308
Cont inuePrint ing Propert y .......................................................... 310
Cont inueWit hout Undo Propert y ................................................ 311
Dest ImageCont rol Propert y ........................................................ 311
DisplayICM Enabled Propert y ...................................................... 313
DisplayScaleAlgorit hm Propert y .................................................. 313
Enabled Propert y........................................................................ 315
FileType Propert y ........................................................................ 316
hWnd Propert y .......................................................................... 317
Image Propert y .......................................................................... 318
ImageCont rol Propert y ............................................................... 319
ImageDisplayed Propert y ............................................................ 320
ImageHeight Propert y ................................................................ 320
ImageM odif ied Propert y............................................................. 322
ImagePalet t e Propert y ................................................................ 325
ImageResolut ionX Propert y ........................................................ 326
ImageResolut ionY Propert y ........................................................ 328
ImageScaleHeight Propert y ........................................................ 329
ImageScaleWidt h Propert y ......................................................... 331
ImageWidt h Propert y ................................................................. 333
M agnif ierZoom Propert y ............................................................ 335
M ouseIcon Propert y ................................................................... 336
M ousePoint er Propert y............................................................... 337
OcrZoneVisibilit y Propert y .......................................................... 340
Page Propert y ............................................................................ 341
PageCount Propert y ................................................................... 342
PageType Propert y...................................................................... 344
Pict ureDisabled Propert y ............................................................ 345
Pict ureDow n Propert y ................................................................ 346
Pict ureUp Propert y ..................................................................... 348
Image Edit /Image Annot at ion Cont rols
269
ReadySt at e Propert y................................................................... 349
ScrollBars Propert y ..................................................................... 350
ScrollPosit ionX Propert y ............................................................. 351
ScrollPosit ionY Propert y ............................................................. 352
ScrollShort cut sEnabled Propert y ................................................. 354
Select ionRect angle Propert y ....................................................... 356
St at usCode Propert y .................................................................. 357
UndoLevels Propert y .................................................................. 358
UseCheckCont inuePrint ing Propert y .......................................... 359
Value Propert y ........................................................................... 360
Zoom Propert y ........................................................................... 361
About Box M et hod ..................................................................... 362
AddAnnot at ionGroup M et hod................................................... 362
Aut oCrop M et hod ..................................................................... 364
Aut oDeskew M et hod ................................................................ 365
Bur nInAnnot at ions M et hod ....................................................... 367
ClearDisplay M et hod ................................................................. 370
ClipboardCopy M et hod ............................................................. 370
ClipboardCut M et hod................................................................ 372
ClipboardPast e M et hod ............................................................. 373
Complet ePast e M et hod ............................................................. 375
Convert PageType M et hod .......................................................... 377
Crop M et hod............................................................................. 378
Delet eAnnot at ionGroup M et hod ............................................... 379
Delet eImageDat a M et hod .......................................................... 381
Delet eSelect edAnnot at ions M et hod ........................................... 382
Despeckle M et hod ..................................................................... 382
Display M et hod ......................................................................... 384
DisplayBlankImage M et hod ....................................................... 386
Draw M et hod ............................................................................ 387
Draw Select ionRect M et hod ....................................................... 389
Edit Select edAnnot at ionText M et hod .......................................... 391
Execut eText Edit Command M et hod ............................................ 393
Fit To M et hod ............................................................................. 396
Flip M et hod ............................................................................... 398
Chapt er 7
270
Get Annot at ionGroup M et hod.................................................... 399
Get Annot at ionM arkCount M et hod ............................................ 401
Get Current Annot at ionGroup M et hod ........................................ 403
Get RubberSt ampIt em M et hod ................................................... 403
Get RubberSt ampM enuIt ems M et hod ......................................... 406
Get Select edAnnot at ionBackColor M et hod ................................. 408
Get Select edAnnot at ionFillColor M et hod .................................... 409
Get Select edAnnot at ionFillSt yle M et hod ..................................... 411
Get Select edAnnot at ionFont M et hod .......................................... 413
Get Select edAnnot at ionFont Color M et hod ................................. 415
Get Select edAnnot at ionImage M et hod ....................................... 417
Get Select edAnnot at ionLineColor M et hod .................................. 418
Get Select edAnnot at ionLineSt yle M et hod ................................... 420
Get Select edAnnot at ionLineWidt h M et hod ................................. 422
Get Select edAnnot at ionOcrType M et hod .................................... 424
Get Version M et hod.................................................................... 426
HideAnnot at ionGroup M et hod .................................................. 426
HideAnnot at ionToolPalet t e M et hod ........................................... 428
Invert M et hod ............................................................................ 428
IsClipboardDat aAvailable M et hod .............................................. 429
LoadAnnot at ions M et hod .......................................................... 430
M anualDeSkew M et hod ............................................................ 432
Print Image M et hod .................................................................... 432
Redo M et hod ............................................................................ 435
Ref resh M et hod ......................................................................... 436
RemoveAllOCRM arks M et hod .................................................... 437
Rot at e M et hod .......................................................................... 438
Rot at eAll M et hod ...................................................................... 440
Rot at eLef t M et hod .................................................................... 441
Rot at eRight M et hod .................................................................. 443
Save M et hod ............................................................................. 444
SaveAnnot at ions M et hod .......................................................... 447
SaveAs M et hod ......................................................................... 449
SavePage M et hod ...................................................................... 456
ScrollImage M et hod ................................................................... 461
Image Edit /Image Annot at ion Cont rols
271
Select Annot at ionGroup M et hod ................................................ 462
Select First OcrZone M et hod ........................................................ 462
Select Next OcrZone M et hod ....................................................... 463
Select Tool M et hod ..................................................................... 464
Set Current Annot at ionGroup M et hod ........................................ 466
Set ImagePalet t e M et hod ........................................................... 466
Set RubberSt ampIt em M et hod .................................................... 467
Set Select edAnnot at ionBackColor M et hod ................................. 469
Set Select edAnnot at ionFillColor M et hod ..................................... 470
Set Select edAnnot at ionFillSt yle M et hod ...................................... 472
Set Select edAnnot at ionFont M et hod .......................................... 474
Set Select edAnnot at ionFont Color M et hod .................................. 477
Set Select edAnnot at ionLineColor M et hod .................................. 480
Set Select edAnnot at ionLineSt yle M et hod .................................... 481
Set Select edAnnot at ionLineWidt h M et hod ................................. 484
Set Select edAnnot at ionOcrType M et hod ..................................... 486
Show Annot at ionGroup M et hod ................................................ 488
Show Annot at ionToolPalet t e M et hod.......................................... 489
Show At t ribsDialog M et hod ....................................................... 492
Show M agnif ier M et hod ............................................................. 494
Show PagePropert ies M et hod ..................................................... 496
Show RubberSt ampDialog M et hod ............................................. 497
Undo M et hod ............................................................................ 498
ZoomToSelect ion M et hod .......................................................... 499
BadDocument FileType Event ...................................................... 500
CheckCont inuePrint ing Event .................................................... 502
Close Event ............................................................................... 503
Edit ingText Annot at ion Event ...................................................... 505
Error Event ................................................................................. 507
ErrorSavingUndoInf ormat ion Event ............................................ 508
HyperlinkGoToDoc Event ............................................................ 508
HyperlinkGoToPage Event .......................................................... 509
Load Event ................................................................................ 510
M agnif ierSt at us Event ................................................................ 511
M arkEnd Event .......................................................................... 512
Chapt er 7
272
M arkM ove Event ....................................................................... 514
M arkSelect Event ....................................................................... 515
PagePropert iesClose Event ......................................................... 518
Past eClip Event .......................................................................... 518
Past eComplet ed Event ............................................................... 519
ReadySt at eChange Event ........................................................... 520
Scroll Event ................................................................................ 520
Select ionRect Draw n Event ......................................................... 521
St raight enPage Event ................................................................. 523
ToolPalet t eHidden Event ............................................................. 523
ToolSelect ed Event ..................................................................... 525
ToolSelect ed Event ..................................................................... 525
PageType Set t ings ...................................................................... 528
PageType Set t ings f or SaveAs and SavePage............................... 529
Annot at ion Type Set t ings ........................................................... 529
FileType Set t ings......................................................................... 530
CompressionType Set t ings.......................................................... 531
CompressionInf o Set t ings .......................................................... 531
Tool ID Set t ings .......................................................................... 532
Fully-qualif ied Image Document Names...................................... 535
Ext ender Propert ies, M et hods, and Event s.................................. 536
RGB Format ............................................................................... 540
Annot at ion St yles ...................................................................... 541
Annot at ion Types....................................................................... 542
File Types ................................................................................... 543
Pixel ........................................................................................... 544
Overview
273
Overview
Image Edit Cont rol
All properties, methods, and events in this chapter apply to the Image Edit control, with the
exception of the following five properties, which apply only to the Image Annotation
control:
Image Annot at ion Tool But t on Cont rol
The following properties descr ibed in this chapter apply to the Image Annotation Tool
Button control:
The following methods and events descr ibed in this chapter apply to the Annotation Tool
Button control:
s
DestImageControl property
s
PictureUp property
s
PictureDisabled property
s
Value property
s
PictureDown property
s
AnnotationBackColor
s
AnnotationTextFile
s
AnnotationFillColor
s
AnnotationType
s
AnnotationFillStyle
s
DestImageControl
s
AnnotationFont
s
Enabled
s
AnnotationFontColor
s
hWnd
s
AnnotationImage
s
PictureDisabled
s
AnnotationLineColor
s
PictureDown
s
AnnotationLineStyle
s
PictureUp
s
AnnotationLineWidth
s
R eadyState
s
AnnotationOcrType
s
StatusCode
s
AnnotationStampText
s
Value
s
AboutBox method
s
R eadyStateChange event
s
Draw method
Chapt er 7
274
Image Admin Cont rol
The following properties and methods descr ibed in this chapter also apply to the Image
Admin control:
Image OCR Cont rol
The following properties, methods, and events descr ibed in this chapter also apply to the
Image OCR control:
Image Scan Cont rol
The following properties and methods descr ibed in this chapter also apply to the Image
Scan control:
Image Thumbnail Cont rol
The following properties, methods, and events descr ibed in this chapter also apply to the
Image Thumbnail control:
s
StatusCode property
s
GetVersion method
s
AboutBox method
s
AboutBox method
s
R eadyStateChange event
s
GetVersion method
s
StatusCode property
s
AboutBox method
s
GetVersion method
s
Enabled property
s
AboutBox method
s
hWnd property
s
GetVersion method
s
StatusCode property
s
R eadyStateChange event
Image Edit Cont rol Overview
275
Image Edit Cont rol Overview
What t he Image Edit Cont rol Let s You Do
The Image Edit control lets you the application developer add image display,
annotation, manipulation, and management functions to applications that support 32- bit
ActiveX/ OCX controls.
What t he Image Edit Cont rol Let s 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 var ious types.
Specifically, the control supports the following file types:
Image Annot at ion
The control includes several properties, methods, and events that enable you to add
annotation functions to application programs. The annotation functions per mit your end
users to annotate displayed images.
You can set the annotation types (see page 529) you want to include in your application
programmatically, or you can invoke the standard Annotation Tool Palette (see page 533) to
include a complete set of annotation tools. Invoking the Annotation Tool Palette frees you
from wr iting several lines of code.
Not e: The Image Edit cont rol is an Act iveX cont rol in:
s
Imaging f or Window s Prof essional Edit ion V1.0, V1.1, and V2.0
s
Imaging f or Window s 98
And an OCX cont rol in:
s
Imaging f or Window s 95
s
Imaging f or Window s NT 4.0
s
AWD
s
GIF
s
TIFF
s
BMP
s
JPG
s
WIFF
s
DCX
s
PCX
s
XIF
Not e: AWD is not available w it h Imaging f or Window s NT 4.0. GIF and WIFF are available
w it h Imaging f or Window s Prof essional Edit ion V1.0, V1.1, and V2.0; and Imaging
f or Window s 98.
Chapt er 7
276
Image Manipulat ion
The Image Edit control has properties, methods, and events that enable you to add image
manipulation functions to your application programs. These functions per mit end users to
perfor m the following tasks on displayed images:
s
Convert to text (when used in conjunction with the Image OCR control)
s
Copy, cut, and paste to the Clipboard
s
Crop
s
Deskew
s
Despeckle
s
Flip
s
Invert
s
R otate
s
Scale
s
Scroll
s
Zoom
Image Document Ret rieval and St orage
The Image Edit control also includes methods that enable you to add image document
retr ieval and storage functions to application programs. These functions per mit end users to
retr ieve, save, pr int, and delete image and annotation data.
Linking Ot her Imaging Cont rols t o t he Image Edit Cont rol
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 perfor m several functions.
Image Annot at ion Tool But t on Cont rol
The Image Annotation Tool Button control links to the Image Edit control to per mit the
annotation of displayed images. The Image Annotation Tool Button control sends messages
to the Image Edit control that set annotation attr ibutes, thereby changing all of the Image
Edit annotation attr ibutes 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 Cont rol
The Image Scan control links to the Image Edit control to display images while they are
being scanned.
Image Annot at ion Tool But t on Overview
277
Est ablishing t he 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.
Image Annot at ion Tool But t on Overview
What t he Image Annot at ion Tool But t on Cont rol Let s You Do
The Image Annotation Tool Button (IATB) control lets you, the application developer, 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:
s
Discrete annotation types (see page 542)
s
The same annotation type with different annotation styles (see page 541)
s
A combination of both
Not e: The IATB cont rol is an Act iveX cont rol in:
s
Imaging f or Window s Prof essional Edit ion V1.0, V1.1, and V2.0
s
Imaging f or Window s 98
And an OCX cont rol in:
s
Imaging f or Window s 95
s
Imaging f or Window s NT 4.0
Chapt er 7
278
What t he IATB Cont rol Let s Your Users Do
Each IATB control lets your users draw text or graphical annotations on displayed image
documents.
Prerequisit es
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 per mits 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.
If your program has only one Image Annotation Tool Button control and one Image Edit
control, VB 5.0 sets these properties automatically.
Annot at ionBackColor Propert y
279
Annot at ionBackColor Propert y
Descript ion R eturns or sets the background color of an Attach- a- Note annotation object.
Available Wit h
Applies To Image Edit and Image Annotation controls.
Usage object.AnnotationBackColor[=color]
Applies To OLE_COLOR .
Remarks Use the R GB for mat (see page 540). The default color is yellow (255, 255, 0).
To ensure that the text in an Attach- a- Note annotation object will be visible against the
background, specify a background color that is significantly different from the font color set
using the AnnotationFontColor property.
See Also AnnotationFontColor property, AnnotationType property,
GetSelectedAnnotationBackColor method, SetSelectedAnnotationBackColor method.
Annot at ionBackColor Example 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.)
2TKXCVG 5WD EOF#FF)TQWRA%NKEM)
+OI'FKV1#FF#PPQVCVKQP)TQWR #EEQWPVKPI &GRV
+OI'FKV1#PPQVCVKQP6[RG - YK6GZV#VVCEJOGPV '10
+OI'FKV1Annotat1onBackOoor - XD;GNNQY
+OI'FKV1&TCY 10 10 1b0 100
'6JG WUGT OWUV OCPWCNN[ GPVGT VJG VGZV QP VJG CVVCEJOGPV
'PF 5WD
Annot at ionBackColor Example 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.)
XQKF %(TO)TQWR1P#FF)TQWR)
]
// #FFU C ITQWR CPF FTCYU C OCTM KP VJG ITQWR #PPQVCVKQP ITQWRU
// CTG PQV CEVWCNN[ ETGCVGF WPVKN C OCTM KU FTCYP KP VJG ITQWR
%5VTKPI U\%WT)TQWR
U\%WT)TQWR(QTOCV#EEQWPVKPI &GRV 'KTCPF))
// )GV VJG PCOG QH VJG ITQWR VJG WUGT ENKEMGF QP KP VJG NKUVDQZ
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
280
OA)TQWR.KUV#FF5VTKPIU\%WT)TQWR)
KHR2CTGPV&NI)
]
R2CTGPV&NI+OI'FKV1#FF#PPQVCVKQP)TQWRU\%WT)TQWR)
R2CTGPV&NI+OI'FKV15GV#PPQVCVKQP6[RG10) // YK6GZV#VVCEJOGPV // 10
R2CTGPV&NI+OI'FKV1SetAnnotat1onBackOoor0Z(((() // XD;GNNQY
8#4+#06 X9KFVJ 8A86oX9KFVJ) - 86A+ 8A+oX9KFVJ) - 1b0
8#4+#06 X*GKIJV 8A86oX*GKIJV) - 86A+ 8A+oX*GKIJV) - 100
R2CTGPV&NI+OI'FKV1&TCY10 10 X9KFVJ X*GKIJV)
_
// 6JG WUGT OWUV OCPWCNN[ GPVGT VJG VGZV QP VJG CVVCEJOGPV
_
Annot at ionFillColor Propert y
Descript ion R eturns or sets the color used to fill a Filled R ectangle annotation object.
Available Wit h
Applies To Image Edit and Image Annotation controls.
Usage object.AnnotationFillColor[=color]
Dat a Type OLE_COLOR .
Remarks Use the R GB for mat (see page 540). The default color is red (255, 0, 0).
See Also AnnotationFontColor property, AnnotationType property,
GetSelectedAnnotationFillColor method, SetSelectedAnnotationFillColor method.
Annot at ionFillColor Example VB
This example uses the AnnotationFillColor property to set the color of a Filled R ectangle
annotation to blue. The annotation is then drawn on the Image Edit control specified by
the DestImageControl property.
2TKXCVG 5WD EOF&GUV+OCIGA%NKEM)
'+H VJGTG CTG OWNVKRNG +OI'FKV EQPVTQNU YKVJKP CP CRRNKECVKQP WUG VJG
'&GUV+OCIG EQPVTQN VQ FGHKPG YJKEJ KOCIG YKPFQY VQ RNCEG CPPQVCVKQP
'OCTMU QP +OCIG%QPVTQN PCOGU YKNN FGHCWNV VQ +OI'FKV1 +OI'FKV GVE
'CV VJG VKOG VJG EQPVTQNU CTG FTCYP 6JG EQPVTQN PCOG EQWNF DG EJCPIGF
'CV FGUKIP VKOG KH FGUKTGF &TCY C UVTCKIJV NKPG QP VJG +OCIG 'FKV
'EQPVTQN YJQUG +OCIG%QPVTQN PCOG KU +OI'FKV
+OI#PP6QQN1&GUV+OCIG%QPVTQN - +OI'FKV
+OI#PP6QQN1#PPQVCVKQP6[RG - YK5VTCKIJV.KPG
+OI#PP6QQN1&TCY 10 10 100 100
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Annot at i onFillSt yle Propert y
281
'5GVU VJG #PPQVCVKQP6[RG VQ C HKNNGF TGEVCPING CPF VJG HKNN EQNQT QH VJG
'TGEVCPING VQ DNWG WUKPI 8KUWCN $CUKE EQNQT EQPUVCPVU
+OI#PP6QQN1#PPQVCVKQP6[RG - YK(KNNGF4GEV '4
+OI#PP6QQN1Annotat1onF1Ooor - XD$NWG
'&TCY VJG DNWG TGEVCPING QP VJG +OCIG 'FKV EQPVTQN YJQUG +OCIG%QPVTQN
'PCOG KU +OI'FKV1
+OI#PP6QQN1&GUV+OCIG%QPVTQN - +OI'FKV1
+OI#PP6QQN1&TCY 10 10 100 100
'PF 5WD
Annot at ionFillSt yle Propert y
Descript ion R eturns or sets the pattern used to fill image and Filled R ectangle annotation objects.
Available Wit h
Applies To Image Edit and Image Annotation controls.
Usage object.AnnotationFillStyle[=value]
Dat a Type Integer (enumerated).
Remarks The AnnotationFillStyle property is used with the following annotation types:
s
Filled R ectangle
s
Image Embedded
s
Image R eference
See Also AnnotationType property, GetSelectedAnnotationFillStyle method,
SetSelectedAnnotationFillStyle method.
Annot at ionFillSt yle Example 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.
2TKXCVG 5WD EOF&TCY.QIQA%NKEM)
'%TGCVG C PGY 8 1/ : 11 DNCEM CPF YJKVG KOCIG CV 100 FRK
+OI'FKV1&KURNC[$NCPM+OCIG 8b0 1100 100 100 YK2CIG6[RG$9
+OI'FKV1#PPQVCVKQP+OCIG - &>KOCIG>EQTRNQIQDOR
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Const ant Set t ing Descript ion
wiTransparent 0 (default) Transparent The underlying image data is visible.
wiOpaque 1 Opaque The underlying image data is obscured.
Chapt er 7
282
'.QIQ YQWNF QDUEWTG CP[ VGZV WPFGT KV KH 1RCSWG
+OI'FKV1Annotat1onF1Stye - YK1RCSWG '1
'+H KOCIG KU GODGFFGF TCVJGT VJCP TGHGTGPEGF VJG UQWTEG
'KOCIG PGGF PQV DG RTGUGPV YJGP VJG KOCIG KU FKURNC[GF
+OI'FKV1#PPQVCVKQP6[RG - YK+OCIG'ODGFFGF 'b
'+OCIG OCTM QPN[ TGSWKTGU NGHV CPF VQR RCTCOGVGTU VQ FTCY
'5VCTV PQV SWKVG JCNHYC[ CETQUU RCIG b RKZGNU HTQO VQR 1/4)
+OI'FKV1&TCY ob0 b
'PF 5WD
Annot at ionFillSt yle Example 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.
XQKF %+OI'FKV1&NI1P+OCIG5VCOR)
]
// 6JKU RNCEGU C EQORCP[ NQIQ CV VJG VQR EGPVGT QH C PGY RCIG
// %TGCVG C PGY 8 1/ : 11 DNCEM CPF YJKVG KOCIG CV 100 FRK
8#4+#06 X2CIG6[RG 8A86oX2CIG6[RG) - 86A+ // UGV VQ 2CIG6[RG HQT
// UCXGCU
8A+oX2CIG6[RG) - 1 // YK2CIG6[RG$9
8#4+#06 X4GU 8A86oX4GU) - 86A+4 8A+4oX4GU) - 100
+OI'FKV1&KURNC[$NCPM+OCIG 8b0 1100 X4GU X4GU X2CIG6[RG)
+OI'FKV15GV#PPQVCVKQP+OCIG&>>KOCIG>>EQTRNQIQDOR)
// .QIQ YQWNF QDUEWTG CP[ VGZV WPFGT KV KH 1RCSWG
+OI'FKV1SetAnnotat1onF1Stye1) // YK1RCSWG // 1
// +H KOCIG KU GODGFFGF TCVJGT VJCP TGHGTGPEGF VJG UQWTEG
// KOCIG PGGF PQV DG RTGUGPV YJGP VJG KOCIG KU FKURNC[GF
+OI'FKV15GV#PPQVCVKQP6[RGb) // YK+OCIG'ODGFFGF // b
// +OCIG OCTM QPN[ TGSWKTGU NGHV CPF VQR RCTCOGVGTU VQ FTCY
// 5VCTV PQV SWKVG JCNHYC[ CETQUU RCIG b RKZGNU HTQO VQR 1/4)
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1&TCYob0 b GXV GXV)
_
Annot at ionFont Propert y
Descript ion R eturns or sets a font objects properties. Applies to all text annotation types.
Available Wit h
Applies To Image Edit and Image Annotation controls.
Usage object.AnnotationFont
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Annot at ionFont Propert y
283
Dat a 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, descr iptions, and defaults:
The AnnotationFont property is used with the following annotation types:
s
Attach- a- Note
s
Hyperlink
s
Text
s
Text From File
s
Text Stamp
See Also AnnotationType property, GetSelectedAnnotationFont method,
SetSelectedAnnotationFont method.
Annot at ionFont Example VB
Example 1 places a customized rubber stamp at a predeter mined location on the image.
The AnnotationFont and AnnotationFontColor properties are set to deter mine the stamps
font and font color.
Example 2 shows how to change the properties of the font object identified by the
AnnotationFont property.
Propert y Dat a Type Descript ion Def ault
Bold Boolean True Selects bold attr ibute
False Deselects bold attr ibute
False
Italic Boolean True Selects italic attr ibute
False Deselects italic attr ibute
False
Name Str ing The desired font name MS San Ser if
Size Single The desired font size in points
(0 to 2048)
12
Underline Boolean True Selects underline attr ibute
False Deselects underline attr ibute
False
Str ikeThrough Boolean True Selects str ikethrough attr ibute
False Deselects str ikethrough attr ibute
False
Not e: Hyperlink annot at ions are available w it h Imaging f or Window s Prof essional Edit ion
V1.0, V1.1, and V2.0 only.
Chapt er 7
284
Example 1
2TKXCVG 5WD EOF5VCORA%NKEM)
+OI'FKV1Annotat1onFont - %QWTKGT
+OI'FKV1#PPQVCVKQP(QPV%QNQT - XD4GF
'6JKU UVCOR WUGU GODGFFGF VGZV OCETQU HQT FCVG CPF VKOG
+OI'FKV1#PPQVCVKQP5VCOR6GZV - #RRNKECVKQP TGEGKXGF QP '$ 'F ';
CV '*
+OI'FKV1#PPQVCVKQP6[RG - YK6GZV5VCOR '8
+OI'FKV1&TCY 10 10
'PF 5WD
Example 2
2TKXCVG 5WD EOF#PPQ(QPVA%NKEM)
'6JKU GZCORNG UJQYU JQY VQ EJCPIG VJG RTQRGTVKGU QH VJG HQPV QDLGEV
'KFGPVKHKGF D[ VJG #PPQVCVKQP(QPV RTQRGTV[
'6JKU YQWNF FGHKPG VJG HQPV VQ DG WUGF HQT CNN VGZV CPPQVCVKQPU
&KO #PPQ(QPV #U +(QPV&KUR
5GV #PPQ(QPV - +OI'FKV1Annotat1onFont
9KVJ #PPQ(QPV
$QNF - 6TWG
+VCNKE - 6TWG
0COG - #TKCN
5K\G - 1b
7PFGTNKPG - 6TWG
5VTKMGVJTQWIJ - 6TWG
'PF 9KVJ
'PF 5WD
Annot at ionFont Example VC++
This example places a customized rubber stamp at a predeter mined location on the image.
The AnnotationFont and AnnotationFontColor properties are set to deter mine the stamps
font and font color.
XQKF %+OI'FKV1&NI1P4WDDGT5VCOR)
]
// 2NCEGU C EWUVQOK\GF TWDDGT UVCOR CV C RTGFGVGTOKPGF NQECVKQP QP VJG
// KOCIG (QPV WUGF KU %QWTKGT CPF EQNQT KU TGF
%1NG(QPV U\(QPV6[RG
U\(QPV6[RG - +OI'FKV1)GV#PPQVCVKQP(QPV)
U\(QPV6[RG5GV0COG%QWTKGT 0GY)
+OI'FKV1SetAnnotat1onFontU\(QPV6[RG)
+OI'FKV15GV#PPQVCVKQP(QPV%QNQT0Z(() // XD4GF
// 6JKU UVCOR WUGU GODGFFGF VGZV OCETQU HQT FCVG CPF VKOG
+OI'FKV15GV#PPQVCVKQP5VCOR6GZV#RRNKECVKQP TGEGKXGF QP '$ 'F '; CV
'*)
+OI'FKV15GV#PPQVCVKQP6[RG8) // YK6GZV5VCOR // 8
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1&TCY10 10 GXV GXV)
_
Annot at i onFont Color Propert y
285
Annot at ionFont Color Propert y
Descript ion R eturns or sets the font color of text annotation objects.
Available Wit h
Applies To Image Edit and Image Annotation controls.
Usage object.AnnotationFontColor[=color]
Dat a Type OLE_COLOR .
Remarks Use the R GB for mat (see page 540). The default color is black (0, 0, 0).
The AnnotationFontColor property is used with the following annotation types:
s
Attach- a- Note
s
Hyperlink
s
Text
s
Text From File
s
Text Stamp
See Also AnnotationBackColor property, AnnotationFillColor property, AnnotationType property,
GetSelectedAnnotationFontColor method, SetSelectedAnnotationFontColor method.
Annot at ionFont Color Example VB
This example places a customized rubber stamp at a predeter mined location on the image.
The AnnotationFont and AnnotationFontColor properties are set to deter mine the stamps
font and font color.
2TKXCVG 5WD EOF5VCORA%NKEM)
+OI'FKV1#PPQVCVKQP(QPV - %QWTKGT
+OI'FKV1Annotat1onFontOoor - XD4GF
'6JKU UVCOR WUGU GODGFFGF VGZV OCETQU HQT FCVG CPF VKOG
+OI'FKV1#PPQVCVKQP5VCOR6GZV - #RRNKECVKQP TGEGKXGF QP '$ 'F ';
CV '*
+OI'FKV1#PPQVCVKQP6[RG - YK6GZV5VCOR '8
+OI'FKV1&TCY 10 10
'PF 5WD
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Not e: Hyperlink annot at ions are available w it h Imaging f or Window s Prof essional Edit ion
V1.0, V1.1, and V2.0 only.
Chapt er 7
286
Annot at ionFont Color Example VC++
This example places a customized rubber stamp at a predeter mined location on the image.
The AnnotationFont and AnnotationFontColor properties are set to deter mine the stamps
font and font color.
XQKF %+OI'FKV1&NI1P4WDDGT5VCOR)
]
// 2NCEGU C EWUVQOK\GF TWDDGT UVCOR CV C RTGFGVGTOKPGF NQECVKQP QP VJG
// KOCIG (QPV WUGF KU %QWTKGT CPF EQNQT KU TGF
%1NG(QPV U\(QPV6[RG
U\(QPV6[RG - +OI'FKV1)GV#PPQVCVKQP(QPV)
U\(QPV6[RG5GV0COG%QWTKGT 0GY)
+OI'FKV15GV#PPQVCVKQP(QPVU\(QPV6[RG)
+OI'FKV1SetAnnotat1onFontOoor0Z(() // XD4GF
// 6JKU UVCOR WUGU GODGFFGF VGZV OCETQU HQT FCVG CPF VKOG
+OI'FKV15GV#PPQVCVKQP5VCOR6GZV#RRNKECVKQP TGEGKXGF QP '$ 'F '; CV
'*)
+OI'FKV15GV#PPQVCVKQP6[RG8) // YK6GZV5VCOR // 8
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1&TCY10 10 GXV GXV)
_
Annot at ionGroupCount Propert y
Descript ion R eturns the number of annotation groups that are on an image page.
Available Wit h
Applies To Image Edit control.
Usage object.AnnotationGroupCount
Dat a 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 pr ior to reading this property.
See Also Display method, GetAnnotationGroup method, GetAnnotationMarkCount method,
SetCurrentAnnotationGroup method.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Annot at ionGroupCount Propert y
287
Annot at ionGroupCount Example VB
This example uses the AnnotationGroupCount property to deter mine the number of
groups on an image. Then it uses the GetAnnotationGroup method to get the group
names.
2TKXCVG 5WD EOF.KUV)TQWRUA%NKEM)
&KO KPV0WO)TQWRU #U +PVGIGT
&KO UVT)TQWR0COG #U 5VTKPI
&KO KPV%QWPV #U +PVGIGT
'HKPF QWV JQY OCP[ ITQWRU CTG QP VJG RCIG
KPV0WO)TQWRU - +OI'FKV1Annotat1onOrouOount
.QCF HTO)TQWR.KUV
'5KPEG KPFGZ XCNWGU QH )GV#PPQVCVKQP)TQWR UVCTV YKVJ
'0 JCXG VQ NQQR QPG NGUU VJCP VJG PWODGT QH ITQWRU
(QT KPV%QWPV - 0 6Q KPV0WO)TQWRU 1
UVT)TQWR0COG - +OI'FKV1)GV#PPQVCVKQP)TQWRKPV%QWPV)
'YTKVG PCOGU QH ITQWRU VQ C NKUVDQZ
HTO)TQWR.KUV#PPQ)TQWRU#FF+VGO UVT)TQWR0COG)
0GZV KPV%QWPV
HTO)TQWR.KUV5JQY
'PF 5WD
Annot at ionGroupCount Example VC++
This example uses the AnnotationGroupCount property to deter mine the number of
groups on an image. Then it uses the GetAnnotationGroup method to get the group
names.
$11. %(TO)TQWR1P+PKV&KCNQI)
]
%&KCNQI1P+PKV&KCNQI)
// 6JKU TQWVKPG WUGU #PPQVCVKQP)TQWR%QWPV VQ FGVGTOKPG VJG PWODGT QH
// ITQWRU QP CP KOCIG CPF VJGP IGVU VJG ITQWR PCOGU WUKPI VJG
// )GV#PPQVCVKQP)TQWR OGVJQF
KPV K0WO)TQWRU
%5VTKPI U\)TQWR0COG
KPV K%QWPV
// HKPF QWV JQY OCP[ ITQWRU CTG QP VJG RCIG
K0WO)TQWRU - R2CTGPV&NI+OI'FKV1OetAnnotat1onOrouOount)
// 5KPEG KPFGZ XCNWGU QH )GV#PPQVCVKQP)TQWR UVCTV YKVJ
// 0 JCXG VQ NQQR QPG NGUU VJCP VJG PWODGT QH ITQWRU
HQT K%QWPV - 0K%QWPV K0WO)TQWRU K%QWPV)
]
U\)TQWR0COG - R2CTGPV&NI+OI'FKV1)GV#PPQVCVKQP)TQWRK%QWPV)
// YTKVG PCOGU QH ITQWRU VQ C NKUVDQZ
OA)TQWR.KUV#FF5VTKPI U\)TQWR0COG)
_
TGVWTP 647' // TGVWTP 647' WPNGUU [QW UGV VJG HQEWU VQ C EQPVTQN
// ':%'26+10 1%: 2TQRGTV[ 2CIGU UJQWNF TGVWTP (#.5'
_
Chapt er 7
288
Annot at ionImage Propert y
Descript ion R eturns 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 Wit h
Applies To Image Edit and Image Annotation controls.
Usage object.AnnotationImage[=name]
Dat a Type Str ing.
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:
s
Image Embedded
s
Image R eference
See Also AnnotationType property, Display method, GetSelectedAnnotationImage method.
Annot at ionImage Example VB
This example places a company logo annotation at the top center of a new page.
2TKXCVG 5WD EOF&TCY.QIQA%NKEM)
'%TGCVG C PGY 8 1/ : 11 DNCEM CPF YJKVG KOCIG CV 100 FRK
+OI'FKV1&KURNC[$NCPM+OCIG 8b0 1100 100 100 YK2CIG6[RG$9
+OI'FKV1Annotat1onImaqe - &>KOCIG>EQTRNQIQDOR
'.QIQ YQWNF QDUEWTG CP[ VGZV WPFGT KV KH 1RCSWG
+OI'FKV1#PPQVCVKQP(KNN5V[NG - YK1RCSWG '1
'+H KOCIG KU GODGFFGF TCVJGT VJCP TGHGTGPEGF VJG UQWTEG
'KOCIG PGGF PQV DG RTGUGPV YJGP VJG KOCIG KU FKURNC[GF
+OI'FKV1#PPQVCVKQP6[RG - YK+OCIG'ODGFFGF 'b
'+OCIG OCTM QPN[ TGSWKTGU NGHV CPF VQR RCTCOGVGTU VQ FTCY
'5VCTV PQV SWKVG JCNHYC[ CETQUU RCIG b RKZGNU HTQO VQR 1/4)
+OI'FKV1&TCY ob0 b
'PF 5WD
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Annot at ionLineColor Propert y
289
Annot at ionImage Example VC++
This example places a company logo (image) annotation at the top, center of a new page.
XQKF %+OI'FKV1&NI1P+OCIG5VCOR)
]
// 6JKU RNCEGU C EQORCP[ NQIQ CV VJG VQR EGPVGT QH C PGY RCIG
// %TGCVG C PGY 8 1/ : 11 DNCEM CPF YJKVG KOCIG CV 100 FRK
8#4+#06 X2CIG6[RG 8A86oX2CIG6[RG) - 86A+
// UGV VQ 2CIG6[RG HQT UCXGCU
8A+oX2CIG6[RG) - 1 / YK2CIG6[RG$9
8#4+#06 X4GU 8A86oX4GU) - 86A+4 8A+4oX4GU) - 100
+OI'FKV1&KURNC[$NCPM+OCIG 8b0 1100 X4GU X4GU X2CIG6[RG)
+OI'FKV1SetAnnotat1onImaqe&>>KOCIG>>EQTRNQIQDOR)
// .QIQ YQWNF QDUEWTG CP[ VGZV WPFGT KV KH 1RCSWG
+OI'FKV15GV#PPQVCVKQP(KNN5V[NG1) // YK1RCSWG // 1
// +H KOCIG KU GODGFFGF TCVJGT VJCP TGHGTGPEGF VJG UQWTEG
// KOCIG PGGF PQV DG RTGUGPV YJGP VJG KOCIG KU FKURNC[GF
+OI'FKV15GV#PPQVCVKQP6[RGb) // YK+OCIG'ODGFFGF // b
// +OCIG OCTM QPN[ TGSWKTGU NGHV CPF VQR RCTCOGVGTU VQ FTCY
// 5VCTV PQV SWKVG JCNHYC[ CETQUU RCIG b RKZGNU HTQO VQR 1/4)
8#4+#06 GXV 8A86oGXV) - 86A'4414 / UGV VQ FGHCWNV
+OI'FKV1&TCYob0 b GXV GXV)
_
Annot at ionLineColor Propert y
Descript ion R eturns or sets the line color for line and Hollow R ectangle annotation objects.
Available Wit h
Applies To Image Edit and Image Annotation controls.
Usage object.AnnotationLineColor[=color]
Dat a Type OLE_COLOR .
Remarks Use the R GB for mat (see page 540). The default color is red (255, 0, 0).
The AnnotationLineColor property is used with the following annotation types:
s
Freehand Line
s
Hollow R ectangle
s
Straight Line
See Also AnnotationType property, GetSelectedAnnotationLineColor method,
SetSelectedAnnotationLineColor method.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
290
Annot at ionLineColor Example VB
This example draws a green line across the width of an image.
2TKXCVG 5WD EOF&TCY.KPGA%NKEM)
&KO :9KFVJ #U 1.'A:5+<'A2+:'.5
'&GVGTOKPG VJG YKFVJ QH VJG KOCIG VJKU YKNN
'YQTM GXGP KH VJG KOCIG KU UECNGF WR QT FQYP
:9KFVJ - +OI'FKV1+OCIG5ECNG9KFVJ
'NKPG YKNN DG ITGGP VTCPURCTGPV 10 RKZGNU YKFG
+OI'FKV1Annotat1onL1neOoor - XD)TGGP
+OI'FKV1#PPQVCVKQP.KPG5V[NG - YK6TCPURCTGPV '0
+OI'FKV1#PPQVCVKQP.KPG9KFVJ - 10
+OI'FKV1#PPQVCVKQP6[RG - YK5VTCKIJV.KPG '1
'&TCY VJG NKPG
'NGHV RQUKVKQP - 0 UVCTV CV NGHV UKFG)
'VQR RQUKVKQP - 100 RKZGNU HTQO VQR QH RCIG
'YKFVJ QH NKPG - YKFVJ QH KOCIG CU KV KU FKURNC[GF
'JGKIJV QH NKPG - 0 NKPG YKNN DG JQTK\QPVCN)
+OI'FKV1&TCY 0 100 :9KFVJ 0
'PF 5WD
Annot at ionLineColor Example VC++
This example draws a green line across the width of an image.
XQKF %+OI'FKV1&NI1P&TCYNKPG)
]
// 6JKU YQWNF FTCY C NKPG CETQUU VJG YKFVJ QH CP KOCIG
NQPI :9KFVJ
// &GVGTOKPG VJG YKFVJ QH VJG KOCIG VJKU YKNN YQTM GXGP KH VJG KOCIG
// KU UECNGF WR QT FQYP
:9KFVJ - +OI'FKV1)GV+OCIG5ECNG9KFVJ)
// NKPG YKNN DG ITGGP VTCPURCTGPV 10 RKZGNU YKFG
+OI'FKV1SetAnnotat1onL1neOoor0Z((00) // XD)TGGP
+OI'FKV15GV#PPQVCVKQP.KPG5V[NG0) // 0
+OI'FKV15GV#PPQVCVKQP.KPG9KFVJ10) // 10
+OI'FKV15GV#PPQVCVKQP6[RG1) // YK5VTCKIJV.KPG 1
// &TCY VJG NKPG
// NGHV RQUKVKQP - 0 UVCTV CV NGHV UKFG)
// VQR RQUKVKQP - 100 RKZGNU HTQO VQR QH RCIG
// YKFVJ QH NKPG - YKFVJ QH KOCIG CU KV KU FKURNC[GF
// JGKIJV QH NKPG - 0 NKPG YKNN DG JQTK\QPVCN)
8#4+#06 X9KFVJ 8A86oX9KFVJ) - 86A+4 8A+4oX9KFVJ) - :9KFVJ
8#4+#06 X*GKIJV 8A86oX*GKIJV) - 86A+4 8A+4oX*GKIJV) - 0
+OI'FKV1&TCY0 100 X9KFVJ X*GKIJV)
_
Annot at ionLineSt yle Propert y
291
Annot at ionLineSt yle Propert y
Descript ion R eturns or sets the line style for line and Hollow R ectangle annotation objects.
Available Wit h
Applies To Image Edit and Image Annotation controls.
Usage object.AnnotationLineStyle[=value]
Dat a Type Integer (enumerated).
Remarks The AnnotationLineStyle property is used with the following annotation types:
s
Freehand Line
s
Hollow R ectangle
s
Straight Line
See Also AnnotationLineWidth property, AnnotationType property,
GetSelectedAnnotationLineStyle method, SetSelectedAnnotationLineStyle method.
Annot at ionLineSt yle Example VB
This example draws a transparent line across the width of an image.
2TKXCVG 5WD EOF&TCY.KPGA%NKEM)
&KO :9KFVJ #U 1.'A:5+<'A2+:'.5
'&GVGTOKPG VJG YKFVJ QH VJG KOCIG VJKU YKNN YQTM GXGP KH VJG KOCIG
'KU UECNGF WR QT FQYP
:9KFVJ - +OI'FKV1+OCIG5ECNG9KFVJ
'NKPG YKNN DG ITGGP VTCPURCTGPV 10 RKZGNU YKFG
+OI'FKV1#PPQVCVKQP.KPG%QNQT - XD)TGGP
+OI'FKV1Annotat1onL1neStye - YK6TCPURCTGPV '0
+OI'FKV1#PPQVCVKQP.KPG9KFVJ - 10
+OI'FKV1#PPQVCVKQP6[RG - YK5VTCKIJV.KPG '1
'&TCY VJG NKPG NGHV RQUKVKQP - 0 UVCTV CV NGHV UKFG)
'VQR RQUKVKQP - 100 RKZGNU HTQO VQR QH RCIG
'YKFVJ QH NKPG - YKFVJ QH KOCIG CU KV KU FKURNC[GF
'JGKIJV QH NKPG - 0 NKPG YKNN DG JQTK\QPVCN)
+OI'FKV1&TCY 0 100 :9KFVJ 0
'PF 5WD
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Const ant Set t ing Descript ion
wiTransparent 0 (default) Transparent The underlying image data is visible.
wiOpaque 1 Opaque The underlying image data is obscured.
Chapt er 7
292
Annot at ionLineSt yle Example VC++
This example draws a transparent line across the width of an image.
XQKF %+OI'FKV1&NI1P&TCYNKPG)
]
// 6JKU YQWNF FTCY C NKPG CETQUU VJG YKFVJ QH CP KOCIG
NQPI :9KFVJ
// &GVGTOKPG VJG YKFVJ QH VJG KOCIG VJKU YKNN YQTM GXGP KH VJG KOCIG
// KU UECNGF WR QT FQYP
:9KFVJ - +OI'FKV1)GV+OCIG5ECNG9KFVJ)
// NKPG YKNN DG ITGGP VTCPURCTGPV 10 RKZGNU YKFG
+OI'FKV15GV#PPQVCVKQP.KPG%QNQT0Z((00) // XD)TGGP
+OI'FKV1SetAnnotat1onL1neStye0) // 0
+OI'FKV15GV#PPQVCVKQP.KPG9KFVJ10) // 10
+OI'FKV15GV#PPQVCVKQP6[RG1) // YK5VTCKIJV.KPG 1
// &TCY VJG NKPG
// NGHV RQUKVKQP - 0 UVCTV CV NGHV UKFG)
// VQR RQUKVKQP - 100 RKZGNU HTQO VQR QH RCIG
// YKFVJ QH NKPG - YKFVJ QH KOCIG CU KV KU FKURNC[GF
// JGKIJV QH NKPG - 0 NKPG YKNN DG JQTK\QPVCN)
8#4+#06 X9KFVJ 8A86oX9KFVJ) - 86A+4 8A+4oX9KFVJ) - :9KFVJ
8#4+#06 X*GKIJV 8A86oX*GKIJV) - 86A+4 8A+4oX*GKIJV) - 0
+OI'FKV1&TCY0 100 X9KFVJ X*GKIJV)
_
Annot at ionLineWidt h Propert y
Descript ion R eturns or sets the line width for line and Hollow R ectangle annotation objects.
Available Wit h
Applies To Image Edit and Image Annotation controls.
Usage object.AnnotationLineWidth[=value]
Dat a 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:
s
Freehand Line
s
Hollow R ectangle
s
Straight Line
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Annot at ionLineWidt h Propert y
293
See Also AnnotationLineStyle property, AnnotationType property,
GetSelectedAnnotationLineWidth method, SetSelectedAnnotationLineWidth method.
Annot at ionLineWidt h Example VB
This example draws a 10- pixel- wide line across the width of an image.
2TKXCVG 5WD EOF&TCY.KPGA%NKEM)
&KO :9KFVJ #U 1.'A:5+<'A2+:'.5
'&GVGTOKPG VJG YKFVJ QH VJG KOCIG VJKU YKNN YQTM GXGP KH VJG KOCIG
'KU UECNGF WR QT FQYP
:9KFVJ - +OI'FKV1+OCIG5ECNG9KFVJ
'NKPG YKNN DG ITGGP VTCPURCTGPV 10 RKZGNU YKFG
+OI'FKV1#PPQVCVKQP.KPG%QNQT - XD)TGGP
+OI'FKV1#PPQVCVKQP.KPG5V[NG - YK6TCPURCTGPV '0
+OI'FKV1Annotat1onL1neW1dth - 10
+OI'FKV1#PPQVCVKQP6[RG - YK5VTCKIJV.KPG '1
'&TCY VJG NKPG
'NGHV RQUKVKQP - 0 UVCTV CV NGHV UKFG)
'VQR RQUKVKQP - 100 RKZGNU HTQO VQR QH RCIG
'YKFVJ QH NKPG - YKFVJ QH KOCIG CU KV KU FKURNC[GF
'JGKIJV QH NKPG - 0 NKPG YKNN DG JQTK\QPVCN)
+OI'FKV1&TCY 0 100 :9KFVJ 0
'PF 5WD
Annot at ionLineWidt h Example VC++
This example draws a 10- pixel- wide line across the width of an image.
XQKF %+OI'FKV1&NI1P&TCYNKPG)
]
// 6JKU YQWNF FTCY C NKPG CETQUU VJG YKFVJ QH CP KOCIG
NQPI :9KFVJ
// &GVGTOKPG VJG YKFVJ QH VJG KOCIG VJKU YKNN YQTM GXGP KH VJG KOCIG
// KU UECNGF WR QT FQYP
:9KFVJ - +OI'FKV1)GV+OCIG5ECNG9KFVJ)
// NKPG YKNN DG ITGGP VTCPURCTGPV 10 RKZGNU YKFG
+OI'FKV15GV#PPQVCVKQP.KPG%QNQT0Z((00) // XD)TGGP
+OI'FKV15GV#PPQVCVKQP.KPG5V[NG0) // 0
+OI'FKV1SetAnnotat1onL1neW1dth10) // 10
+OI'FKV15GV#PPQVCVKQP6[RG1) // YK5VTCKIJV.KPG 1
// &TCY VJG NKPG
// NGHV RQUKVKQP - 0 UVCTV CV NGHV UKFG)
// VQR RQUKVKQP - 100 RKZGNU HTQO VQR QH RCIG
// YKFVJ QH NKPG - YKFVJ QH KOCIG CU KV KU FKURNC[GF
// JGKIJV QH NKPG - 0 NKPG YKNN DG JQTK\QPVCN)
8#4+#06 X9KFVJ 8A86oX9KFVJ) - 86A+4 8A+4oX9KFVJ) - :9KFVJ
8#4+#06 X*GKIJV 8A86oX*GKIJV) - 86A+4 8A+4oX*GKIJV) - 0
+OI'FKV1&TCY0 100 X9KFVJ X*GKIJV)
_
Chapt er 7
294
Annot at ionOcrType Propert y
Descript ion R eturns or sets the type of OCR zone to be drawn on an image page.
Available Wit h
Applies To Image Edit and Image Annotation controls.
Usage object.AnnotationOcrType[=value]
Dat a Type Integer (enumerated).
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/ wr ite TIFF images.
See Also AnnotationType property, GetSelectedAnnotationOcrType method, Image OCR control,
OcrZoneVisibility property, SelectFirstOcrZone method, SelectNextOcrZone method,
SetSelectedAnnotationOcrType method.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Const ant Set t ing Descript ion
wiOcrTypeText 0 (default) OCR Text zone Defines an area of an image con-
taining 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 Defines an area of an image
containing one or more pictures that should not be pro-
cessed 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 O CR Picture zone is
dark magenta in color.
Annot at ionSt ampText Propert y
295
Annot at ionOcrType Example 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.
2TKXCVG 5WD EOF&TCY1ET<QPGA%NKEM)
+OI'FKV1#PPQVCVKQP6[RG - YK1ET4GIKQP
+OI'FKV1Annotat1onOcrTye - YK1ET6[RG6GZV
'PF 5WD
Annot at ionOcrType Example 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.
XQKF %+OI'FKV1&NI1P&TCY1ET<QPG)
]
// 6JKU YQWNF GPCDNG VJG WUGT VQ FTCY 1%4 VGZV TGIKQPU QP CP KOCIG HQT
// \QPG TGEQIPKVKQP
+OI'FKV15GV#PPQVCVKQP6[RG1o) // YK1ET4GIKQP
+OI'FKV1SetAnnotat1onOcrTye0) // YK1ET6[RG6GZV
_
Annot at ionSt ampText Propert y
Descript ion R eturns or sets the for mat 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 Wit h
Applies To Image Edit and Image Annotation controls.
Usage object.AnnotationStampText[=stamp]
Dat a Type Str ing.
Remarks Text is placed on the image when one of the following events occurs:
s
The end user releases the left mouse button on a displayed image
s
The end user releases the left mouse button on a displayed image
s
The Draw method is invoked
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
296
The stamp text can include the following text macros:
See Also AnnotationType property, Draw method.
Example
To create an annotation text stamp that displays the current time and date in a
12- hour for mat, enter:
6KOG '+ &CVG 'F'$'[
The resulting annotation text stamp is:
6KOG 10o8 RO &CVG 070QXGODGT97
To create an annotation text stamp that displays the current time and date in a
24- hour for mat, enter:
6KOG '* &CVG 'F'$'[
The resulting annotation text stamp is:
6KOG o8 &CVG 070QXGODGT97
Macro Descript ion
%b Alphabetic abbreviation of the month; for example, Jan
%B Alphabetic full name of the month; for example, January
%d ASCII numer ic day of the month, ranging from 1 to 31
%H ASCII time in a 24- hour, hh:mm for mat, where:
hh = hour
mm = minute
%I ASCII time in a 12- hour, hh:mm Xm for mat, where:
hh = hour
mm = minute
Xm = AM or PM
%m ASCII numer ic designation of the month, ranging from 1 to 12 for January
through December respectively
%x Default Windows date for mat
%X Default Windows time for mat
%y ASCII numer ic last two digits of the year; for example, 97 for 1997
%Y ASCII numer ic full year; for example, 1997
Annot at ionText File Propert y
297
Annot at ionSt ampText Example VB
This example places a customized rubber stamp at a predeter mined location on the image.
TheAnnotationStampText property is set to the desired stamp content, which includes a
combination of text and date macros.
2TKXCVG 5WD EOF5VCORA%NKEM)
+OI'FKV1#PPQVCVKQP(QPV - %QWTKGT
+OI'FKV1#PPQVCVKQP(QPV%QNQT - XD4GF
'6JKU UVCOR WUGU GODGFFGF VGZV OCETQU HQT FCVG CPF VKOG
+OI'FKV1Annotat1onStamText - #RRNKECVKQP TGEGKXGF QP '$ 'F '; CV '*
+OI'FKV1#PPQVCVKQP6[RG - YK6GZV5VCOR '8
+OI'FKV1&TCY 10 10
'PF 5WD
Annot at ionSt ampText Example VC++
This example places a customized rubber stamp at a predeter mined location on the image.
TheAnnotationStampText property is set to the desired stamp content, which includes a
combination of text and date macros.
XQKF %+OI'FKV1&NI1P4WDDGT5VCOR)
]
// 2NCEGU C EWUVQOK\GF TWDDGT UVCOR CV C RTGFGVGTOKPGF NQECVKQP QP VJG
// KOCIG (QPV WUGF KU %QWTKGT CPF EQNQT KU TGF
%1NG(QPV U\(QPV6[RG
U\(QPV6[RG - +OI'FKV1)GV#PPQVCVKQP(QPV)
U\(QPV6[RG5GV0COG%QWTKGT 0GY)
+OI'FKV15GV#PPQVCVKQP(QPVU\(QPV6[RG)
+OI'FKV15GV#PPQVCVKQP(QPV%QNQT0Z(() // XD4GF
// 6JKU UVCOR WUGU GODGFFGF VGZV OCETQU HQT FCVG CPF VKOG
+OI'FKV1SetAnnotat1onStamText#RRNKECVKQP TGEGKXGF QP '$ 'F '; CV
'*)
+OI'FKV15GV#PPQVCVKQP6[RG8) // YK6GZV5VCOR // 8
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1&TCY10 10 GXV GXV)
_
Annot at ionText File Propert y
Descript ion R eturns or sets the fully- qualified file name of a text file to embed into an image.
Available Wit h
Applies To Image Edit and Image Annotation controls.
Usage object.AnnotationTextFile[=filename]
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
298
Dat a Type Str ing.
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.
See Also AnnotationType property.
Annot at ionText File Example 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.
2TKXCVG 5WD EOF5GNGEV6QQNA%NKEM)
'+H VJG CPPQVCVKQP VQQN RCNGVVG KU WVKNK\GF YKVJKP CP CRRNKECVKQP
'5GNGEV6QQN UJQWNF DG WUGF TCVJGT VJCP UGVVKPI VJG
'#PPQVCVKQP6[RG RTQRGTV[ HQT FTCYKPI OCTMU RTQITCOCVKECNN[
+OI'FKV15GNGEV6QQN 9 '6GZV HTQO HKNG
+OI'FKV1Annotat1onTextF1e - %>VGZV>FKUENCKOVZV
+OI'FKV1&TCY 0 0
'PF 5WD
Annot at ionText File Example 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.
XQKF %+OI'FKV1&NI1P5GNGEV6QQN)
]
// 7UGU VJG 5GNGEV6QQN OGVJQF VQ UGNGEV VJG 6GZV HTQO HKNG CPPQVCVKQP
// V[RG 1XGTNC[U VGZV HTQO C VGZV HKNG QPVQ KOCIG +H VJG CPPQVCVKQP
// VQQN RCNGVVG KU WVKNK\GF YKVJKP CP CRRNKECVKQP 5GNGEV6QQN
// UJQWNF DG WUGF TCVJGT VJCPUGVVKPI VJG #PPQVCVKQP6[RG RTQRGTV[ HQT
// FTCYKPI OCTMU RTQITCOCVKECNN[
+OI'FKV15GNGEV6QQN9) // 6GZV HTQO HKNG
+OI'FKV1SetAnnotat1onTextF1e%>>VGZV>>FKUENCKOVZV)
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1&TCY10 10 GXV GXV)
_
Annot at ionType Propert y
Descript ion R eturns or sets the type of annotation to be drawn.
Available Wit h
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Annot at ionType Propert y
299
Applies To Image Edit and Image Annotation controls.
Usage object.AnnotationType[=value]
Dat a Type Integer (enumerated).
Prerequisit e Propert ies
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:
The Draw method generates an er ror if it is invoked without the required property
being set.
Not e: Hyperlink and OCR Zone annot at ion t ypes are available w it h Imaging f or Window s
Prof essional Edit ion V1.0, V1.1, and V2.0 only.
Const ant Set t ing Descript ion
wiNone 0 (default) None
wiStraightLine 1 Straight Line
wiFreehandLine 2 Freehand Line
wiHollowRect 3 Hollow R ectangle
wiFilledRect 4 Filled R ectangle
wiImageEmbedded 5 Image Embedded
wiImageReference 6 Image R eference
wiText 7 Text
wiTextStamp 8 Text Stamp
wiTextFromFile 9 Text From File
wiTextAttachment 10 Attach- a- Note
wiAnnotation
Selection
11 Select Annotations
wiHyperlink 12 Hyperlink
wiOcrRegion 13 OCR Zone
Prerequisit e Propert y Annot at ion Type
AnnotationImage Image Embedded
AnnotationImage Image R eference
AnnotationStampText Text Stamp
AnnotationTextFile Text From File
Chapt er 7
300
If an end user attempts to draw an annotation using the Image Annotation Tool Button
control without the required property being set, an er ror event is sent to the target Image
Edit control window. It is up to you to decide whether to present this er ror 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 Charact ers
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 Ref erence Annot at ion Remarks
The Image Embedded annotation type (setting 5) stores a copy of the actual image data.
The Image R eference annotation type (setting 6) stores the image data by reference (file
name only).
Hyperlink Annot at ion 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 (shown here), which enables them to specify the item they want the
annotation to be linked to. Hyperlink annotations can be linked to the following items:
s
An image page in a TIFF image document stored on a local or network dr ive
s
Universal R esource Locator (UR L) on the World Wide Web
Annot at ionType Propert y
301
While users can draw a Hyperlink annotation on any type of image, a Hyperlink anno-
tation can be saved to disk only when the image upon which it is drawn is saved as a TIFF
file. If end users bur n- 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
(shown below) 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 Annot at ion 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
perfor ming OCR ). Depending on the setting of the AnnotationOcrType property,
OCR zones can be text zones or picture zones.
OCR Text zones 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 underly-
ing image to text. When drawn, OCR Text zones are dark green in color.
OCR Picture zones 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 pic-
ture 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/ wr ite TIFF images. OCR Zone annotations
cannot be burned into TIFF images.
See Also AnnotationBackColor property, AnnotationFillColor property, AnnotationFillStyle
property, AnnotationFont property, AnnotationFontColor property, AnnotationImage
property, AnnotationLineColor property, AnnotationLineStyle property,
AnnotationLineWidth property, AnnotationStampText property, AnnotationTextFile
property, Value property, Draw method, AnnotationO crType property, MousePointer
property, OcrZoneVisibility property, GetAnnotationMarkCount method,
GetSelectedAnnotationBackColor method, GetSelectedAnnotationFillColor method,
GetSelectedAnnotationFillStyle method, GetSelectedAnnotationFont method,
GetSelectedAnnotationFontColor method, GetSelectedAnnotationImage method,
GetSelectedAnnotationLineColor method, GetSelectedAnnotationLineStyle method,
GetSelectedAnnotationLineWidth method, GetSelectedAnnotationO crType method,
SetSelectedAnnotationBackColor method, SetSelectedAnnotationFillColor method,
SetSelectedAnnotationFillStyle method, SetSelectedAnnotationFont method,
SetSelectedAnnotationFontColor method, SetSelectedAnnotationLineColor method,
SetSelectedAnnotationLineStyle method, SetSelectedAnnotationLineWidth method,
SetSelectedAnnotationOcrType method, ShowAttr ibsDialog method, HyperlinkGoToPage
event, HyperlinkGoToDoc event, ProcessingMode property (ImageOcr),
EditSelectedAnnotationText method.
Chapt er 7
302
Annot at ionType Example VB
This example lets the user draw OCR text regions on an image for zoned recog-
nition. 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.
2TKXCVG 5WD EOF&TCY1ET<QPGA%NKEM)
+OI'FKV1Annotat1onTye - YK1ET4GIKQP
+OI'FKV1#PPQVCVKQP1ET6[RG - YK1ET6[RG6GZV
'PF 5WD
Annot at ionType Example VC++
This example lets the user draw OCR text regions on an image for zoned recog-
nition. 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.
XQKF %+OI'FKV1&NI1P&TCY1ET<QPG)
]
// 6JKU YQWNF GPCDNG VJG WUGT VQ FTCY 1%4 VGZV TGIKQPU QP CP KOCIG HQT
// \QPG TGEQIPKVKQP
+OI'FKV1SetAnnotat1onTye1o) // YK1ET4GIKQP
+OI'FKV15GV#PPQVCVKQP1ET6[RG0) // YK1ET6[RG6GZV
_
Aut oRef resh Propert y
Descript ion R eturns or sets whether a displayed image is refreshed immediately after changes are made
to properties that can affect its visual appearance.
Available Wit h
Applies To Image Edit control.
Usage object.AutoRefresh[={True|False}]
Dat a Type Boolean.
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.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Set t ing Descript ion
True R efreshes the image immediately when changes are made to display-
related properties.
False (default) The image is not refreshed immediately.
Aut oRef resh Propert y
303
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 R efresh method, which updates the image using the cur rent settings.
When the AutoR efresh property is set to True, changing the following properties causes
the displayed image to be refreshed automatically:
s
DisplayScaleAlgor ithm
s
ImagePalette
s
ImageR esolutionX
s
ImageR esolutionY
s
ScrollBars
s
ScrollPositionX
s
ScrollPositionY
s
Zoom
See Also DisplayScaleAlgor ithm property, ImagePalette property, ImageR esolutionX property,
ImageR esolutionY property, R efresh method, ScrollBars property, ScrollPositionX
property, ScrollPositionY property, Zoom property (ImageEdit).
Aut oRef resh Example VB
This example shows several ways to or ient an image, and redisplay it automatically.
2TKXCVG 5WD EOF4QVCVGA%NKEM)
'6JKU OGVJQF FKURNC[U C FKCNQI DQZ YJKEJ CNNQYU WUGT VQ URGEKH[
'TQVCVKQP D[ FGITGGU 4GRCKPVU VJG UETGGP CWVQOCVKECNN[
'4QVCVG CNN YTKVGU VJG HKNG VQ FKUM
+OI'FKV14QVCVG 6TWG 'TQVCVG CNN RCIGU
+OI'FKV14QVCVG (CNUG 'TQVCVG EWTTGPV RCIG
'#WVQTGHTGUJ OWUV DG UGV VQ VTWG QT OWUV ECNN 4GHTGUJ CHVGT VJGUG
'OGVJQFU
+OI'FKV1AutoRefresh - 6TWG
+OI'FKV14QVCVG.GHV 'FGHCWNVU VQ 90 FGITGGU
+OI'FKV14QVCVG4KIJV 4b 'QRVKQPCNN[ ECP URGEKH[ FGITGGU
+OI'FKV1(NKR '180 FGITGGU
';QW OWUV UCXG VJG KOCIG VQ OCKPVCKP QTKGPVCVKQP
'PF 5WD
Aut oRef resh Example VC++
This example shows several ways to or ient an image, and redisplay it automatically.
XQKF %+OI'FKV1&NI1P4QVCVG)
]
// #P GZCORNG QH UQOG QH VJG FKHHGTGPV YC[U CP KOCIG EQWNF DG QTKGPVGF
// 6JKU OGVJQF FKURNC[U C FKCNQI DQZ YJKEJ CNNQYU WUGT VQ URGEKH[
// TQVCVKQP D[ FGITGGU 4GRCKPVU VJG UETGGP CWVQOCVKECNN[
// 4QVCVG CNN YTKVGU VJG HKNG VQ FKUM
+OI'FKV14QVCVG647') // TQVCVG CNN RCIGU
Chapt er 7
304
+OI'FKV14QVCVG(#.5') // TQVCVG EWTTGPV RCIG
// #WVQTGHTGUJ OWUV DG UGV VQ VTWG QT OWUV ECNN 4GHTGUJ CHVGT VJGUG
// OGVJQFU
+OI'FKV1SetAutoRefresh647')
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV14QVCVG.GHVGXV) // FGHCWNVU VQ 90 FGITGGU
8#4+#06 X4QVCVG#OV 8A86oX4QVCVG#OV) - 86A+4 8A+4oX4QVCVG#OV) - 4b
+OI'FKV14QVCVG4KIJVX4QVCVG#OV) // QRVKQPCNN[ ECP URGEKH[ FGITGGU
+OI'FKV1(NKR) // 180 FGITGGU
// ;QW OWUV UCXG VJG KOCIG VQ OCKPVCKP QTKGPVCVKQP
_
BorderSt yle Propert y
Descript ion R eturns or sets whether the control is displayed with a border.
Available Wit h
Applies To Image Edit control.
Usage object.BorderStyle[=value]
Dat a Type Integer (enumerated).
Remarks Single- line, fixed- size is the only available border style.
Available at design- time only.
CompressionInf o Propert y
Descript ion R eturns compression option infor mation for the image specified in the Image property,
and the page specified in the Page property.
Available Wit h
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Set t ing Descript ion
0 None
1 (default) Fixed Single
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
CompressionInf o Propert y
305
Applies To Image Edit control.
Usage object.CompressionInfo
Dat a Type Long.
Property settings are expressed using the following bit- wise values:
Set t ing Descript ion Not es
0 No compression options set. Applicable only to
uncompressed image
files
1 EOL Include/ expect End Of Line. Each line is ter-
minated with a standard end- of- line bit.
Not used for JPEG
compression
2 Packed Lines Byte- align new lines. Not used for JPEG
compression
4 Prefixed EOL Include/ expect, prefixed End Of Line.
Each str ip of data is prefixed by a standard end- of- line
bit sequence.
Not used for JPEG
compression
8 Compressed LTR Compressed bit order, Left- To-
R ight. The bit order for the compressed data is the most
significant bit to the least significant bit.
Not used for JPEG
compression
16 Expand LTR Expanded bit order, Left- To- R ight.
The bit order for the expanded data is the most signifi-
cant bit to the least significant bit.
Not used for JPEG
compression
32 Negate Invert black and white on expansion. Indi-
cates the setting of the Photometr ic Interpretation field
of a TIFF file.
Not used for JPEG
compression
64 Low R esolution/ High Quality Used only for JPEG
compression
128 Low R esolution/ Medium Quality Used only for JPEG
compression
256 Low R esolution/ Low Quality Used only for JPEG
compression
512 Medium R esolution/ High Quality Used only for JPEG
compression
1024 Medium R esolution/ Medium Quality Used only for JPEG
compression
2048 Medium R esolution/ Low Quality Used only for JPEG
compression
Chapt er 7
306
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.
See Also CompressionType property, Image property, Page property, SaveAs property, SavePage
method.
CompressionInf o Example VB
This example interprets the bitwise value retur ned by the CompressionInfo property. It is
limited to black- and- white compression types only.
2TKXCVG 5WD EOF%QOR+PHQA%NKEM)
'6JKU TQWVKPG KPVGTRTGVU VJG DKVYKUG XCNWG TGVWTPGF KP VJG
'%QORTGUUKQP+PHQ RTQRGTV[
'6JKU GZCORNG KU NKOKVGF VQ DNCEM CPF YJKVG EQORTGUUKQP V[RGU QPN[
&KO NPI%QOR+PHQ #U .QPI
NPI%QOR+PHQ - +OI'FKV1Oomress1onInfo
'.QCF HQTO YJKEJ JCU EJGEM DQZGU HQT XCTKQWU EQORTGUUKQP
'QRVKQPU CPF EJGEM VJG QRVKQPU YJKEJ CTG CRRNKECDNG VQ VJG HKNG
.QCF HTO%QOR+PHQ
+H NPI%QOR+PHQ #PF 1 6JGP 'HKNG JCU '1.U
HTO%QOR+PHQEJM'1.8CNWG - 1
'NUG
HTO%QOR+PHQEJM'1.8CNWG - 0
'PF +H
+H NPI%QOR+PHQ #PF 6JGP 'HKNG JCU RCEMGF NKPGU
HTO%QOR+PHQEJM2CEMGF.KPGU8CNWG - 1
'NUG
HTO%QOR+PHQEJM2CEMGF.KPGU8CNWG - 0
'PF +H
+H NPI%QOR+PHQ #PF 4 6JGP 'HKNG JCU RTGHKZ '1.U
4096 High R esolution/ High Quality Used only for JPEG
compression
8192 High R esolution/ Medium Quality Used only for JPEG
compression
16384 High R esolution/ Low Quality Used only for JPEG
compression
Set t ing Descript ion Not es
CompressionInf o Propert y
307
HTO%QOR+PHQEJM2TG'1.8CNWG - 1
'NUG
HTO%QOR+PHQEJM2TG'1.8CNWG - 0
'PF +H
+H NPI%QOR+PHQ #PF 8 6JGP '%QORTGUUGF DKV QTFGT .GHV6Q4KIJV
HTO%QOR+PHQEJM%QOR4$18CNWG - 1
'NUG
HTO%QOR+PHQEJM%QOR4$18CNWG - 0
'PF +H
+H NPI%QOR+PHQ #PF 1b 6JGP ''ZRCPFGF DKV QTFGT .GHV6Q4KIJV
HTO%QOR+PHQEJM'ZR4$18CNWG - 1
'NUG
HTO%QOR+PHQEJM'ZR4$18CNWG - 0
'PF +H
+H NPI%QOR+PHQ #PF o 6JGP
HTO%QOR+PHQEJM0GICVG8CNWG - 1 '$NCEM CPF YJKVG CTG KPXGTVGF QP
'GZRCPUKQP
'NUG
HTO%QOR+PHQEJM0GICVG8CNWG - 0
'PF +H
HTO%QOR+PHQ5JQY
'PF 5WD
CompressionInf o Example VC++
This example interprets the bitwise value retur ned by the CompressionInfo property. It is
limited to black- and- white compression types only.
XQKF %+OI'FKV&NI1P%QORTGUUKQPKPHQ)
]
%%QORTGUKQP+PHQ %QOR+PHQ
NQPI N%QOR+PHQ
N%QOR+PHQ - +OI'FKV1OetOomress1onInfo)
// HKNG JCU '1.U
KHN%QOR+PHQ o 1)
%QOR+PHQOA'1. - 647'
GNUG
%QOR+PHQOA'1. - (#.5'
// HKNG JCU RCEMGF NKPGU
KHN%QOR+PHQ o )
%QOR+PHQOA2CEMGF.KPGU - 647'
GNUG
%QOR+PHQOA2CEMGF.KPGU - (#.5'
// HKNG JCU RTGHKZ '1.U
KHN%QOR+PHQ o 4)
%QOR+PHQOA2TGHKZ'1. - 647'
GNUG
%QOR+PHQOA2TGHKZ'1. - (#.5'
// %QORTGUUGF DKV QTFGT .GHV6Q4KIJV
KHN%QOR+PHQ o 8)
%QOR+PHQOA4$1 - 647'
GNUG
Chapt er 7
308
%QOR+PHQOA4$1 - (#.5'
// 'ZRCPFGF DKV QTFGT .GHV6Q4KIJV
KHN%QOR+PHQ o 1b)
%QOR+PHQOA.64 - 647'
GNUG
%QOR+PHQOA.64 - (#.5'
// $NCEM CPF YJKVG CTG KPXGTVGF QP GZRCPUKQP
KHN%QOR+PHQ o o)
%QOR+PHQOA0GICVG - 647'
GNUG
%QOR+PHQOA0GICVG - (#.5'
%QOR+PHQ&Q/QFCN)
_
CompressionType Propert y
R eturns the compression type of the image specified in the Image property, and the page
specified in the Page property.
Available Wit h
Applies To Image Edit control.
Usage object.CompressionType
Dat a Type Integer (enumerated).
Property settings are expressed using the following values:
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Set t ing Descript ion
0 Unknown
1 No compression
2 Group3(1D)
3 Group3(Modified Huffman)
4 PackBits
5 Group4(2D)
6 JPEG
7 R eserved
8 Group3(2D)
9 LZW
CompressionType Propert y
309
Remarks The CompressionType value is independent of an image being displayed. If the image
specified in the Image and Page properties is being displayed, the value indicates the
compression type of the displayed image. If the image specified in the Image and Page
properties is not being displayed, the value indicates the compression type of the image
specified in the Image property.
Available at run- time as read- only.
See Also CompressionInfo property, Image property, Page property, SaveAs method, SavePage
method.
CompressionType Example VB
This example uses the CompressionType property to deter mine the compression type of
the image specified in the Image property.
2TKXCVG 5WD EOF%QOR6[RGA%NKEM)
'4GCFU VJG %QORTGUUKQP6[RG RTQRGTV[ VQ FGVGTOKPG VJG
'EQORTGUUKQP V[RG QH VJG KOCIG URGEKHKGF KP VJG +OCIG RTQRGTV[
&KO UVT+OI%QOR6[RG #U 5VTKPI
'4GCF VJG %QORTGUUKQP6[RG CPF VTCPUNCVG VJG XCNWG VQ C EQTTGURQPFKPI
'UVTKPI
5GNGEV %CUG +OI'FKV1Oomress1onTye
%CUG 0
UVT+OI%QOR6[RG - 7PMPQYP
%CUG 1
UVT+OI%QOR6[RG - 0Q %QORTGUUKQP
%CUG
UVT+OI%QOR6[RG - )TQWRo1&)
%CUG o
UVT+OI%QOR6[RG - )TQWRo/QFKHKGF *WHHOCP)
%CUG 4
UVT+OI%QOR6[RG - 2CEM$KVU
%CUG b
UVT+OI%QOR6[RG - )TQWR4&)
%CUG b
UVT+OI%QOR6[RG - ,2')
%CUG 7
UVT+OI%QOR6[RG - 4$#
%CUG 8
UVT+OI%QOR6[RG - )TQWRo&)
%CUG 9
UVT+OI%QOR6[RG - .<9
'PF 5GNGEV
'&KURNC[ VJG EQORTGUUKQP V[RG QP C HQTO HQT KPHQTOCVKQPCN RWTRQUGU
'QT VQ CNNQY OQFKHKECVKQPU
HTO+PHQNDN+OI+PHQ0)%CRVKQP - UVT+OI%QOR6[RG
'PF 5WD
Chapt er 7
310
Cont inuePrint ing Propert y
Descript ion Sets whether to cancel or continue pr inting.
Available Wit h
Applies To Image Edit control.
Usage object.ContinuePrinting[={True|False}]
Dat a Type Boolean.
Remarks Before you can use the ContinuePr inting property, the UseCheckContinuePrinting
property must be set to True.
When you use the ContinuePr inting property, you must set it within the
CheckContinuePrinting event. This action is required because the ContinuePr inting
property is initialized to True upon entry into the event.
The ContinuePr inting property indicates whether to cancel or continue pr inting when the
CheckContinuePr inting event fires. The CheckContinuePr inting event fires whenever a
pr int operation requests whether it should cancel or continue pr inting (typically, whenever
a page is pr inted). The ContinuePr inting property provides the event with the desired
response.
Available at run- time as wr ite- only.
See Also CheckContinuePr inting event, Pr intImage method, UseCheckContinuePr inting property.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 98
Imaging for Windows 95
Imaging for Windows NT 4.0
Set t ing Descript ion
True (default) Continue pr inting.
False Cancel pr inting.
Cont inueWit hout Undo Propert y
311
Cont inueWit hout Undo Propert y
Descript ion Sets whether to cancel an undo operation, or continue it without the undo infor mation.
Available Wit h
Applies To Image Edit control.
Usage object.ContinueWithoutUndo[={True|False}]
Dat a Type Boolean.
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 infor mation. The Er rorSavingUndoInfor mation
event fires whenever an operation cannot save the infor mation required to undo it. The
ContinueWithoutUndo property provides the desired processing alternative.
Available at run- time as wr ite- only.
Dest ImageCont rol Propert y
Descript ion R eturns or sets the link to the Image Edit control.
Available Wit h
Applies To Image Annotation control.
Usage object.DestImageControl[=controlname]
Dat a Type Str ing.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 98
Imaging for Windows 95
Imaging for Windows NT 4.0
Set t ing Descript ion
True (default) Continue the undo operation without the undo infor mation.
False Cancel the undo operation.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
312
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 for m.
The Image Annotation Tool Button control links to the Image Edit control to per mit the
annotation of displayed images. The Image Annotation Tool Button control sends messages
to the Image Edit control that set annotation attr ibutes, thereby changing all of the Image
Edit annotation attr ibutes to the values set within the Image Annotation Tool Button
control. When the Draw method is invoked, the Image Edit control draws the annotation.
See Also Draw method, ImageControl property (ImageEdit).
Dest ImageCont rol Example VB
In this example, the DestImageControl property deter mines which Image Edit control will
draw Image Annotation Tool Button annotations.
2TKXCVG 5WD EOF&GUV+OCIGA%NKEM)
'+H VJGTG CTG OWNVKRNG +OI'FKV EQPVTQNU YKVJKP CP CRRNKECVKQP WUG VJG
'&GUV+OCIG EQPVTQN VQ FGHKPG YJKEJ KOCIG YKPFQY VQ RNCEG CPPQVCVKQP
'OCTMU QP +OCIG%QPVTQN PCOGU YKNN FGHCWNV VQ +OI'FKV1 +OI'FKV GVE
'CV VJG VKOG VJG EQPVTQNU CTG FTCYP 6JG EQPVTQN PCOG EQWNF DG
'EJCPIGF CV FGUKIP VKOG KH FGUKTGF
'&TCY C UVTCKIJV NKPG QP VJG +OCIG 'FKV EQPVTQN YJQUG
'+OCIG%QPVTQN PCOG KU +OI'FKV
+OI#PP6QQN1DestImaqeOontro - +OI'FKV
+OI#PP6QQN1#PPQVCVKQP6[RG - YK5VTCKIJV.KPG
+OI#PP6QQN1&TCY 10 10 100 100
'5GVU VJG #PPQVCVKQP6[RG VQ C HKNNGF TGEVCPING CPF VJG HKNN EQNQT
'QH VJG TGEVCPING VQ DNWG WUKPI 8KUWCN $CUKE EQNQT EQPUVCPVU
+OI#PP6QQN1#PPQVCVKQP6[RG - YK(KNNGF4GEV '4
+OI#PP6QQN1#PPQVCVKQP(KNN%QNQT - XD$NWG
'&TCY VJG DNWG TGEVCPING QP VJG +OCIG 'FKV EQPVTQN YJQUG
'+OCIG%QPVTQN PCOG KU +OI'FKV1
+OI#PP6QQN1DestImaqeOontro - +OI'FKV1
+OI#PP6QQN1&TCY 10 10 100 100
'PF 5WD
DisplayICM Enabled Propert y
313
DisplayICMEnabled Propert y
Descript ion Sets whether Image Color Matching (ICM) support is enabled. When enabled, Imaging
uses color management profiles when displaying or pr inting an image so the output devices
display the colors of the or iginal image as accurately as possible.
Available Wit h
Applies To Image Edit control.
Usage object.DisplayICMEnabled[={True|False}]
Dat a Type Boolean.
Remarks If Image Color Matching is enabled, but the input device, image file, or output device does
not support ICM, Imaging perfor ms no color matching.
The image file types that support ICM are BMP Versions 4 and 5, and TIFF Version 7.
DisplayScaleAlgorit hm Propert y
Descript ion R eturns or sets the scaling algor ithm used when displaying images. It is particularly useful
for implementing scale- to- gray functionality.
Available Wit h
Applies To Image Edit control.
Usage object.DisplayScaleAlgorithm[=value]
Dat a Type Integer (enumerated).
Imaging for Windows Professional Edition V2.0
Imaging for Windows Professional Edition V1.0 and V1.1
Imaging for Windows 98
Imaging for Windows 95
Imaging for Windows NT 4.0
Set t ing Descript ion
True ICM support is enabled.
False (default) ICM support is not enabled.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
314
Property settings are expressed using the following values:
Remarks The DisplayScaleAlgor ithm 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 nor mal decimation to another setting, the displayed image
remains unchanged.
When the AutoRefresh property is set to True, changing the DisplayScaleAlgor ithm
property causes the displayed image to be refreshed automatically. Some settings may not be
apparent until the image is scaled to a Zoom value under 100 percent.
See Also AutoR efresh property, PageType property.
DisplayScaleAlgorit hm Example VB
This example shows some property settings you might want to make pr ior to displaying an
image.
2TKXCVG 5WD +OI'FKV1A.QCF$[8CN <QQO #U &QWDNG)
'*GTG CTG UQOG GZCORNGU QH FGHCWNV UGVVKPIU [QW OKIJV
'YCPV VQ URGEKH[ RTKQT VQ FKURNC[KPI CP KOCIG
'4GRCKPV CP[ EJCPIGU KOOGFKCVGN[ GZ \QQO QT TGUQNWVKQP EJCPIGU GVE)
+OI'FKV1#WVQ4GHTGUJ - 6TWG
'5ETQNN$CTU CNTGCF[ FGHCWNV VQ VTWG DWV VJKU KU OQFKHKCDNG KH FGUKTGF
+OI'FKV15ETQNN$CTU - 6TWG
'5ECNG DNCEM CPF YJKVG KOCIGU VQ ITC[UECNG -GGR EQNQT KOCIG
'FKURNC[GF CU EQNQT KOCIGU
+OI'FKV1D1sayScaeAqor1thm - YK5ECNG1RVKOK\G
'#NNQY WUGT VQ UETQNN KOCIG WUKPI MG[DQCTF UJQTVEWVU
+OI'FKV15ETQNN5JQTVEWVU'PCDNGF - 6TWG
'&KURNC[ CNN 1%4 \QPGU
+OI'FKV11ET<QPG8KUKDKNKV[ - YK1ET5JQY#NN<QPGU 'o
'PF 5WD
Const ant Set t ing Descript ion Not es
wiScaleNormal 0
(default)
Nor mal Nor mal 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 algor ithm based on
the page type of the displayed image:
Black&white images Are scaled to
gray.
Palettized 4- and 8-bit, RGB, and
BGR images R emain color images.
Enabled Propert y
315
DisplayScaleAlgorit hm Example VC++
This example shows some property settings you might want to make pr ior to displaying an
image.
XQKF %+OI'FKV1&NI1P.QCF'FKVEVTN1FQWDNG <QQO)
]
// *GTG CTG UQOG GZCORNGU QH FGHCWNV UGVVKPIU [QW OKIJV YCPV VQ URGEKH[
// RTKQT VQ FKURNC[KPI CP KOCIG 4GRCKPV CP[ EJCPIGU KOOGFKCVGN[
// GZ \QQO QT TGUQNWVKQP EJCPIGU GVE)
+OI'FKV15GV#WVQ4GHTGUJ647')
// 5ETQNN$CTU CNTGCF[ FGHCWNV VQ VTWG DWV VJKU KU OQFKHKCDNG KH FGUKTGF
+OI'FKV15GV5ETQNN$CTU647')
// 5ECNG DNCEM CPF YJKVG KOCIGU VQ ITC[UECNG -GGR EQNQT KOCIG
// FKURNC[GF CU EQNQT KOCIGU
+OI'FKV1SetD1sayScaeAqor1thm4) // YK5ECNG1RVKOK\G
// #NNQY WUGT VQ UETQNN KOCIG WUKPI MG[DQCTF UJQTVEWVU
+OI'FKV15GV5ETQNN5JQTVEWVU'PCDNGF647')
// &KURNC[ CNN 1%4 \QPGU
+OI'FKV15GV1ET<QPG8KUKDKNKV[o) // YK1ET5JQY#NN<QPGU // o
_
Enabled Propert y
Descript ion Enables or disables the control.
Available Wit h
Applies To Image Edit, Image Annotation, and Image Thumbnail controls.
Usage object.Enabled[={True|False}]
Dat a Type Boolean.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Set t ing Descript ion
True (default) Control is enabled (can respond to events).
False Control is disabled (cannot respond to events).
Not e: The propert ies of t he Image Annot at ion Tool But t on cont rol cannot be updat ed
w hen t he cont rol is disabled.
Chapt er 7
316
FileType Propert y
Descript ion R eturns the file type of the image file specified in the Image property, and the page
specified in the Page property.
Available Wit h
Applies To Image Edit control.
Usage object.FileType
Dat a Type Integer (enumerated).
Property settings are expressed using the following values:
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.
See Also Image property, Page property, SaveAs method, SavePage method.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Not e: AWD is not available w it h Imaging f or Window s NT 4.0. GIF and WIFF are available
w it h Imaging f or Window s Prof essional Edit ion V1.0, V1.1, and V2.0; and Imaging
f or Window s 98.
Const ant Set t ing Descript ion
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
hWnd Propert y
317
FileType Example VB
This example uses the FileType property to deter mine the file type of the image specified in
the Image property.
2TKXCVG 5WD EOF(KNG6[RGA%NKEM)
'4GCFU VJG (KNG6[RG RTQRGTV[ VQ FGVGTOKPG VJG (KNG6[RG QH
'VJG KOCIG URGEKHKGF KP VJG +OCIG RTQRGTV[
&KO UVT+OI(KNG6[RG #U 5VTKPI
'4GCF VJG (KNGV[RG CPF VTCPUNCVG VJG XCNWG VQ C EQTTGURQPFKPI UVTKPI
5GNGEV %CUG +OI'FKV1F1eTye
%CUG 0
UVT+OI(KNG6[RG - 7PMPQYP
%CUG 1
UVT+OI(KNG6[RG - 6+(
%CUG
UVT+OI(KNG6[RG - #9&
%CUG o
UVT+OI(KNG6[RG - $/2
%CUG 4
UVT+OI(KNG6[RG - 2%:
%CUG b
UVT+OI(KNG6[RG - &%:
%CUG b
UVT+OI(KNG6[RG - ,2)
%CUG 7
UVT+OI(KNG6[RG - :+(
%CUG 8
UVT+OI(KNG6[RG - )+(
%CUG 9
UVT+OI(KNG6[RG - 9+(
'PF 5GNGEV
'&KURNC[ VJG HKNG V[RG QP C HQTO HQT KPHQTOCVKQPCN RWTRQUGU
HTO+PHQNDN+OI+PHQ0)%CRVKQP - UVT+OI(KNG6[RG
'PF 5WD
hWnd Propert y
Descript ion Indicates the window handle to the control.
Available Wit h
Applies To Image Edit, Image Annotation, and Image Thumbnail controls.
Usage object.hWnd
Dat a Type Long.
Remarks Available at run- time as read- only.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
318
Image Propert y
Descript ion R eturns the fully- qualified name (see page 535) 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 Wit h
Applies To Image Edit control.
Usage object.Image[=filename]
Dat a Type Str ing
Remarks If a UR L 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.
See Also Display method, R eadyState property, R eadyStateChange event.
Image Example VB
This example shows how to set the Image property using a var iety of path and file name
for mats.
2TKXCVG 5WD EOF5GV+OCIGA%NKEM)
'9KPFQYU HKNGPCOG
+OI'FKV1Imaqe - E>KPUWTCPEG>ENCKOU>ENCKOo4VKH
'5JQYKPI U[PVCZ HQT 1Z 5GTXGT FQEWOGPV
'0QVG RTGHKZ +OCIG// FGPQVGU UGTXKEG PCOG HQT 1Z UGTXGT
+OI'FKV1Imaqe - +OCIG//UTXTPCOG>XQNPCOG>%#$0#/'>&4#9'40#/'>
(1.&'40#/'>;174 &1%
'5JQYKPI U[PVCZ HQT 1Z 5GTXGT HKNGPCOG YKVJ C XQNWOG PCOG OCRRGF
+OI'FKV1Imaqe - +OCIG//UTXTPCOG/XQNPCOG/FKTPCOG/VGORVKH
'5JQYKPI U[PVCZ HQT oZ 5GTXGT FQEWOGPV
'0QVG RTGHKZ +OCIGZ// FGPQVGU UGTXKEG PCOG HQT oZ UGTXGT
+OI'FKV1Imaqe - +OCIGZ//FQEKF1o4
'74. U[PVCZ
+OI'FKV1Imaqe - JVVR//YYYGCUVOCPUQHVYCTGEQO/UDW/UCORKOIVKH
'70% HKNGPCOG
+OI'FKV1Imaqe - >>UTXTPCOG>UJCTGFo>KOCIGU>DY>VJKUKUCVKH
'PF 5WD
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
ImageCont rol Propert y
319
Image Example VC++
This example shows how to set the Image property using a var iety of path and file name
for mats.
XQKF %+OI'FKV1&NI1P+OCIG)
]
// 'ZCORNGU QH U[PVCZ HQT VJG +OCIG RTQRGTV[
// 6JG UKPING UNCUJGU KP VJG PCOG ECP DG HQTYCTF QT DCEM
// 9KPFQYU HKNGPCOG
+OI'FKV1SetImaqeE>>KPUWTCPEG>>ENCKOU>>ENCKOo4VKH)
// 5JQYKPI U[PVCZ HQT 1Z 5GTXGT FQEWOGPV
// 0QVG RTGHKZ +OCIG// FGPQVGU UGTXKEG PCOG HQT 1Z UGTXGT
+OI'FKV1SetImaqe+OCIG//UTXTPCOG>>XQNPCOG>>%#$0#/'>>&4#9'40#/'>>
(1.&'40#/'>>;174 &1%)
// 5JQYKPI U[PVCZ HQT 1Z 5GTXGT HKNGPCOG YKVJ C XQNWOG PCOG OCRRGF
+OI'FKV1SetImaqe+OCIG//UTXTPCOG/XQNPCOG/FKTPCOG/VGORVKH)
// 5JQYKPI U[PVCZ HQT oZ 5GTXGT FQEWOGPV
// 0QVG RTGHKZ +OCIGZ// FGPQVGU UGTXKEG PCOG HQT oZ UGTXGT
+OI'FKV1SetImaqe+OCIGZ//FQEKF1o4)
// 74. U[PVCZ
+OI'FKV1SetImaqeJVVR//YYYGCUVOCPUQHVYCTGEQO/UDW/UCORKOIVKH)
// 70% HKNGPCOG
+OI'FKV1SetImaqe>>UTXTPCOG>UJCTGFo>KOCIGU>DY>VJKUKUCVKH)
_
ImageCont rol Propert y
Descript ion R eturns 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 perfor m several functions.
Available Wit h
Applies To Image Edit control.
Usage object.ImageControl[=controlname]
Dat a Type Str ing.
Remarks A unique default name is provided when you draw the control on a for m.
See Also DestImageControl property, Image Annotation Tool Button control, Image Scan control.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
320
ImageDisplayed Propert y
Descript ion Indicates whether an image is cur rently being displayed.
Available Wit h
Applies To Image Edit control.
Usage object.ImageDisplayed
Dat a Type Boolean.
Remarks Available at run- time as read- only.
See Also Display method.
ImageHeight Propert y
Descript ion R eturns the height in full- size coordinates of the image being displayed.
Available Wit h
Applies To Image Edit control.
Usage object.ImageHeight
Dat a 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 er ror.
Available at run- time as read- only.
See Also Image property, ImageScaleHeight property, ImageWidth property.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Set t ing Descript ion
True An image is being displayed.
False An image is not being displayed.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
ImageHei ght Propert y
321
ImageHeight Example 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.
2TKXCVG 5WD EOF9KFVJ*GKIJVA%NKEM)
+OI'FKV1+OCIG - &>KOCIG>QETVKH
+OI'FKV1(KV6Q $'56A(+6
+OI'FKV1&KURNC[
.QCF HTO+PHQ
'&KURNC[ VJG FKOGPUKQPU QH VJG KOCIG RCIG
HTO+PHQNDN+OI*GKIJV%CRVKQP - +OI'FKV1ImaqeHe1qht
HTO+PHQNDN+OI9KFVJ%CRVKQP - +OI'FKV1+OCIG9KFVJ
'&KURNC[ VJG : CPF ; TGUQNWVKQP QH VJG KOCIG RCIG
HTO+PHQNDN+OI4GU:%CRVKQP - +OI'FKV1+OCIG4GUQNWVKQP:
HTO+PHQNDN+OI4GU;%CRVKQP - +OI'FKV1+OCIG4GUQNWVKQP;
'&KURNC[ +OCIG 5ECNG *GKIJV
HTO+PHQNDN+OI5ECNG*GKIJV%CRVKQP - +OI'FKV1+OCIG5ECNG*GKIJV
HTO+PHQNDN+OI5ECNG9KFVJ%CRVKQP - +OI'FKV1+OCIG5ECNG9KFVJ
HTO+PHQ5JQY 1
'PF 5WD
ImageHeight Example 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.
XQKF %+OI'FKV1&NI1P9KFVJ*GKIJV)
]
// &KURNC[U CP KOCIG VJCV KU HKV VQ YKPFQY CPF VJGP FKURNC[U JGKIJV
// YKFVJ TGUQNWVKQP UECNGF JGKIJV CPF UECNGF YKFVJ 6JKU KNNWUVTCVGU
// VJG FKHHGTGPEG DGVYGGP +OCIG*GKIJV/9KFVJ CPF +OCIG5ECNG*GKIJV/9KFVJ
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1(KV6Q0GXV) //$'56A(+6
+OI'FKV1&KURNC[)
%(TO+PHQ HTO+PHQ
// &KURNC[ VJG FKOGPUKQPU QH VJG KOCIG RCIG
%5VTKPI U\9KPFQY6GZV
NQPI N+PHQ
N+PHQ - +OI'FKV1)GVImaqeHe1qht)
HTO+PHQNDN+OI*GKIJV(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG9KFVJ)
HTO+PHQNDN+OI9KFVJ(QTOCV'KN+PHQ)
// &KURNC[ VJG : CPF ; TGUQNWVKQP QH VJG KOCIG RCIG
N+PHQ - +OI'FKV1)GV+OCIG4GUQNWVKQP:)
HTO+PHQNDN+OI4GU:(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG4GUQNWVKQP;)
HTO+PHQNDN+OI4GU;(QTOCV'KN+PHQ)
// &KURNC[ +OCIG 5ECNG *GKIJV
N+PHQ - +OI'FKV1)GV+OCIG5ECNG*GKIJV)
Chapt er 7
322
HTO+PHQNDN+OI5ECNG*GKIJV(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG5ECNG9KFVJ)
HTO+PHQNDN+OI5ECNG9KFVJ(QTOCV'KN+PHQ)
HTO+PHQ&Q/QFCN)
_
ImageModif ied Propert y
Descript ion Indicates whether an image has been modified.
Available Wit h
Applies To Image Edit control.
Usage object.ImageModified
Dat a Type Boolean.
Remarks Because the value of this property indicates whether an image file has been modified, you
can use it to deter mine 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:
s
ImageR esolutionX
s
ImageR esolutionY
Invoking the following methods sets the ImageModified property to True:
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Set t ing Descript ion
True The image has been modified.
False The image has not been modified.
s
AddAnnotationGroup
s
R edo
s
AutoCrop
s
R emoveAllOCR Marks
s
AutoDeskew
s
R otate
s
BurnInAnnotations
s
R otateAll
s
ClipboardCut
s
R otateLeft
s
ClipboardPaste
s
R otateR ight
s
ConvertPageType
s
SetSelectedAnnotationBackColor
ImageM odif ied Propert y
323
Drawing an annotation using the standard Annotation Tool Palette (see page 533) also sets
the ImageModified property to True.
Invoking the following methods sets the ImageModified property to False (effectively,
resetting the property):
s
Save
s
SavePage
s
SaveAs
See Also AddAnnotationGroup method, AutoCrop method, AutoDeskew method,
Bur nInAnnotations method, ClipboardCut method, ClipboardPaste method, Close event,
ConvertPageType method, Crop method, DeleteAnnotationGroup method,
DeleteImageData method, DeleteSelectedAnnotations method, Despeckle method, Draw
method, EditSelectedAnnotationText method, Flip method, HideAnnotationGroup
method, ImageR esolutionX property, ImageR esolutionY property, Invert method,
ManualDeskew method, R edo method, R emoveAllOCR Marks method, R otate method,
R otateAll method, R otateR ight method, Save method, SaveAs method, SavePage method,
SetSelectedAnnotationBackColor method, SetSelectedAnnotationFillColor method,
SetSelectedAnnotationFillStyle method, SetSelectedAnnotationFont method,
SetSelectedAnnotationFontColor method, SetSelectedAnnotationLineColor method,
SetSelectedAnnotationLineStyle method, SetSelectedAnnotationLineWidth method,
SetSelectedAnnotationOcrType method, ShowAnnotationGroup method,
ShowAnnotationToolPalette method, Undo method.
s
Crop
s
SetSelectedAnnotationFillColor
s
DeleteAnnotationGroup
s
SetSelectedAnnotationFillStyle
s
DeleteImageData
s
SetSelectedAnnotationFont
s
DeleteSelectedAnnotations
s
SetSelectedAnnotationFontColor
s
Despeckle
s
SetSelectedAnnotationLineColor
s
Draw method
s
SetSelectedAnnotationLineStyle
s
EditSelectedAnnotationText
s
SetSelectedAnnotationLineWidth
s
Flip
s
SetSelectedAnnotationOcrType
s
HideAnnotationGroup
s
ShowAnnotationGroup
s
Invert
s
Undo
s
ManualDeSkew
Chapt er 7
324
ImageModif ied Example VB
This example uses the ImageModified property to see if changes were made to an existing
image before per mitting 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.
2TKXCVG 5WD +OI'FKV1A%NQUG)
'6JKU EQFG EQWNF DG WUGF CV VJG VKOG C WUGT CVVGORVU VQ QRGP C PGY HKNG
'QT ENGCT C RTGXKQWUN[ FKURNC[GF KOCIG KP QTFGT VQ RTQORV HQT EJCPIGU
'VQ DG UCXGF KH VJG KOCIG JCU DGGP OQFKHKGF
&KO KPV5CXG+OI #U +PVGIGT
+H +OI'FKV1ImaqeMod1f1ed - 6TWG 6JGP
KPV5CXG+OI - /UI$QZ&Q [QW YCPV VQ UCXG EJCPIGU! XD;GU0Q%CPEGN
+OCIG JCU DGGP OQFKHKGF)
5GNGEV %CUG KPV5CXG+OI
%CUG XD;GU
'5CXG VJG EJCPIGU
+OI'FKV15CXG
'&TQR FQYP VQ VJG 1RGP HKNG EQFG
%CUG XD0Q
'&QP'V UCXG HKNG LWUV FTQR FQYP VQ VJG 1RGP HKNG EQFG
%CUG XD%CPEGN
'7UGT RTGUUGF ECPEGN FQPNV QRGP C HKNG FQPNV UCXG EJCPIGU
'ZKV 5WD
'PF 5GNGEV
'PF +H
'1RGP C PGY HKNG CV VJKU RQKPV
'PF 5WD
ImageModif ied Example VC++
This example uses the ImageModified property to see if changes were made to an existing
image before per mitting 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.
XQKF %+OI'FKV1&NI1P%NQUG'FKVEVTN1)
]
// 6JKU EQFG EQWNF DG WUGF CV VJG VKOG C WUGT CVVGORVU VQ QRGP C PGY
// HKNG QT ENGCT C RTGXKQWUN[ FKURNC[GF KOCIG KP QTFGT VQ RTQORV HQT
// EJCPIGU VQ DG UCXGF KH VJG KOCIG JCU DGGP OQFKHKGF
KPV K5CXG+OI
KH+OI'FKV1OetImaqeMod1f1ed))
]
K5CXG+OI - #HZ/GUUCIG$QZ&Q [QW YCPV VQ UCXG EJCPIGU!
/$A;'501%#0%'.)
UYKVEJ K5CXG+OI)
]
ECUG +&;'5
// 5CXG VJG EJCPIGU
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV HQT UCXG CV
// \QQO
+OI'FKV15CXGGXV)
DTGCM
// &TQR FQYP VQ VJG 1RGP HKNG EQFG
ImagePalet t e Propert y
325
ECUG +&01
// &QP'V UCXG HKNG LWUV FTQR FQYP VQ VJG 1RGP HKNG EQFG
DTGCM
ECUG +&%#0%'.
// 7UGT RTGUUGF ECPEGN FQPNV QRGP C HKNG FQPNV UCXG EJCPIGU
TGVWTP
_
_
// 1RGP C PGY HKNG CV VJKU RQKPV
_
ImagePalet t e Propert y
R eturns or sets the palette to use when displaying an image.
Available Wit h
Applies To Image Edit control.
Usage object.ImagePalette[=value]
Dat a Type Integer (enumerated).
Property settings are expressed using the following values:
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.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Const ant Set t ing Descript ion Not es
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 R GB24 Selects the 24- bit, millions- of-
colors palette.
wiPaletteBlackWhite 4 Black- and- white Selects the black- and- white pal-
ette.
Chapt er 7
326
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 R GB.
When the PageType of the image being displayed in the Image Edit control is R GB, the
ImagePalette property must be set to the R GB24 palette (wiPaletteR GB24).
See Also AutoR efresh property, SetImagePalette method.
ImageResolut ionX Propert y
R eturns or sets the hor izontal resolution of the image being displayed.
Available Wit h
Applies To Image Edit control.
Usage object.ImageResolutionX[=value]
Dat a Type Long.
Remarks When the AutoRefresh property is set to True, changing the ImageR esolutionX property
causes the displayed image to be refreshed automatically.
Changing the setting of the ImageR esolutionX property sets the ImageModified
property to True.
If an image is not being displayed, the ImageR esolutionX property retur ns or sets the
hor izontal 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 ImageR esolutionX property generates an er ror.
Available at run- time as read- and- wr ite.
See Also AutoR efresh property, Image property, ImageModified property, ImageR esolutionY
property.
ImageResolut ionX Example 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.
2TKXCVG 5WD EOF9KFVJ*GKIJVA%NKEM)
+OI'FKV1+OCIG - &>KOCIG>QETVKH
+OI'FKV1(KV6Q $'56A(+6
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
ImageResolut ionX Propert y
327
+OI'FKV1&KURNC[
.QCF HTO+PHQ
'&KURNC[ VJG FKOGPUKQPU QH VJG KOCIG RCIG
HTO+PHQNDN+OI*GKIJV%CRVKQP - +OI'FKV1+OCIG*GKIJV
HTO+PHQNDN+OI9KFVJ%CRVKQP - +OI'FKV1+OCIG9KFVJ
'&KURNC[ VJG : CPF ; TGUQNWVKQP QH VJG KOCIG RCIG
HTO+PHQNDN+OI4GU:%CRVKQP - +OI'FKV1ImaqeResout1onX
HTO+PHQNDN+OI4GU;%CRVKQP - +OI'FKV1+OCIG4GUQNWVKQP;
'&KURNC[ +OCIG 5ECNG *GKIJV
HTO+PHQNDN+OI5ECNG*GKIJV%CRVKQP - +OI'FKV1+OCIG5ECNG*GKIJV
HTO+PHQNDN+OI5ECNG9KFVJ%CRVKQP - +OI'FKV1+OCIG5ECNG9KFVJ
HTO+PHQ5JQY 1
'PF 5WD
ImageResolut ionX Example 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.
XQKF %+OI'FKV1&NI1P9KFVJ*GKIJV)
]
// &KURNC[U CP KOCIG VJCV KU HKV VQ YKPFQY CPF VJGP FKURNC[U JGKIJV
// YKFVJ TGUQNWVKQP UECNGF JGKIJV CPF UECNGF YKFVJ 6JKU KNNWUVTCVGU
// VJG FKHHGTGPEG DGVYGGP +OCIG*GKIJV/9KFVJ CPF +OCIG5ECNG*GKIJV/9KFVJ
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1(KV6Q0GXV) //$'56A(+6
+OI'FKV1&KURNC[)
%(TO+PHQ HTO+PHQ
// &KURNC[ VJG FKOGPUKQPU QH VJG KOCIG RCIG
%5VTKPI U\9KPFQY6GZV
NQPI N+PHQ
N+PHQ - +OI'FKV1)GV+OCIG*GKIJV)
HTO+PHQNDN+OI*GKIJV(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG9KFVJ)
HTO+PHQNDN+OI9KFVJ(QTOCV'KN+PHQ)
// &KURNC[ VJG : CPF ; TGUQNWVKQP QH VJG KOCIG RCIG
N+PHQ - +OI'FKV1OetImaqeResout1onX)
HTO+PHQNDN+OI4GU:(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG4GUQNWVKQP;)
HTO+PHQNDN+OI4GU;(QTOCV'KN+PHQ)
// &KURNC[ +OCIG 5ECNG *GKIJV
N+PHQ - +OI'FKV1)GV+OCIG5ECNG*GKIJV)
HTO+PHQNDN+OI5ECNG*GKIJV(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG5ECNG9KFVJ)
HTO+PHQNDN+OI5ECNG9KFVJ(QTOCV'KN+PHQ)
HTO+PHQ&Q/QFCN)
_
Chapt er 7
328
ImageResolut ionY Propert y
Descript ion R eturns or sets the vertical resolution of the image being displayed.
Available Wit h
Applies To Image Edit control.
Usage object.ImageResolutionY[=value]
Dat a Type Long.
Remarks When the AutoRefresh property is set to True, changing the ImageR esolutionY property
causes the displayed image to be refreshed automatically.
Changing the setting of the ImageR esolutionY property sets the ImageModified property
to True.
If an image is not being displayed, the ImageR esolutionY 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 ImageR esolutionY property generates an error.
Available at run- time as read- and- wr ite.
See Also AutoR efresh property, Image property, ImageModified property, ImageR esolutionX
property.
ImageResolut ionY Example 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.
2TKXCVG 5WD EOF9KFVJ*GKIJVA%NKEM)
+OI'FKV1+OCIG - &>KOCIG>QETVKH
+OI'FKV1(KV6Q $'56A(+6
+OI'FKV1&KURNC[
.QCF HTO+PHQ
'&KURNC[ VJG FKOGPUKQPU QH VJG KOCIG RCIG
HTO+PHQNDN+OI*GKIJV%CRVKQP - +OI'FKV1+OCIG*GKIJV
HTO+PHQNDN+OI9KFVJ%CRVKQP - +OI'FKV1+OCIG9KFVJ
'&KURNC[ VJG : CPF ; TGUQNWVKQP QH VJG KOCIG RCIG
HTO+PHQNDN+OI4GU:%CRVKQP - +OI'FKV1+OCIG4GUQNWVKQP:
HTO+PHQNDN+OI4GU;%CRVKQP - +OI'FKV1ImaqeResout1onY
'&KURNC[ +OCIG 5ECNG *GKIJV
HTO+PHQNDN+OI5ECNG*GKIJV%CRVKQP - +OI'FKV1+OCIG5ECNG*GKIJV
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
ImageScal eHei ght Propert y
329
HTO+PHQNDN+OI5ECNG9KFVJ%CRVKQP - +OI'FKV1+OCIG5ECNG9KFVJ
HTO+PHQ5JQY 1
'PF 5WD
ImageResolut ionY Example 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.
XQKF %+OI'FKV1&NI1P9KFVJ*GKIJV)
]
// &KURNC[U CP KOCIG VJCV KU HKV VQ YKPFQY CPF VJGP FKURNC[U JGKIJV
// YKFVJ TGUQNWVKQP UECNGF JGKIJV CPF UECNGF YKFVJ 6JKU KNNWUVTCVGU
// VJG FKHHGTGPEG DGVYGGP +OCIG*GKIJV/9KFVJ CPF +OCIG5ECNG*GKIJV/9KFVJ
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1(KV6Q0GXV) //$'56A(+6
+OI'FKV1&KURNC[)
%(TO+PHQ HTO+PHQ
// &KURNC[ VJG FKOGPUKQPU QH VJG KOCIG RCIG
%5VTKPI U\9KPFQY6GZV
NQPI N+PHQ
N+PHQ - +OI'FKV1)GV+OCIG*GKIJV)
HTO+PHQNDN+OI*GKIJV(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG9KFVJ)
HTO+PHQNDN+OI9KFVJ(QTOCV'KN+PHQ)
// &KURNC[ VJG : CPF ; TGUQNWVKQP QH VJG KOCIG RCIG
N+PHQ - +OI'FKV1)GV+OCIG4GUQNWVKQP:)
HTO+PHQNDN+OI4GU:(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1OetImaqeResout1onY)
HTO+PHQNDN+OI4GU;(QTOCV'KN+PHQ)
// &KURNC[ +OCIG 5ECNG *GKIJV
N+PHQ - +OI'FKV1)GV+OCIG5ECNG*GKIJV)
HTO+PHQNDN+OI5ECNG*GKIJV(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG5ECNG9KFVJ)
HTO+PHQNDN+OI5ECNG9KFVJ(QTOCV'KN+PHQ)
HTO+PHQ&Q/QFCN)
_
ImageScaleHeight Propert y
Descript ion R eturns the height in pixels of the image as it is displayed.
Available Wit h
Applies To Image Edit control.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
330
Usage object.ImageScaleHeight
Dat a Type OLE_YSIZE_PIXELS.
Remarks The Display method must be invoked pr ior 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 cur rent zoom factor.
The ImageScaleHeight and ImageHeight properties also differ for images with asymmetr ic
resolutions. For example, when an 8- by 11- inch image with a resolution of 200 by 100
dots per inch (dpi) is displayed, the ImageHeight property returns a value of 1100, while
the ImageScaleHeight property returns a value of 2200 due to pixel replication that occurs
at display- time to optimize display quality.
Available at run- time as read- only.
See Also Display method, Image property, ImageHeight property, ImageR esolutionX property,
ImageR esolutionY property, ImageScaleWidth property, Zoom property (Image Edit).
ImageScaleHeight Example 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.
2TKXCVG 5WD EOF9KFVJ*GKIJVA%NKEM)
+OI'FKV1+OCIG - &>KOCIG>QETVKH
+OI'FKV1(KV6Q $'56A(+6
+OI'FKV1&KURNC[
.QCF HTO+PHQ
'&KURNC[ VJG FKOGPUKQPU QH VJG KOCIG RCIG
HTO+PHQNDN+OI*GKIJV%CRVKQP - +OI'FKV1+OCIG*GKIJV
HTO+PHQNDN+OI9KFVJ%CRVKQP - +OI'FKV1+OCIG9KFVJ
'&KURNC[ VJG : CPF ; TGUQNWVKQP QH VJG KOCIG RCIG
HTO+PHQNDN+OI4GU:%CRVKQP - +OI'FKV1+OCIG4GUQNWVKQP:
HTO+PHQNDN+OI4GU;%CRVKQP - +OI'FKV1+OCIG4GUQNWVKQP;
'&KURNC[ +OCIG 5ECNG *GKIJV
HTO+PHQNDN+OI5ECNG*GKIJV%CRVKQP - +OI'FKV1ImaqeScaeHe1qht
HTO+PHQNDN+OI5ECNG9KFVJ%CRVKQP - +OI'FKV1+OCIG5ECNG9KFVJ
HTO+PHQ5JQY 1
'PF 5WD
ImageScaleWidt h Propert y
331
ImageScaleHeight Example 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.
XQKF %+OI'FKV1&NI1P9KFVJ*GKIJV)
]
// &KURNC[U CP KOCIG VJCV KU HKV VQ YKPFQY CPF VJGP FKURNC[U JGKIJV
// YKFVJ TGUQNWVKQP UECNGF JGKIJV CPF UECNGF YKFVJ 6JKU KNNWUVTCVGU
// VJG FKHHGTGPEG DGVYGGP +OCIG*GKIJV/9KFVJ CPF +OCIG5ECNG*GKIJV/9KFVJ
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1(KV6Q0GXV) //$'56A(+6
+OI'FKV1&KURNC[)
%(TO+PHQ HTO+PHQ
// &KURNC[ VJG FKOGPUKQPU QH VJG KOCIG RCIG
%5VTKPI U\9KPFQY6GZV
NQPI N+PHQ
N+PHQ - +OI'FKV1)GV+OCIG*GKIJV)
HTO+PHQNDN+OI*GKIJV(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG9KFVJ)
HTO+PHQNDN+OI9KFVJ(QTOCV'KN+PHQ)
// &KURNC[ VJG : CPF ; TGUQNWVKQP QH VJG KOCIG RCIG
N+PHQ - +OI'FKV1)GV+OCIG4GUQNWVKQP:)
HTO+PHQNDN+OI4GU:(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG4GUQNWVKQP;)
HTO+PHQNDN+OI4GU;(QTOCV'KN+PHQ)
// &KURNC[ +OCIG 5ECNG *GKIJV
N+PHQ - +OI'FKV1OetImaqeScaeHe1qht)
HTO+PHQNDN+OI5ECNG*GKIJV(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG5ECNG9KFVJ)
HTO+PHQNDN+OI5ECNG9KFVJ(QTOCV'KN+PHQ)
HTO+PHQ&Q/QFCN)
_
ImageScaleWidt h Propert y
Descript ion R eturns the width in pixels of the image as it is displayed.
Available Wit h
Applies To Image Edit control.
Usage object.ImageScaleWidth
Dat a Type OLE_XSIZE_PIXELS.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
332
Remarks The Display method must be invoked pr ior to using this property.
The ImageScaleWidth property differs from the ImageWidth property. The ImageWidth
property retur ns the width in full- size coordinates, while the ImageScaleWidth property
value is affected by the cur rent zoom factor.
The ImageScaleWidth and ImageWidth properties also differ for images with asymmetr ic
resolutions. For example, when an 8- by 11- inch image with a resolution of 100 by 200
dots per inch (dpi) is displayed, the ImageWidth property returns a value of 850, while the
ImageScaleWidth property returns a value of 1700 due to pixel replication that occurs at
display- time to optimize display quality.
Available at run- time as read- only.
See Also Display method, Image property, ImageR esolutionX property, ImageR esolutionY
property, ImageScaleHeight property, ImageWidth property, Zoom property (ImageEdit).
ImageScaleWidt h Example 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.
2TKXCVG 5WD EOF9KFVJ*GKIJVA%NKEM)
+OI'FKV1+OCIG - &>KOCIG>QETVKH
+OI'FKV1(KV6Q $'56A(+6
+OI'FKV1&KURNC[
.QCF HTO+PHQ
'&KURNC[ VJG FKOGPUKQPU QH VJG KOCIG RCIG
HTO+PHQNDN+OI*GKIJV%CRVKQP - +OI'FKV1+OCIG*GKIJV
HTO+PHQNDN+OI9KFVJ%CRVKQP - +OI'FKV1+OCIG9KFVJ
'&KURNC[ VJG : CPF ; TGUQNWVKQP QH VJG KOCIG RCIG
HTO+PHQNDN+OI4GU:%CRVKQP - +OI'FKV1+OCIG4GUQNWVKQP:
HTO+PHQNDN+OI4GU;%CRVKQP - +OI'FKV1+OCIG4GUQNWVKQP;
'&KURNC[ +OCIG 5ECNG *GKIJV
HTO+PHQNDN+OI5ECNG*GKIJV%CRVKQP - +OI'FKV1+OCIG5ECNG*GKIJV
HTO+PHQNDN+OI5ECNG9KFVJ%CRVKQP - +OI'FKV1ImaqeScaeW1dth
HTO+PHQ5JQY 1
'PF 5WD
ImageScaleWidt h Example 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.
XQKF %+OI'FKV1&NI1P9KFVJ*GKIJV)
]
// &KURNC[U CP KOCIG VJCV KU HKV VQ YKPFQY CPF VJGP FKURNC[U JGKIJV
// YKFVJ TGUQNWVKQP UECNGF JGKIJV CPF UECNGF YKFVJ 6JKU KNNWUVTCVGU
// VJG FKHHGTGPEG DGVYGGP +OCIG*GKIJV/9KFVJ CPF +OCIG5ECNG*GKIJV/9KFVJ
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
ImageWidt h Propert y
333
+OI'FKV1(KV6Q0GXV) //$'56A(+6
+OI'FKV1&KURNC[)
%(TO+PHQ HTO+PHQ
// &KURNC[ VJG FKOGPUKQPU QH VJG KOCIG RCIG
%5VTKPI U\9KPFQY6GZV
NQPI N+PHQ
N+PHQ - +OI'FKV1)GV+OCIG*GKIJV)
HTO+PHQNDN+OI*GKIJV(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG9KFVJ)
HTO+PHQNDN+OI9KFVJ(QTOCV'KN+PHQ)
// &KURNC[ VJG : CPF ; TGUQNWVKQP QH VJG KOCIG RCIG
N+PHQ - +OI'FKV1)GV+OCIG4GUQNWVKQP:)
HTO+PHQNDN+OI4GU:(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG4GUQNWVKQP;)
HTO+PHQNDN+OI4GU;(QTOCV'KN+PHQ)
// &KURNC[ +OCIG 5ECNG *GKIJV
N+PHQ - +OI'FKV1)GV+OCIG5ECNG*GKIJV)
HTO+PHQNDN+OI5ECNG*GKIJV(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1OetImaqeScaeW1dth)
HTO+PHQNDN+OI5ECNG9KFVJ(QTOCV'KN+PHQ)
HTO+PHQ&Q/QFCN)
_
ImageWidt h Propert y
Descript ion R eturns the width in full- size coordinates of the image being displayed.
Available Wit h
Applies To Image Edit control.
Usage object.ImageWidth
Dat a Type Long.
Remarks If an image is not being displayed, this 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 er ror.
Available at run- time as read- only.
See Also Image property, ImageHeight property, ImageScaleWidth property.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
334
ImageWidt h Example 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.
2TKXCVG 5WD EOF9KFVJ*GKIJVA%NKEM)
+OI'FKV1+OCIG - &>KOCIG>QETVKH
+OI'FKV1(KV6Q $'56A(+6
+OI'FKV1&KURNC[
.QCF HTO+PHQ
'&KURNC[ VJG FKOGPUKQPU QH VJG KOCIG RCIG
HTO+PHQNDN+OI*GKIJV%CRVKQP - +OI'FKV1+OCIG*GKIJV
HTO+PHQNDN+OI9KFVJ%CRVKQP - +OI'FKV1ImaqeW1dth
'&KURNC[ VJG : CPF ; TGUQNWVKQP QH VJG KOCIG RCIG
HTO+PHQNDN+OI4GU:%CRVKQP - +OI'FKV1+OCIG4GUQNWVKQP:
HTO+PHQNDN+OI4GU;%CRVKQP - +OI'FKV1+OCIG4GUQNWVKQP;
'&KURNC[ +OCIG 5ECNG *GKIJV
HTO+PHQNDN+OI5ECNG*GKIJV%CRVKQP - +OI'FKV1+OCIG5ECNG*GKIJV
HTO+PHQNDN+OI5ECNG9KFVJ%CRVKQP - +OI'FKV1+OCIG5ECNG9KFVJ
HTO+PHQ5JQY 1
'PF 5WD
ImageWidt h Example 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.
XQKF %+OI'FKV1&NI1P9KFVJ*GKIJV)
]
// &KURNC[U CP KOCIG VJCV KU HKV VQ YKPFQY CPF VJGP FKURNC[U JGKIJV
// YKFVJ TGUQNWVKQP UECNGF JGKIJV CPF UECNGF YKFVJ 6JKU KNNWUVTCVGU
// VJG FKHHGTGPEG DGVYGGP +OCIG*GKIJV/9KFVJ CPF +OCIG5ECNG*GKIJV/9KFVJ
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1(KV6Q0GXV) //$'56A(+6
+OI'FKV1&KURNC[)
%(TO+PHQ HTO+PHQ
// &KURNC[ VJG FKOGPUKQPU QH VJG KOCIG RCIG
%5VTKPI U\9KPFQY6GZV
NQPI N+PHQ
N+PHQ - +OI'FKV1)GV+OCIG*GKIJV)
HTO+PHQNDN+OI*GKIJV(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1OetImaqeW1dth)
HTO+PHQNDN+OI9KFVJ(QTOCV'KN+PHQ)
// &KURNC[ VJG : CPF ; TGUQNWVKQP QH VJG KOCIG RCIG
N+PHQ - +OI'FKV1)GV+OCIG4GUQNWVKQP:)
HTO+PHQNDN+OI4GU:(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG4GUQNWVKQP;)
HTO+PHQNDN+OI4GU;(QTOCV'KN+PHQ)
// &KURNC[ +OCIG 5ECNG *GKIJV
N+PHQ - +OI'FKV1)GV+OCIG5ECNG*GKIJV)
M agnif ierZoom Propert y
335
HTO+PHQNDN+OI5ECNG*GKIJV(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG5ECNG9KFVJ)
HTO+PHQNDN+OI5ECNG9KFVJ(QTOCV'KN+PHQ)
HTO+PHQ&Q/QFCN)
_
Magnif ierZoom Propert y
Descript ion R eturns or sets the zoom factor used by the magnifier window.
Available Wit h
Applies To Image Edit control.
Usage object.MagnifierZoom[=value]
Dat a Type Integer.
Property settings are expressed using the following values:
Remarks Magnification is limited to 6500%.
See Also MagnifierStatus event, ShowMagnifier method, Zoom property (ImageEdit).
Imaging for Windows Professional Edition V2.0
Imaging for Windows Professional Edition V1.0 and V1.1
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Const ant Set t ing Descript ion
wiLockMagnifier - 1 Locks the displayed image in the magnifier window at
the cur rent 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.
Chapt er 7
336
Magnif ierZoom Example VB
This example scrolls the image to a specified location, sets the Magnifier zoom factor, and
then displays the Magnifier window.
2TKXCVG 5WD EOF/CIPKHKGTA%NKEM)
+OI'FKV15ETQNN2QUKVKQP: - 800
+OI'FKV15ETQNN2QUKVKQP; - 1000
'/CIPKHKGT YKPFQY YKNN \QQO WPFGTN[KPI KOCIG FCVC VQ 4 VKOGU KVU UK\G
+OI'FKV1Maqn1f1erZoom - YK4:/CIPKHKGT '1
+OI'FKV15JQY/CIPKHKGT 6TWG
'PF 5WD
Magnif ierZoom Example VC++
This example scrolls the image to a specified location, sets the Magnifier zoom factor, and
then displays the Magnifier window.
XQKF %+OI'FKV1&NI1P/CIPKHKGT)
]
// 6JKU GZCORNG YQWNF UETQNN VJG KOCIG VQ C URGEKHKE NQECVKQP CPF VJGP
// FKURNC[ C OCIPKHKGT YKPFQY 5ETQNN VJG KOCIG VQ C URGEKHKE
// JQTK\QPVCN/XGTVKECN RKZGN NQECVKQP
+OI'FKV15GV5ETQNN2QUKVKQP:800)
+OI'FKV15GV5ETQNN2QUKVKQP;1000)
// /CIPKHKGT YKPFQY YKNN \QQO WPFGTN[KPI KOCIG FCVC VQ 4 VKOGU KVU UK\G
+OI'FKV1SetMaqn1f1erZoom1) // YK4:/CIPKHKGT // 1
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV15JQY/CIPKHKGT647'GXVGXVGXVGXV)
_
MouseIcon Propert y
Descript ion R eturns or sets the mouse icon to be displayed when the mouse pointer is moved over an
Image Edit control.
Available Wit h
Applies To Image Edit control.
Usage object.MouseIcon=LoadPicture(pathname)
Dat a Type Str ing.
The pathname is a str ing expression specifying the path and file name of the file containing
the custom icon (.CUR or .ICO files).
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
M ousePoint er Propert y
337
Remarks The MouseIcon property provides a custom icon that is used when the MousePointer
property is set to 99.
See Also MousePointer property.
MouseIcon Example VB
This example sets a custom mouse pointer. The pointer will change when it is placed over
the ImageEdit control.
2TKXCVG 5WD EOF/QWUG2QKPVGTA%NKEM)
&KO UVT/+EQP #U 5VTKPI
UVT/+EQP - %>2TQITCO (KNGU>&GX5VWFKQ>8$>UCORNGU>2)WKFG>
1RVKOK\G>.KVGPKPIKEQ
+OI'FKV1MouseIcon - .QCF2KEVWTGUVT/+EQP)
+OI'FKV1/QWUG2QKPVGT - YK/2%WUVQO '99
'PF 5WD
MouseIcon Example VC++
This example sets a custom mouse pointer. The pointer will change when it is placed over
the ImageEdit control.
XQKF %+OI'FKV1&NI1P/QWUG+EQP)
]
// 5GVU C EWUVQO OQWUG RQKPVGT RQKPVGT YKNN EJCPIG YJGP RNCEGF QXGT
// VJG +OI'FKV EQPVTQN
// 5GVU VJG URGEKHKE RKEVWTG KEQP
%2KEVWTG*QNFGT RKE1
// %TGCVG VJG KEQP
RKE1%TGCVG(TQO+EQP+&4A/#+0(4#/')
%2KEVWTG ER2KE7RKE1)GV2KEVWTG&KURCVEJ))
// 5RGEKHKGU VJG EWUVQO OQWUG RQKPVGT VQ DG WUGF YJGP VJG OQWUG OQXGU
// QXGT VJG EQPVTQN
// 6JG EWUVQO /QWUG2QKPVGT OWUV DG UGV
+OI'FKV1SetMouseIconER2KE7)
+OI'FKV15GV/QWUG2QKPVGT99) // YK/2%WUVQO // 99
_
MousePoint er Propert y
Descript ion R eturns or sets the type of mouse pointer to be displayed when the pointer is moved over
an Image Edit control at run- time.
Available Wit h
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
338
Applies To Image Edit control.
Usage object.MousePointer[=value]
Dat a Type Integer (enumerated).
Not e: The Hyperlink and OCR Zone M ousePoint er icons are available w it h Imaging f or
Window s Prof essional Edit ion V1.0, V1.1, and V2.0 only.
Const ant Set t ing Descript ion
wiMPDefault 0
(Default)
As deter mined by the value of the Annotation-
Type property
wiMPArrow 1 Ar row
wiMPCross 2 Cross (cross- hair pointer)
wiMPIBeam 3 I- Beam
wiMPIcon 4 Ar row
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 ar row pointing North and South)
wiMPSizeNWSE 8 Size NW SE (double arrow pointing NorthWest
and SouthEast)
wiMPSizeWE 9 Size W E (double ar row pointing West and East)
wiMPUpArrow 10 Up Ar row
wiMPHourGlass 11 Hourglass (wait)
wiMPNoDrop 12 No Drop
wiMPArrowHourglass 13 Ar row and Hourglass
wiMPArrowQuestion 14 Ar row and Question mark
wiMPSizeAll 15 Size All
wiMPFreehandLine 16 Freehand Line
wiMPHollowRect 17 Hollow R ectangle
wiMPFilledRect 18 Filled R ectangle
wiMPRubberStamp 19 Text Stamp
wiMPText 20 Text
wiMPTextFromFile 21 Text From File
wiMPTextAttachment 22 Attach- a- Note
wiMPHand 23 Hand
M ousePoint er Propert y
339
Remarks The MouseIcon property must be set pr ior to setting the MousePointer property to 99.
Use this property to indicate changes in functionality as the mouse pointer passes over
controls on a for m or dialog box. Use the Hourglass setting (11) to indicate that users
should wait for a process or operation to finish.
See Also AnnotationType property, MouseIcon property.
MousePoint er Example VB
This example sets a custom mouse pointer. The pointer will change when it is placed over
the ImageEdit control.
2TKXCVG 5WD EOF/QWUG2QKPVGTA%NKEM)
&KO UVT/+EQP #U 5VTKPI
UVT/+EQP - %>2TQITCO (KNGU>&GX5VWFKQ>8$>UCORNGU>2)WKFG
>1RVKOK\G>.KVGPKPIKEQ
+OI'FKV1/QWUG+EQP - .QCF2KEVWTGUVT/+EQP)
+OI'FKV1MousePo1nter - YK/2%WUVQO '99
'PF 5WD
MousePoint er Example VC++
This example sets a custom mouse pointer. The pointer will change when it is placed over
the ImageEdit control.
XQKF %+OI'FKV1&NI1P/QWUG+EQP)
]
// 5GVU C EWUVQO OQWUG RQKPVGT RQKPVGT YKNN EJCPIG YJGP RNCEGF QXGT
// VJG +OI'FKV EQPVTQN
// 5GVU VJG URGEKHKE RKEVWTG KEQP
%2KEVWTG*QNFGT RKE1
// %TGCVG VJG KEQP
RKE1%TGCVG(TQO+EQP+&4A/#+0(4#/')
%2KEVWTG ER2KE7RKE1)GV2KEVWTG&KURCVEJ))
// 5RGEKHKGU VJG EWUVQO OQWUG RQKPVGT VQ DG WUGF
// YJGP VJG OQWUG OQXGU QXGT VJG EQPVTQN
// 6JG EWUVQO /QWUG2QKPVGT OWUV DG UGV
+OI'FKV15GV/QWUG+EQPER2KE7)
+OI'FKV1SetMousePo1nter99) // YK/2%WUVQO // 99
_
wiMPSelect 24 Image Selection
wiMPHyperlink 25 Hyperlink
wiMPOcrRegion 26 OCR Zone
wiMPCustom 99 Custom pointer specified by the MouseIcon
property
Const ant Set t ing Descript ion
Chapt er 7
340
OcrZoneVisibilit y Propert y
Descript ion R eturns or sets the OCR zones that are shown on the image page.
Available Wit h
Applies To Image Edit control.
Usage object.OcrZoneVisibility[=value]
Dat a Type Integer (enumerated).
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.
See Also AnnotationOcrType property, AnnotationType property, GetSelectedAnnotationOcrType
method, HideAnnotationGroup method, Image OCR control, R emoveAllOCR Marks
method, SelectFirstOcrZone method, SelectNextOcrZone method,
SetSelectedAnnotationOcrType method, ShowAnnotationGroup method.
OCRZoneVisibilit y Example VB
This example shows some property settings you might want to make pr ior to displaying an
image.
2TKXCVG 5WD +OI'FKV1A.QCF$[8CN <QQO #U &QWDNG)
'*GTG CTG UQOG GZCORNGU QH FGHCWNV UGVVKPIU [QW OKIJV YCPV VQ URGEKH[
'RTKQT VQ FKURNC[KPI CP KOCIG 4GRCKPV CP[ EJCPIGU KOOGFKCVGN[
'GZ \QQO QT TGUQNWVKQP EJCPIGU GVE)
+OI'FKV1#WVQ4GHTGUJ - 6TWG
'5ETQNN$CTU CNTGCF[ FGHCWNV VQ VTWG DWV VJKU KU OQFKHKCDNG KH FGUKTGF
+OI'FKV15ETQNN$CTU - 6TWG
'5ECNG DNCEM CPF YJKVG KOCIGU VQ ITC[UECNG
'-GGR EQNQT KOCIG FKURNC[GF CU EQNQT KOCIGU
+OI'FKV1&KURNC[5ECNG#NIQTKVJO - YK5ECNG1RVKOK\G
'#NNQY WUGT VQ UETQNN KOCIG WUKPI MG[DQCTF UJQTVEWVU
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Const ant Set t ing Descript ion
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
Page Propert y
341
+OI'FKV15ETQNN5JQTVEWVU'PCDNGF - 6TWG
'&KURNC[ CNN 1%4 \QPGU
+OI'FKV1OcrZoneV1s1b11ty - YK1ET5JQY#NN<QPGU 'o
'PF 5WD
OCRZoneVisibilit y Example VC++
This example shows some property settings you might want to make pr ior to displaying an
image.
XQKF %+OI'FKV1&NI1P.QCF'FKVEVTN1FQWDNG <QQO)
]
// *GTG CTG UQOG GZCORNGU QH FGHCWNV UGVVKPIU [QW OKIJV YCPV VQ URGEKH[
// RTKQT VQ FKURNC[KPI CP KOCIG 4GRCKPV CP[ EJCPIGU KOOGFKCVGN[
// GZ \QQO QT TGUQNWVKQP EJCPIGU GVE)
+OI'FKV15GV#WVQ4GHTGUJ647')
// 5ETQNN$CTU CNTGCF[ FGHCWNV VQ VTWG DWV VJKU KU OQFKHKCDNG KH FGUKTGF
+OI'FKV15GV5ETQNN$CTU647')
// 5ECNG DNCEM CPF YJKVG KOCIGU VQ ITC[UECNG
// -GGR EQNQT KOCIG FKURNC[GF CU EQNQT KOCIGU
+OI'FKV15GV&KURNC[5ECNG#NIQTKVJO4) // YK5ECNG1RVKOK\G
// #NNQY WUGT VQ UETQNN KOCIG WUKPI MG[DQCTF UJQTVEWVU
+OI'FKV15GV5ETQNN5JQTVEWVU'PCDNGF647')
// &KURNC[ CNN 1%4 \QPGU
+OI'FKV1SetOcrZoneV1s1b11tyo) // YK1ET5JQY#NN<QPGU // o
_
Page Propert y
Descript ion R eturns the page number of an image file where an action was perfor med, or sets the page
number of an image file where an action is to be perfor med.
Available Wit h
Applies To Image Edit control.
Usage object.Page[=value]
Dat a Type Long.
Remarks The default value for this property is 1. This property is typically used to specify the page to
be displayed by the Display method.
See Also Display method, PageCount property.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
342
Page Example VB
This example displays the next page in a multipage file, and deter mines whether there is
another page to display.
2TKXCVG 5WD EOF0GZV2CIGA%NKEM)
&KO NPI0GY2I #U .QPI
NPI0GY2I - +OI'FKV1Paqe 1
'&GVGTOKPG KH VJGTG KU C PGZV RCIG VQ DG FKURNC[GF D[ HKPFKPI QWV
'VJG PWODGT QH RCIGU KP VJG HKNG
+H NPI0GY2I +OI'FKV12CIG%QWPV 6JGP
/UI$QZ 2CIG 0WODGT KU QWV QH TCPIG
'&QP'V UGV RCIG RTQRGTV[
'ZKV 5WD
'PF +H
+OI'FKV1Paqe - NPI0GY2I
+OI'FKV1&KURNC[
'PF 5WD
Page Example VC++
This example displays the next page in a multipage file, and deter mines whether there is
another page to display.
XQKF %+OI'FKV1&NI1P0GZV2CIG)
]
// 6JKU YQWNF FKURNC[ PGZV RCIG KP C OWNVKRCIG HKNG
NQPI NPI0GY2I
NPI0GY2I - +OI'FKV1OetPaqe) 1
// &GVGTOKPG KH VJGTG KU C PGZV RCIG VQ DG FKURNC[GF D[ HKPFKPI QWV
// VJG PWODGT QH RCIGU KP VJG HKNG
KHNPI0GY2I +OI'FKV1)GV2CIG%QWPV))
]
#HZ/GUUCIG$QZ2CIG 0WODGT KU QWV QH TCPIG)
// &QP'V UGV RCIG RTQRGTV[
TGVWTP
_
+OI'FKV15GV2CIGNPI0GY2I)
+OI'FKV1&KURNC[)
_
PageCount Propert y
Descript ion R eturns the total number of pages in the image file that is cur rently being displayed.
Available Wit h
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
PageCount Propert y
343
Applies To Image Edit control.
Usage object.PageCount
Dat a Type Long.
Remarks If an image is not being displayed, the PageCount property retur ns 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 er ror.
Available at run- time as read- only.
See Also Image property, Page property.
PageCount Example VB
This example displays the next page in a multipage file, and deter mines whether there is
another page to display.
2TKXCVG 5WD EOF0GZV2CIGA%NKEM)
&KO NPI0GY2I #U .QPI
NPI0GY2I - +OI'FKV12CIG 1
'&GVGTOKPG KH VJGTG KU C PGZV RCIG VQ DG FKURNC[GF D[ HKPFKPI QWV
'VJG PWODGT QH RCIGU KP VJG HKNG
+H NPI0GY2I +OI'FKV1PaqeOount 6JGP
/UI$QZ 2CIG 0WODGT KU QWV QH TCPIG
'&QP'V UGV RCIG RTQRGTV[
'ZKV 5WD
'PF +H
+OI'FKV12CIG - NPI0GY2I
+OI'FKV1&KURNC[
'PF 5WD
PageCount Example VC++
This example displays the next page in a multipage file, and deter mines whether there is
another page to display.
XQKF %+OI'FKV1&NI1P0GZV2CIG)
]
// 6JKU YQWNF FKURNC[ PGZV RCIG KP C OWNVKRCIG HKNG
NQPI NPI0GY2I
NPI0GY2I - +OI'FKV1)GV2CIG) 1
// &GVGTOKPG KH VJGTG KU C PGZV RCIG VQ DG FKURNC[GF D[ HKPFKPI QWV
// VJG PWODGT QH RCIGU KP VJG HKNG
KHNPI0GY2I +OI'FKV1OetPaqeOount))
]
#HZ/GUUCIG$QZ2CIG 0WODGT KU QWV QH TCPIG)
// &QP'V UGV RCIG RTQRGTV[
TGVWTP
_
Chapt er 7
344
+OI'FKV15GV2CIGNPI0GY2I)
+OI'FKV1&KURNC[)
_
PageType Propert y
Descript ion R eturns the page type of the image specified in the Image property and the page specified
in the Page property.
Available Wit h
Applies To Image Edit control.
Usage object.PageType
Dat a Type Integer (enumerated).
Property settings are expressed using the following values:
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.
See Also ConvertPageType method, Page property, SaveAs method, SavePage method.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Const ant Set t ing Descript ion
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 R GB, 24- bit
wiPageTypeBGR24 7 BGR , 24- bit
Pict ureDisabled Propert y
345
PageType Example VB
This example uses the PageType property to deter mine the page type of the image specified
in the Image property.
2TKXCVG 5WD EOF2CIG6[RGA%NKEM)
'4GCFU VJG 2CIG6[RG RTQRGTV[ VQ FGVGTOKPG VJG RCIG V[RG QH
'VJG KOCIG URGEKHKGF KP VJG +OCIG RTQRGTV[
&KO UVT+OI2CIG6[RG #U 5VTKPI
'4GCF VJG 2CIG6[RG RTQRGTV[ CPF VTCPUNCVG VJG XCNWG VQ C
'EQTTGURQPFKPI UVTKPI
5GNGEV %CUG +OI'FKV1PaqeTye
%CUG 1
UVT+OI2CIG6[RG - $NCEM CPF 9JKVG
%CUG
UVT+OI2CIG6[RG - 4 DKV ITC[UECNG
%CUG o
UVT+OI2CIG6[RG - 8 DKV ITC[UECNG
%CUG 4
UVT+OI2CIG6[RG - 4 DKV RCNGVVK\GF
%CUG b
UVT+OI2CIG6[RG - 8 DKV RCNGVVK\GF
%CUG b
UVT+OI2CIG6[RG - 4 DKV 4)$
%CUG 7
UVT+OI2CIG6[RG - 4 DKV $)4
'PF 5GNGEV
'&KURNC[ VJG RCIG V[RG QP C HQTO HQT KPHQTOCVKQPCN RWTRQUGU QT VQ
'CNNQY KV VQ DG OQFKHKGF
HTO+PHQNDN+OI+PHQ1)%CRVKQP - UVT+OI2CIG6[RG
'PF 5WD
Pict ureDisabled Propert y
Descript ion R eturns or sets the bitmap image that appears on the control when its Enabled property is
set to False (disabled).
Available Wit h
Applies To Image Annotation control.
Usage object.PictureDisabled[=picture]
Dat a Type Picture.
Remarks The bitmap is scaled to fit the size of the control. If no bitmap is specified, the default
bitmap is used.
See Also Enabled property, PictureDown property, PictureUp property.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
346
Pict ureDisabled Example VB
This example demonstrates how to use the PictureUp, PictureDown, and PictureDisabled
properties to display the appropr iate bitmap images on an Image Annotation Tool Button
control.
PictureUp Sets the bitmap picture that is displayed when the button is enabled, but not
selected.
PictureDown Sets the bitmap picture that is displayed when the button is selected.
PictureDisabled Sets the bitmap picture that is displayed when the button is disabled.
2TKXCVG 5WD HTO6QQN2CNA.QCF)
'9JGP WUKPI VJG CPPQVCVKQP EQPVTQN VQ ETGCVG C EWUVQO VQQN RCNGVVG [QW
'ECP FGUKIPCVG DKVOCRU VQ DG WUGF QP VJG VQQNU YJGP VJG[ CTG KP XCTKQWU
'UVCVGU +H VJGUG XCNWGU CTG PQV URGEKHKGF FGHCWNV XCNWGU YKNN DG WUGF
'0QVG VJCV KV OC[ DG OQTG GHHKEKGPV VQ UGV VJGUG RTQRGTVKGU CV
'FGUKIP VKOG
'&GHKPGU YJCV RKEVWTG YKNN DG UJQYP KH VJG DWVVQP KU GPCDNGF
+OI#PP6QQN12KEVWTG7R - .QCF2KEVWTG&>[QWTCRR>NKPGWRDOR)
'&GHKPGU YJCV RKEVWTG YKNN DG UJQYP YJGP VJG DWVVQP KU UGNGEVGF
+OI#PP6QQN12KEVWTG&QYP - .QCF2KEVWTG&>[QWTCRR>NKPGFQYPDOR)
'&GHKPGU YJCV RKEVWTG YKNN DG UJQYP YJGP VJG DWVVQP KU FKUCDNGF ITC[GF)
+OI#PP6QQN1P1ctureD1sabed - .QCF2KEVWTG&>[QWTCRR>NKPGQHHDOR)
'PF 5WD
Pict ureDown Propert y
Descript ion R eturns 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 Wit h
Applies To Image Annotation control.
Usage object.PictureDown[=picture]
Dat a 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):
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Pict ureDow n Propert y
347
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.
See Also DestImageControl property, PictureDisabled property, PictureUp property, Value property.
Pict ureDown Example VB
This example demonstrates how to use the PictureUp, PictureDown, and PictureDisabled
properties to display the appropr iate bitmap images on an Image Annotation Tool Button
control.
PictureUp Sets the bitmap picture that is displayed when the button is enabled, but not
selected.
PictureDown Sets the bitmap picture that is displayed when the button is selected.
PictureDisabled Sets the bitmap picture that is displayed when the button is disabled.
2TKXCVG 5WD HTO6QQN2CNA.QCF)
'9JGP WUKPI VJG CPPQVCVKQP EQPVTQN VQ ETGCVG C EWUVQO VQQN RCNGVVG [QW 'ECP FGUKIPCVG
DKVOCRU VQ DG WUGF QP VJG VQQNU YJGP VJG[ CTG KP XCTKQWU
'UVCVGU +H VJGUG XCNWGU CTG PQV URGEKHKGF FGHCWNV XCNWGU YKNN DG WUGF
'0QVG VJCV KV OC[ DG OQTG GHHKEKGPV VQ UGV VJGUG RTQRGTVKGU CV
'FGUKIP VKOG
'&GHKPGU YJCV RKEVWTG YKNN DG UJQYP KH VJG DWVVQP KU GPCDNGF
+OI#PP6QQN12KEVWTG7R - .QCF2KEVWTG&>[QWTCRR>NKPGWRDOR)
'&GHKPGU YJCV RKEVWTG YKNN DG UJQYP YJGP VJG DWVVQP KU UGNGEVGF
+OI#PP6QQN1P1ctureDown - .QCF2KEVWTG&>[QWTCRR>NKPGFQYPDOR)
'&GHKPGU YJCV RKEVWTG YKNN DG UJQYP YJGP VJG DWVVQP KU FKUCDNGF ITC[GF)
+OI#PP6QQN12KEVWTG&KUCDNGF - .QCF2KEVWTG&>[QWTCRR>NKPGQHHDOR)
'PF 5WD
Chapt er 7
348
Pict ureUp Propert y
Descript ion R eturns 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 Wit h
Applies To Image Annotation control.
Usage object.PictureUp[=picture]
Dat a Type Picture.
Remarks The bitmap is scaled to fit the size of the control. If no bitmap is specified, the default
bitmap is used.
See Also Enabled property, PictureDisabled property, PictureDown property, Value property.
Pict ureUp Example VB
This example demonstrates how to use the PictureUp, PictureDown, and PictureDisabled
properties to display the appropr iate bitmap images on an Image Annotation Tool Button
control.
PictureUp Sets the bitmap picture that is displayed when the button is enabled, but not
selected.
PictureDown Sets the bitmap picture that is displayed when the button is selected.
PictureDisabled Sets the bitmap picture that is displayed when the button is disabled.
2TKXCVG 5WD HTO6QQN2CNA.QCF)
'9JGP WUKPI VJG CPPQVCVKQP EQPVTQN VQ ETGCVG C EWUVQO VQQN RCNGVVG [QW
'ECP FGUKIPCVG DKVOCRU VQ DG WUGF QP VJG VQQNU YJGP VJG[ CTG KP XCTKQWU
'UVCVGU +H VJGUG XCNWGU CTG PQV URGEKHKGF FGHCWNV XCNWGU YKNN DG WUGF
'0QVG VJCV KV OC[ DG OQTG GHHKEKGPV VQ UGV VJGUG RTQRGTVKGU CV
'FGUKIP VKOG
'&GHKPGU YJCV RKEVWTG YKNN DG UJQYP KH VJG DWVVQP KU GPCDNGF
+OI#PP6QQN1P1ctureU - .QCF2KEVWTG&>[QWTCRR>NKPGWRDOR)
'&GHKPGU YJCV RKEVWTG YKNN DG UJQYP YJGP VJG DWVVQP KU UGNGEVGF
+OI#PP6QQN12KEVWTG&QYP - .QCF2KEVWTG&>[QWTCRR>NKPGFQYPDOR)
'&GHKPGU YJCV RKEVWTG YKNN DG UJQYP YJGP VJG DWVVQP KU FKUCDNGF ITC[GF)
+OI#PP6QQN12KEVWTG&KUCDNGF - .QCF2KEVWTG&>[QWTCRR>NKPGQHHDOR)
'PF 5WD
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
ReadySt at e Propert y
349
ReadySt at e Propert y
Descript ion R eturns 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 R eadyState property and R eadyStateChange event are intended for use with HTML
scripts only. Use them to manage the asynchronous downloading of images from the World
Wide Web.
Available Wit h
Applies To Image Edit and Image Annotation controls.
Usage object.ReadyState[=value]
Dat a Type Long.
Property settings are expressed using the following values:
Remarks This property is useful when the Image property is set to a UR L pathname.
The control perfor ms methods only when its R eadyState property is 4.
Available at run- time as read- only.
See Also Image property, R eadyStateChange event.
Imaging for Windows Professional Edition V2.0
Imaging for Windows Professional Edition V1.0 and V1.1
Imaging for Windows 98
Imaging for Windows 95
Imaging for Windows NT 4.0
Set t ing Descript ion
0 (default) The control is initializing and retr ieving properties; cannot perfor m methods.
2 The control has initialized and downloading has started; cannot perfor m
methods.
4 The control is ready for all requests; can perfor m methods.
Chapt er 7
350
ScrollBars Propert y
Descript ion R eturns or sets whether a displayed image contains hor izontal and/ or vertical scroll bars.
Available Wit h
Applies To Image Edit control.
Usage object.ScrollBars[={True|False}]
Dat a Type Boolean.
Remarks If this property is set to True, hor izontal and/ or vertical scroll bars are displayed only when
the image extends beyond the objects borders. If the image has scroll bars and the
ScrollShortcutsEnabled property is set to True, accelerator keys are provided to per mit
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.
See Also AutoR efresh property, Scroll event, ScrollImage method, ScrollPositionX property,
ScrollPositionY property, ScrollShortcutsEnabled property.
ScrollBars Example VB
This example shows some property settings you might want to make pr ior to displaying an
image.
2TKXCVG 5WD +OI'FKV1A.QCF$[8CN <QQO #U &QWDNG)
'*GTG CTG UQOG GZCORNGU QH FGHCWNV UGVVKPIU [QW OKIJV YCPV VQ URGEKH[
'RTKQT VQ FKURNC[KPI CP KOCIG 4GRCKPV CP[ EJCPIGU KOOGFKCVGN[
'GZ \QQO QT TGUQNWVKQP EJCPIGU GVE)
+OI'FKV1#WVQ4GHTGUJ - 6TWG
'5ETQNN$CTU CNTGCF[ FGHCWNV VQ VTWG DWV VJKU KU OQFKHKCDNG KH FGUKTGF
+OI'FKV1ScroBars - 6TWG
'5ECNG DNCEM CPF YJKVG KOCIGU VQ ITC[UECNG -GGR EQNQT KOCIG
'FKURNC[GF CU EQNQT KOCIGU
+OI'FKV1&KURNC[5ECNG#NIQTKVJO - YK5ECNG1RVKOK\G
'#NNQY WUGT VQ UETQNN KOCIG WUKPI MG[DQCTF UJQTVEWVU
+OI'FKV15ETQNN5JQTVEWVU'PCDNGF - 6TWG
'&KURNC[ CNN 1%4 \QPGU
+OI'FKV11ET<QPG8KUKDKNKV[ - YK1ET5JQY#NN<QPGU 'o
'PF 5WD
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Set t ing Descript ion
True (default) Hor izontal and/ or vertical scroll bars are displayed.
False No scroll bars are displayed.
Scroll Posit ionX Propert y
351
ScrollBars Example VC++
This example shows some property settings you might want to make pr ior to displaying an
image.
XQKF %+OI'FKV1&NI1P.QCF'FKVEVTN1FQWDNG <QQO)
]
// *GTG CTG UQOG GZCORNGU QH FGHCWNV UGVVKPIU [QW OKIJV YCPV VQ URGEKH[
// RTKQT VQ FKURNC[KPI CP KOCIG 4GRCKPV CP[ EJCPIGU KOOGFKCVGN[
// GZ \QQO QT TGUQNWVKQP EJCPIGU GVE)
+OI'FKV15GV#WVQ4GHTGUJ647')
// 5ETQNN$CTU CNTGCF[ FGHCWNV VQ VTWG DWV VJKU KU OQFKHKCDNG KH FGUKTGF
+OI'FKV1SetScroBars647')
// 5ECNG DNCEM CPF YJKVG KOCIGU VQ ITC[UECNG -GGR EQNQT KOCIG
// FKURNC[GF CU EQNQT KOCIGU
+OI'FKV15GV&KURNC[5ECNG#NIQTKVJO4) // YK5ECNG1RVKOK\G
// #NNQY WUGT VQ UETQNN KOCIG WUKPI MG[DQCTF UJQTVEWVU
+OI'FKV15GV5ETQNN5JQTVEWVU'PCDNGF647')
// &KURNC[ CNN 1%4 \QPGU
+OI'FKV15GV1ET<QPG8KUKDKNKV[o) // YK1ET5JQY#NN<QPGU // o
_
ScrollPosit ionX Propert y
Descript ion R eturns or sets the hor izontal scroll position in pixels.
Available Wit h
Applies To Image Edit control.
Usage object.ScrollPositionX[=value]
Dat a Type Long.
Remarks Setting the ScrollPositionX property causes the displayed image to scroll hor izontally to the
pixel position specified.
To set the scroll position pr ior 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- wr ite.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
352
See Also AutoR efresh property, Display method, Load event, Scroll event, ScrollBars property,
ScrollImage method, ScrollPositionY property.
ScrollPosit ionX Example VB
This example scrolls the image to a specified location, sets the Magnifier zoom factor, and
then displays the Magnifier window.
2TKXCVG 5WD EOF/CIPKHKGTA%NKEM)
+OI'FKV1ScroPos1t1onX - 800
+OI'FKV15ETQNN2QUKVKQP; - 1000
'/CIPKHKGT YKPFQY YKNN \QQO WPFGTN[KPI KOCIG FCVC VQ 4 VKOGU KVU UK\G
+OI'FKV1/CIPKHKGT<QQO - YK4:/CIPKHKGT '1
+OI'FKV15JQY/CIPKHKGT 6TWG
'PF 5WD
ScrollPosit ionX Example VC++
This example scrolls the image to a specified location, sets the Magnifier zoom factor, and
then displays the Magnifier window.
XQKF %+OI'FKV1&NI1P/CIPKHKGT)
]
// 6JKU GZCORNG YQWNF UETQNN VJG KOCIG VQ C URGEKHKE NQECVKQP CPF VJGP
// FKURNC[ C OCIPKHKGT YKPFQY 5ETQNN VJG KOCIG VQ C URGEKHKE
// JQTK\QPVCN/XGTVKECN RKZGN NQECVKQP
+OI'FKV1SetScroPos1t1onX800)
+OI'FKV15GV5ETQNN2QUKVKQP;1000)
// /CIPKHKGT YKPFQY YKNN \QQO WPFGTN[KPI KOCIG FCVC VQ 4 VKOGU KVU UK\G
+OI'FKV15GV/CIPKHKGT<QQO1) // YK4:/CIPKHKGT // 1
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV15JQY/CIPKHKGT647'GXVGXVGXVGXV)
_
ScrollPosit ionY Propert y
Descript ion R eturns or sets the vertical scroll position in pixels.
Available Wit h
Applies To Image Edit control.
Usage object.ScrollPositionY[=value]
Dat a Type Long.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Scroll Posit ionY Propert y
353
Remarks Setting the ScrollPositionY property causes the displayed image to scroll vertically to the
pixel position specified.
To set the scroll position pr ior 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- wr ite.
See Also AutoR efresh property, Display method, Load event, Scroll event, ScrollBars property,
ScrollImage method, ScrollPositionX property.
ScrollPosit ionY Example VB
This example scrolls the image to a specified location, sets the Magnifier zoom factor, and
then displays the Magnifier window.
2TKXCVG 5WD EOF/CIPKHKGTA%NKEM)
+OI'FKV15ETQNN2QUKVKQP: - 800
+OI'FKV1ScroPos1t1onY - 1000
'/CIPKHKGT YKPFQY YKNN \QQO WPFGTN[KPI KOCIG FCVC VQ 4 VKOGU KVU UK\G
+OI'FKV1/CIPKHKGT<QQO - YK4:/CIPKHKGT '1
+OI'FKV15JQY/CIPKHKGT 6TWG
'PF 5WD
ScrollPosit ionY Example VC++
This example scrolls the image to a specified location, sets the Magnifier zoom factor, and
then displays the Magnifier window.
XQKF %+OI'FKV1&NI1P/CIPKHKGT)
]
// 6JKU GZCORNG YQWNF UETQNN VJG KOCIG VQ C URGEKHKE NQECVKQP CPF VJGP
// FKURNC[ C OCIPKHKGT YKPFQY 5ETQNN VJG KOCIG VQ C URGEKHKE
// JQTK\QPVCN/XGTVKECN RKZGN NQECVKQP
+OI'FKV15GV5ETQNN2QUKVKQP:800)
+OI'FKV1SetScroPos1t1onY1000)
// /CIPKHKGT YKPFQY YKNN \QQO WPFGTN[KPI KOCIG FCVC VQ 4 VKOGU KVU UK\G
+OI'FKV15GV/CIPKHKGT<QQO1) // YK4:/CIPKHKGT // 1
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV15JQY/CIPKHKGT647'GXVGXVGXVGXV)
_
Chapt er 7
354
ScrollShort cut sEnabled Propert y
Descript ion R eturns or sets whether the object recognizes a set of accelerator keys for scrolling a
displayed image provided hor izontal and/ or vertical scroll bars are present.
Available Wit h
Applies To Image Edit control.
Usage object.ScrollShortcutsEnabled[={True|False}]
Dat a Type Boolean.
Remarks If this property and the ScrollBars property are set to True, and the image extends beyond
the objects 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:
See Also Scroll event, ScrollBars property, ScrollImage method.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Set t ing Descript ion
True (default) Accelerator keys can be used to scroll an image.
False Accelerator keys cannot be used.
Accelerat or Key Descript ion
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 r ight by one full screen.
Ctrl + Page Up Scrolls the image to the left by one full screen.
R ight Arrow Scrolls the image to the r ight by 4 pixels.
Left Arrow Scrolls the image to the left by 4 pixels.
Up Arrow Scrolls the image upward by 4 pixels.
Down Ar row Scrolls the image downward by 4 pixels.
ScrollShort cut sEnabled Propert y
355
ScrollShort cut sEnabled Example VB
This example shows some property settings you might want to make pr ior to displaying an
image.
2TKXCVG 5WD +OI'FKV1A.QCF$[8CN <QQO #U &QWDNG)
'*GTG CTG UQOG GZCORNGU QH FGHCWNV UGVVKPIU [QW OKIJV YCPV VQ URGEKH[
'RTKQT VQ FKURNC[KPI CP KOCIG 4GRCKPV CP[ EJCPIGU KOOGFKCVGN[
'GZ \QQO QT TGUQNWVKQP EJCPIGU GVE)
+OI'FKV1#WVQ4GHTGUJ - 6TWG
'5ETQNN$CTU CNTGCF[ FGHCWNV VQ VTWG DWV VJKU KU OQFKHKCDNG KH FGUKTGF
+OI'FKV15ETQNN$CTU - 6TWG
'5ECNG DNCEM CPF YJKVG KOCIGU VQ ITC[UECNG -GGR EQNQT KOCIG
'FKURNC[GF CU EQNQT KOCIGU
+OI'FKV1&KURNC[5ECNG#NIQTKVJO - YK5ECNG1RVKOK\G
'#NNQY WUGT VQ UETQNN KOCIG WUKPI MG[DQCTF UJQTVEWVU
+OI'FKV1ScroShortcutsEnabed - 6TWG
'&KURNC[ CNN 1%4 \QPGU
+OI'FKV11ET<QPG8KUKDKNKV[ - YK1ET5JQY#NN<QPGU 'o
'PF 5WD
ScrollShort cut sEnabled Example VC++
This example shows some property settings you might want to make pr ior to displaying an
image.
XQKF %+OI'FKV1&NI1P.QCF'FKVEVTN1FQWDNG <QQO)
]
// *GTG CTG UQOG GZCORNGU QH FGHCWNV UGVVKPIU [QW OKIJV YCPV VQ URGEKH[
// RTKQT VQ FKURNC[KPI CP KOCIG 4GRCKPV CP[ EJCPIGU KOOGFKCVGN[
// GZ \QQO QT TGUQNWVKQP EJCPIGU GVE)
+OI'FKV15GV#WVQ4GHTGUJ647')
// 5ETQNN$CTU CNTGCF[ FGHCWNV VQ VTWG DWV VJKU KU OQFKHKCDNG KH FGUKTGF
+OI'FKV15GV5ETQNN$CTU647')
// 5ECNG DNCEM CPF YJKVG KOCIGU VQ ITC[UECNG -GGR EQNQT KOCIG
// FKURNC[GF CU EQNQT KOCIGU
+OI'FKV15GV&KURNC[5ECNG#NIQTKVJO4) // YK5ECNG1RVKOK\G
// #NNQY WUGT VQ UETQNN KOCIG WUKPI MG[DQCTF UJQTVEWVU
+OI'FKV1SetScroShortcutsEnabed647')
// &KURNC[ CNN 1%4 \QPGU
+OI'FKV15GV1ET<QPG8KUKDKNKV[o) // YK1ET5JQY#NN<QPGU // o
_
Chapt er 7
356
Select ionRect angle Propert y
Descript ion R eturns 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 Wit h
Applies To Image Edit control.
Usage object.SelectionRectangle[={True|False}]
Dat a Type Boolean.
Remarks Once an end user draws a selection box, cutting and copying to the Clipboard can be
accomplished.
See Also ClipboardCopy method, ClipboardCut method, SelectionR ectDrawn event,
ZoomToSelection method.
Select ionRect angle Example VB
This example draws a selection rectangle on an image and zooms in on the area bound by
the rectangle.
2TKXCVG 5WD EOF<QQO5GNGEVA%NKEM)
''PCDNG TGEVCPING FTCYKPI
+OI'FKV1Seect1onRectanqe - 6TWG
'&TCY TGEVCPING
+OI'FKV1&TCY5GNGEVKQP4GEV 1b0 00 400 400
+OI'FKV1<QQO6Q5GNGEVKQP
'PF 5WD
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Set t ing Descript ion
True (default) Selection box drawing is enabled.
False Selection box drawing is not enabled.
St at usCode Propert y
357
Select ionRect angle Example VC++
This example draws a selection rectangle on an image and zooms in on the area bound by
the rectangle.
XQKF %+OI'FKV1&NI1P<QQOVQ)
]
// 6JKU YQWNF FTCY C TGEVCPING QP CP KOCIG CPF YQWNF \QQO KP QP VJG CTGC
// DQWPF D[ VJG TGEVCPING CPF GPCDNG TGEVCPING FTCYKPI
+OI'FKV1SetSeect1onRectanqe647')
// &TCY TGEVCPING
+OI'FKV1&TCY5GNGEVKQP4GEV 1b0 00 400 400)
+OI'FKV1<QQO6Q5GNGEVKQP)
_
St at usCode Propert y
Descript ion R eturns a status code, which identifies the er ror that occur red when the last property was
set or read, or the last method was invoked. A status code of 0 indicates that no er ror has
occurred.
Available Wit h
Applies To Image Edit, Image Scan, Image Admin (Win 98 and Pro V2.0 only), Image Annotation,
and Image Thumbnail (Win 98 and Pro V2.0 only) controls.
Usage object.StatusCode
Dat a Type Long.
Remarks The default value for this property is 0.
Available at run- time as read- only.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
358
UndoLevels Propert y
Descript ion R eturns or sets the number of per missible undo levels.
Available Wit h
Applies To Image Edit control.
Usage object.UndoLevels[=value]
Dat a Type Long.
Remarks The Undo method is limited to the number of undo levels specified in this property.
See Also ContinueWithoutUndo property, ErrorSavingUndoInfor mation event, R edo method,
Undo method.
UndoLevels Example VB
This example illustrates how to enable Undo functionality in an application.
2TKXCVG 5WD (QTOA.QCF)
'7PFQ.GXGNU OWUV DG UGV CV HQTO NQCF VQ CNNQECVG WPFQ DWHHGTU
+OI'FKV1UndoLeves - 1
'PF 5WD
2TKXCVG 5WD EOF7PFQA%NKEM)
'6JG 7PFQ OGVJQF YKNN WPFQ VJG NCUV KOCIKPI QRGTCVKQP RGTHQTOGF
+OI'FKV17PFQ
'PF 5WD
UndoLevels Example VC++
This example illustrates how to set Undo levels on initialization.
$11. %+OI'FKV1&NI1P+PKV&KCNQI)
]
%&KCNQI1P+PKV&KCNQI)
DNP+U4GEVCPING - (#.5'
// 7PFQ.GXGNU OWUV DG UGV CV HQTO NQCF VQ CNNQECVG WPFQ DWHHGTU
+OI'FKV1SetUndoLevesI)
TGVWTP 647' // TGVWTP 647' WPNGUU [QW UGV VJG HQEWU VQ C EQPVTQN
_
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 98
Imaging for Windows 95
Imaging for Windows NT 4.0
Set t ing Descript ion
0 (default) No levels of undo
1 1 level of undo
UseCheckCont inuePrint ing Propert y
359
XQKF %+OI'FKV1&NI1P7PFQ)
]
// 6JG 7PFQ OGVJQF YKNN WPFQ VJG NCUV KOCIKPI QRGTCVKQP RGTHQTOGF
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV17PFQGXV)
_
UseCheckCont inuePrint ing Propert y
Descript ion R eturns or sets how the control handles a pr int cancellation/ continuation request.
Available Wit h
Applies To Image Edit control.
Usage object.UseCheckContinuePrinting[={True|False}]
Dat a Type Boolean.
Remarks Setting this property to True enables you to use the ContinuePrinting property and the
CheckContinuePrinting event to handle a pr int cancellation/ continuation request.
The CheckContinuePr inting event fires whenever a pr int operation requests whether it
should cancel or continue pr inting. The ContinuePr inting property provides the event
with the desired response.
See Also CheckContinuePr inting event, ContinuePr inting property, Pr intImage method.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 98
Imaging for Windows 95
Imaging for Windows NT 4.0
Set t ing Descript ion
True Pr int cancellation/ continuation is handled through the
CheckContinuePr inting event.
False (default) Standard pr int cancellation/ continuation handling.
Chapt er 7
360
Value Propert y
Descript ion 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:
s
The bitmap specified in the PictureDown property is drawn on the control
s
Other controls on the for m with the same DestImageControl property value have
their Value property set to False automatically
s
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 Wit h
Applies To Image Annotation control.
Usage object.Value[={True|False}]
Dat a Type Boolean.
Remarks This property is available only at run- time.
See Also AnnotationType property, DestImageControl property, PictureDown property, PictureUp
property.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Set t ing Descript ion
True The control is selected.
False (default) The control is deselected.
Zoom Propert y
361
Zoom Propert y
Descript ion R eturns or sets the zoom factor for an image.
Available Wit h
Applies To Image Edit control.
Usage object.Zoom[=value]
Dat a 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.
See Also AutoR efresh property, FitTo method, Image property, MagnifierStatus event,
MagnifierZoom property, Zoom property (Image Scan), ZoomToSelection method.
Zoom Example VB
The following example reduces the cur rent zoom factor by one half, and then repaints the
image display.
2TKXCVG 5WD EOF<QQOA%NKEM)
+OI'FKV1<QQO - +OI'FKV1Zoom /
+OI'FKV14GHTGUJ
'PF 5WD
Zoom Example VC++
The following example reduces the cur rent zoom factor by one half, and then repaints the
image display.
XQKF %+OI'FKV1&NI1P<QQO)
]
// 6JKU YQWNF TGFWEG VJG EWTTGPV \QQO HCEVQT D[ QPG JCNH CPF VJGP
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
362
// TGRCKPV VJG KOCIG FKURNC[
+OI'FKV1SetZoom+OI'FKV1)GV<QQO) / )
+OI'FKV14GHTGUJ)
_
About Box Met hod
Descript ion Displays an About dialog box (shown here) that contains the version number of the control.
Available Wit h
Applies To Image Edit, Image Annotation, Image Admin, Image OCR , Image Scan, and Image
Thumbnail controls.
Usage object.AboutBox
Argument s None.
Ret urns None.
AddAnnot at ionGroup Met hod
Descript ion Adds a new annotation group to an image page.
Available Wit h
Applies To Image Edit control.
Usage object.AddAnnotationGroup GroupName
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
AddAnnot at ionGroup M et hod
363
Argument s The AddAnnotationGroup method has the following argument:
Ret urns None.
Remarks The Display method must be invoked pr ior 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.
See Also DeleteAnnotationGroup method, Display method, ImageModified property.
AddAnnot at ionGroup Example 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.)
2TKXCVG 5WD EOF#FF)TQWRA%NKEM)
+OI'FKV1AddAnnotat1onOrou #EEQWPVKPI &GRV
+OI'FKV1#PPQVCVKQP6[RG - YK6GZV#VVCEJOGPV '10
+OI'FKV1#PPQVCVKQP$CEM%QNQT - XD;GNNQY
+OI'FKV1&TCY 10 10 1b0 100
'6JG WUGT OWUV OCPWCNN[ GPVGT VJG VGZV QP VJG CVVCEJOGPV
'PF 5WD
AddAnnot at ionGroup Example 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.)
XQKF %(TO)TQWR1P#FF)TQWR)
]
// #FFU C ITQWR CPF FTCYU C OCTM KP VJG ITQWR #PPQVCVKQP ITQWRU
// CTG PQV CEVWCNN[ ETGCVGF WPVKN C OCTM KU FTCYP KP VJG ITQWR
%5VTKPI U\%WT)TQWR
U\%WT)TQWR(QTOCV#EEQWPVKPI &GRV 'KTCPF))
// )GV VJG PCOG QH VJG ITQWR VJG WUGT ENKEMGF QP KP VJG NKUVDQZ
OA)TQWR.KUV#FF5VTKPIU\%WT)TQWR)
KHR2CTGPV&NI)
]
R2CTGPV&NI+OI'FKV1AddAnnotat1onOrouU\%WT)TQWR)
R2CTGPV&NI+OI'FKV15GV#PPQVCVKQP6[RG10) // YK6GZV#VVCEJOGPV // 10
R2CTGPV&NI+OI'FKV15GV#PPQVCVKQP$CEM%QNQT0Z(((() // XD;GNNQY
8#4+#06 X9KFVJ 8A86oX9KFVJ) - 86A+ 8A+oX9KFVJ) - 1b0
Paramet er Dat a Type Descript ion
GroupName Str ing The name of the new annotation group.
Chapt er 7
364
8#4+#06 X*GKIJV 8A86oX*GKIJV) - 86A+ 8A+oX*GKIJV) - 100
R2CTGPV&NI+OI'FKV1&TCY10 10 X9KFVJ X*GKIJV)
_
// 6JG WUGT OWUV OCPWCNN[ GPVGT VJG VGZV QP VJG CVVCEJOGPV
_
Aut oCrop Met hod
Descript ion Automatically crops the displayed image.
Available Wit h
Applies To Image Edit control.
Usage object.AutoCrop [Option]
Argument s The AutoCrop method has the following argument:
Ret urns None.
Remarks The Display method must be invoked pr ior 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.
See Also Crop method, Display method, ImageModified property, Save method, SaveAs method,
SavePage method.
Aut oCrop Example 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.)
2TKXCVG 5WD EOF%NGCPWRA%NKEM)
'2GTHQTO CWVQOCVKE UVTCKIJVGP QP VJG KOCIG
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing Descript ion
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.
Aut oDeskew M et hod
365
+OI'FKV1#WVQ&GUMGY
'4GOQXG URGEMNGU QP VJG KOCIG WUKPI VJG FGHCWNV
'VJTGUJQNF XCNWG HQT FQV UK\G
+OI'FKV1&GURGEMNG
'+H VJGTG KU C NQV QH GZVTCPGQWU URCEG CTQWPF KOCIG
'DQTFGTU ETQRRKPI OKIJV TGFWEG RTQEGUUKPI VKOG
+OI'FKV1AutoOro
'5JQY VJG 1%4 FKCNQI DQZ
+OI1%415JQY1%4
'PF 5WD
Aut oCrop Example 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.)
XQKF %+OI'FKV1&NI1P%NGCPWR)
]
// *GTG CTG UQOG HWPEVKQPU [QW OKIJV YCPV VQ RGTHQTO QP CP KOCIG RTKQT
// VQ 1%4
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
// 2GTHQTO CWVQOCVKE UVTCKIJVGP QP VJG KOCIG
+OI'FKV1#WVQ&GUMGY)
// 4GOQXG URGEMNGU QP VJG KOCIG WUKPI VJG FGHCWNV VJTGUJQNF XCNWG HQT
// FQV UK\G
+OI'FKV1&GURGEMNGGXV)
// +H VJGTG KU C NQV QH GZVTCPGQWU URCEG CTQWPF KOCIG
// DQTFGTU ETQRRKPI OKIJV TGFWEG RTQEGUUKPI VKOG
+OI'FKV1AutoOroGXV)
// 5JQY VJG 1%4 FKCNQI DQZ
+OI1ET15JQY1ET)
_
Aut oDeskew Met hod
Descript ion Automatically deskews (straightens) the displayed image.
Available Wit h
Applies To Image Edit control.
Usage object.AutoDeskew
Argument s None.
Ret urns None.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
366
Remarks The Display method must be invoked pr ior 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.
See Also Display method, ImageModified property, ManualDeskew method, Save method, SaveAs
method, SavePage method.
Aut oDeskew Example 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.)
2TKXCVG 5WD EOF%NGCPWRA%NKEM)
'2GTHQTO CWVQOCVKE UVTCKIJVGP QP VJG KOCIG
+OI'FKV1AutoDeskew
'4GOQXG URGEMNGU QP VJG KOCIG WUKPI VJG FGHCWNV VJTGUJQNF XCNWG HQT FQV
'UK\G
+OI'FKV1&GURGEMNG
'+H VJGTG KU C NQV QH GZVTCPGQWU URCEG CTQWPF KOCIG
'DQTFGTU ETQRRKPI OKIJV TGFWEG RTQEGUUKPI VKOG
+OI'FKV1#WVQ%TQR
'5JQY VJG 1%4 FKCNQI DQZ
+OI1%415JQY1%4
'PF 5WD
Aut oDeskew Example VC++
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.)
XQKF %+OI'FKV1&NI1P%NGCPWR)
]
// *GTG CTG UQOG HWPEVKQPU [QW OKIJV YCPV VQ RGTHQTO QP CP KOCIG RTKQT
// VQ 1%4
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
// 2GTHQTO CWVQOCVKE UVTCKIJVGP QP VJG KOCIG
+OI'FKV1AutoDeskew)
// 4GOQXG URGEMNGU QP VJG KOCIG WUKPI VJG FGHCWNV VJTGUJQNF XCNWG HQT
// FQV UK\G
+OI'FKV1&GURGEMNGGXV)
// +H VJGTG KU C NQV QH GZVTCPGQWU URCEG CTQWPF KOCIG
// DQTFGTU ETQRRKPI OKIJV TGFWEG RTQEGUUKPI VKOG
+OI'FKV1#WVQ%TQRGXV)
// 5JQY VJG 1%4 FKCNQI DQZ
+OI1ET15JQY1ET)
_
BurnInAnnot at ions M et hod
367
BurnInAnnot at ions Met hod
Descript ion Bur ns annotations onto an image, causing them to be per manently incorporated into the
image. Use this method with caution because once annotations are bur ned- in, they can no
longer be removed or modified.
Available Wit h
Applies To Image Edit control.
Usage object.BurnInAnnotations Option,MarkOption[,GroupName]
Argument s The Bur nInAnnotations method has the following arguments:
Not es Regarding t he Use of t he MarkOpt ion Paramet er
MarkOption Set to 0
For black- and- white page types, the BurnInAnnotations method with a MarkOption of 0
changes annotations to black.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing Descript ion
Option Integer
(enumerated)
0 All annotations marks, invisible and visi-
ble, 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 render ing Does not change the
colors of annotations for non- bilevel
images (for example, color and gray- scale
images)
GroupName Str ing Name The name of the group that contains the
annotations (if specified, the Option
parameter is ignored)
Chapt er 7
368
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. R efer to the following list:
For all other page types, the Bur nInAnnotations 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 (BGR 24 or R GB24). 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 SavePage 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
Bur nInAnnotations method with a Mark Option of 2; the Bur nInAnnotations method
bur ns the annotations onto the image in color.
Ret urns None.
Annot at ion Type MarkOpt ion Burn-In Format
Attach- a- Note Bur ned- in as a black or white rectangle based on the or iginal
background color, with text burned- in as black or white based
on the or iginal color of the font. Light colors, like yellow, are
bur ned- in as white; dark colors, like red, are bur ned- in as
black. The underlying image data is obscured.
Freehand Line,
Hollow R ectangle,
Straight Line, Text,
Text From File, and
Text Stamp Hyperlink
Bur ned- in as black or white based on the or iginal color of the
annotation. Light colors, like yellow, are bur ned- in as white;
dark colors, like red, are burned- in as black.
Linked annotations cease to function as hypertext jumps when
they are bur ned in.
Filled R ectangle Bur ned- in as black- and- white dithered rectangles. The under-
lying image data is obscured.
Highlighter Bur ned- in as black- and- white transparent dithered rectangles.
The underlying image data is visible.
Image Embedded and
Image R eference
Bur ned- in as a black- and- white representation of the or iginal
image.
OCR Zones You cannot bur n- in OCR Zone annotations.
BurnInAnnot at ions M et hod
369
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 bur n- in a Hyperlink annotation, it ceases to function as a
hypertext jump.
Invoking the Bur nInAnnotations method sets the ImageModified property to True.
See Also ConvertPageType method, Display method, ImageModified property, Save method, SaveAs
mehtod, SavePage method.
BurnInAnnot at ions Example VB
This example shows how to convert an image, burn in annotation marks, and save the
image under a new file name.
2TKXCVG 5WD EOF$WTP+PA%NKEM)
%QPUV #..A/#4-5 - 0
%QPUV 9+0&195A&'(#7.6 -
'+H [QW YKUJ VQ UCXG EQNQT CPPQVCVKQPU QP C DNCEM CPF YJKVG KOCIG [QW
'OWUV HKTUV EQPXGTV VJG KOCIG VQ C PQP DNCEM CPF YJKVG V[RG
+OI'FKV1%QPXGTV2CIG6[RG YK2CIG6[RG2CN8 6TWG
'5CXG CNN OCTMU KP VJGKT QTKIKPCN EQNQTU
+OI'FKV1BurnInAnnotat1ons #..A/#4-5 9+0&195A&'(#7.6
'%QNQT $WTP KP CNYC[U EQPXGTVU VQ 4)$4 6Q UCXG FKUM URCEG
'UCXG VJG KOCIG CU CP 8 DKV RCNGVVK\GF KOCIG
+OI'FKV15CXG#U %>KOIUCXG>CPPQVCVGVKH YK(KNG6[RG6+((
YK2CIG6[RG2CN8
'PF 5WD
BurnInAnnot at ions Example VC++
This example shows how to convert an image, burn in annotation marks, and save the
image under a new file name.
XQKF %+OI'FKV1&NI1P$WTPKP)
]
// %QPXGTVU CP KOCIG DWTPU KP CPPQVCVKQP OCTMU CPF UCXGU KV WPFGT C PGY
// HKNG PCOG
=FGHKPG #..A/#4-5 0
=FGHKPG 9+0&195A&'(#7.6
// +H [QW YKUJ VQ UCXG EQNQT CPPQVCVKQPU QP C DNCEM CPF YJKVG KOCIG [QW
// OWUV HKTUV EQPXGTV VJG KOCIG VQ C PQP DNCEM CPF YJKVG V[RG
8#4+#06 X4GRCKPV 8A86oX4GRCKPV) - 86A$11. 8A$11.oX4GRCKPV) - 647'
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1%QPXGTV2CIG6[RGbX4GRCKPV) // YK2CIG6[RG2CN8 6TWG
Not e: Hyperlink and OCR Zone annot at ions are available w it h Imaging f or Window s
Prof essional Edit ion V1.0, V1.1, and V2.0 only.
Chapt er 7
370
// 5CXG CNN OCTMU KP VJGKT QTKIKPCN EQNQTU
+OI'FKV1BurnInAnnotat1ons#..A/#4-5 9+0&195A&'(#7.6GXV)
// %QNQT $WTP KP CNYC[U EQPXGTVU VQ 4)$4 6Q UCXG FKUM URCEG UCXG VJG
// KOCIG CU CP 8 DKV RCNGVVK\GF KOCIG
8#4+#06 X(KNG6[RG 8A86oX(KNG6[RG) - 86A+ // UGV (KNG6[RG HQT UCXGCU
8#4+#06 X2CIG6[RG 8A86oX2CIG6[RG) - 86A+ // UGV VQ 2CIG6[RG HQT
// UCXGCU
8A+oX(KNG6[RG) - 1
8A+oX2CIG6[RG) - b
// YK(KNG6[RG6+(( YK2CIG6[RG2CN8
+OI'FKV15CXG#U%>>KOIUCXG>>CPPQVCVGVKHX(KNG6[RGX2CIG6[RG
GXVGXVGXV)
_
ClearDisplay Met hod
Descript ion Clears a displayed image in the control.
Available Wit h
Applies To Image Edit control.
Usage object.ClearDisplay
Argument s None.
Ret urns 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,
tr igger the Close event.
See Also Close event, Image property.
ClipboardCopy Met hod
Descript ion Copies the selected or specified portion of an image or annotation to the Clipboard.
Available Wit h
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
ClipboardCopy M et hod
371
Applies To Image Edit control.
Usage object.ClipboardCopy [Left,Top,Width,Height]
Argument s The ClipboardCopy method has the following parameters:
Ret urns 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.
See Also StatusCode property, ClipboardCut method, ClipboardPaste method, DrawSlectionR ect
method, SelectionR ectangle property, SelectionR ectDrawn event.
ClipboardCopy Example VB
This example copies the area bound by a user- drawn selection rectangle to a new page.
2TKXCVG 5WD EOF%NKR%QR[A%NKEM)
')NQDCN DNP+U4GEVCPING #U $QQNGCP
'6JG XCNWG QH DNP+U4GEVCPING KU UGV KP VJG 5GNGEVKQP4GEV&TCYP GXGPV
+H DNP+U4GEVCPING - (CNUG 6JGP
/UI$QZ 0Q TGEVCPING FTCYP XD'ZENCOCVKQP
'ZKV 5WD
'PF +H
'+H PQ RCTCOGVGTU URGEKHKGF YKNN EQR[ CTGC DQWPFGF D[ TGEVCPING
+OI'FKV1O1boardOoy
'%TGCVG 8 1/ : 11 DNCEM CPF YJKVG o00 FRK KOCIG
+OI'FKV1&KURNC[$NCPM+OCIG bb0 oo00 o00 o00 YK2CIG6[RG$9
Paramet er Dat a Type Set t ing
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
Chapt er 7
372
'4GUGV DNP+U4GEVCPING
DNP+U4GEVCPING - (CNUG
'2CUVG FCVC VQ PGY KOCIG ECNN %QORNGVG2CUVG VQ EQOOKV VJG RCUVG
'QRGTCVKQP
+OI'FKV1%NKRDQCTF2CUVG
+OI'FKV1%QORNGVG2CUVG
'PF 5WD
ClipboardCopy Example VC++
This example copies the area bound by a user- drawn selection rectangle to a new page.
XQKF %+OI'FKV1&NI1P%QR[2CUVG)
]
// %QR[ VJG CTGC DQWPFGF D[ WUGT FTCYP UGNGEVKQP TGEVCPING VQ PGY RCIG
// )NQDCN DNP+U4GEVCPING #U $QQNGCP 6JG XCNWG QH DNP+U4GEVCPING KU UGV
// KP VJG 5GNGEVKQP4GEV&TCYP GXGPV
KH!DNP+U4GEVCPING)
]
#HZ/GUUCIG$QZ 0Q TGEVCPING FTCYP /$A+%10':%.#/#6+10)
TGVWTP
_
// +H PQ RCTCOGVGTU URGEKHKGF YKNN EQR[ CTGC DQWPFGF D[ TGEVCPING
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1O1boardOoyGXVGXVGXVGXV)
// %TGCVG 8 1/ : 11 DNCEM CPF YJKVG o00 FRK KOCIG
8#4+#06 X4GU 8A86oX4GU) - 86A+4 8A+4oX4GU) - o00
8#4+#06 X2CIG6[RG 8A86oX2CIG6[RG) - 86A+ // UGV VQ 2CIG6[RG HQT
// UCXGCU
8A+oX2CIG6[RG) - 1 // YK2CIG6[RG$9
+OI'FKV1&KURNC[$NCPM+OCIGbb0 oo00 X4GU X4GU X2CIG6[RG)
DNP+U4GEVCPING - (#.5'
// 2CUVG FCVC VQ PGY KOCIG ECNN %QORNGVG2CUVG VQ EQOOKV VJG RCUVG
// QRGTCVKQP
+OI'FKV1%NKRDQCTF2CUVGGXVGXV)
+OI'FKV1%QORNGVG2CUVG)
_
ClipboardCut Met hod
Descript ion 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 Wit h
Applies To Image Edit control.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
ClipboardPast e M et hod
373
Usage object.ClipboardCut [Left,Top,Width,Height]
Argument s The ClipboardCut method has the following arguments:
Ret urns 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 er ror. Check the StatusCode property for the er ror.
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.
See Also ClipboardCopy method, StatusCode property, ClipboardPaste method, DrawSelectionR ect
method, ImageModified property, SelectionR ectangle property, SelectionR ectDrawn
event.
ClipboardPast e Met hod
Descript ion Pastes image or annotation data from the Clipboard.
Available Wit h
Applies To Image Edit control.
Usage object.ClipboardPaste [Left,Top]
Paramet er Dat a Type Set t ing
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.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
374
Argument s The ClipboardPaste method has the following arguments:
Ret urns None.
Remarks To deter mine 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.
See Also ClipboardCopy method, ClipboardCut method, CompletePaste method, ImageModified
property, IsClipboardDataAvailable method, PasteClip event, PasteCompleted event.
ClipboardPast e Example VB
This example copies the area bound by a user- drawn selection rectangle to a new page.
2TKXCVG 5WD EOF%NKR%QR[A%NKEM)
')NQDCN DNP+U4GEVCPING #U $QQNGCP 6JG XCNWG QH DNP+U4GEVCPING KU UGV KP
'VJG 5GNGEVKQP4GEV&TCYP GXGPV
+H DNP+U4GEVCPING - (CNUG 6JGP
/UI$QZ 0Q TGEVCPING FTCYP XD'ZENCOCVKQP
'ZKV 5WD
'PF +H
'+H PQ RCTCOGVGTU URGEKHKGF YKNN EQR[ CTGC DQWPFGF D[ TGEVCPING
+OI'FKV1%NKRDQCTF%QR[
'%TGCVG 8 1/ : 11 DNCEM CPF YJKVG o00 FRK KOCIG
+OI'FKV1&KURNC[$NCPM+OCIG bb0 oo00 o00 o00 YK2CIG6[RG$9
'4GUGV DNP+U4GEVCPING
DNP+U4GEVCPING - (CNUG
'2CUVG FCVC VQ PGY KOCIG ECNN %QORNGVG2CUVG VQ EQOOKV VJG RCUVG
'QRGTCVKQP
+OI'FKV1O1boardPaste
+OI'FKV1%QORNGVG2CUVG
'PF 5WD
ClipboardPast e Example VC++
This example copies the area bound by a user- drawn selection rectangle to a new page.
XQKF %+OI'FKV1&NI1P%QR[2CUVG)
]
// 6JKU YQWNF EQR[ VJG CTGC DQWPFGF D[ C WUGT FTCYP UGNGEVKQP TGEVCPING
// VQ C PGY RCIG
// )NQDCN DNP+U4GEVCPING #U $QQNGCP
// 6JG XCNWG QH DNP+U4GEVCPING KU UGV KP VJG 5GNGEVKQP4GEV&TCYP GXGPV
Paramet er Dat a Type Set t ing
Left Long The left point of the displayed image in pixels.
Top Long The top point of the displayed image in pixels.
Complet ePast e M et hod
375
KH!DNP+U4GEVCPING)
]
#HZ/GUUCIG$QZ 0Q TGEVCPING FTCYP /$A+%10':%.#/#6+10)
TGVWTP
_
// +H PQ RCTCOGVGTU URGEKHKGF YKNN EQR[ CTGC DQWPFGF D[ TGEVCPING
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1%NKRDQCTF%QR[GXVGXVGXVGXV)
// %TGCVG 8 1/ : 11 DNCEM CPF YJKVG o00 FRK KOCIG
8#4+#06 X4GU 8A86oX4GU) - 86A+4 8A+4oX4GU) - o00
8#4+#06 X2CIG6[RG 8A86oX2CIG6[RG) - 86A+ // UGV VQ 2CIG6[RG HQT
// UCXGCU
8A+oX2CIG6[RG) - 1 // YK2CIG6[RG$9
+OI'FKV1&KURNC[$NCPM+OCIGbb0 oo00 X4GU X4GU X2CIG6[RG)
// 4GUGV DNP+U4GEVCPING
DNP+U4GEVCPING - (#.5'
// 2CUVG FCVC VQ PGY KOCIG ECNN %QORNGVG2CUVG VQ EQOOKV VJG RCUVG
// QRGTCVKQP
+OI'FKV1O1boardPasteGXVGXV)
+OI'FKV1%QORNGVG2CUVG)
_
Complet ePast e Met hod
Descript ion Completes a Clipboard paste operation, making the pasted image or annotation data part of
the or iginal image.
Available Wit h
Applies To Image Edit control.
Usage object.CompletePaste
Ret urns 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 or iginal image. To make the pasted image or annotation data
part of the or iginal 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 for m, outside of the
pasted data.
See Also ClipboardPaste method, PasteClip event, PasteCompleted event.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
376
Complet ePast e Example VB
This example copies the area bound by a user- drawn selection rectangle to a new page.
2TKXCVG 5WD EOF%NKR%QR[A%NKEM)
')NQDCN DNP+U4GEVCPING #U $QQNGCP
'6JG XCNWG QH DNP+U4GEVCPING KU UGV KP VJG 5GNGEVKQP4GEV&TCYP GXGPV
+H DNP+U4GEVCPING - (CNUG 6JGP
/UI$QZ 0Q TGEVCPING FTCYP XD'ZENCOCVKQP
'ZKV 5WD
'PF +H
'+H PQ RCTCOGVGTU URGEKHKGF YKNN EQR[ CTGC DQWPFGF D[ TGEVCPING
+OI'FKV1%NKRDQCTF%QR[
'%TGCVG 8 1/ : 11 DNCEM CPF YJKVG o00 FRK KOCIG
+OI'FKV1&KURNC[$NCPM+OCIG bb0 oo00 o00 o00 YK2CIG6[RG$9
'4GUGV DNP+U4GEVCPING
DNP+U4GEVCPING - (CNUG
'2CUVG FCVC VQ PGY KOCIG ECNN %QORNGVG2CUVG VQ EQOOKV VJG RCUVG
'QRGTCVKQP
+OI'FKV1%NKRDQCTF2CUVG
+OI'FKV1OometePaste
'PF 5WD
Complet ePast e Example VC++
This example copies the area bound by a user- drawn selection rectangle to a new page.
XQKF %+OI'FKV1&NI1P%QR[2CUVG)
]
// 6JKU YQWNF EQR[ VJG CTGC DQWPFGF D[ C WUGT FTCYP UGNGEVKQP TGEVCPING
// VQ C PGY RCIG )NQDCN DNP+U4GEVCPING #U $QQNGCP
// 6JG XCNWG QH DNP+U4GEVCPING KU UGV KP VJG 5GNGEVKQP4GEV&TCYP GXGPV
KH!DNP+U4GEVCPING)
]
#HZ/GUUCIG$QZ 0Q TGEVCPING FTCYP /$A+%10':%.#/#6+10)
TGVWTP
_
// +H PQ RCTCOGVGTU URGEKHKGF YKNN EQR[ CTGC DQWPFGF D[ TGEVCPING
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1%NKRDQCTF%QR[GXVGXVGXVGXV)
// %TGCVG 8 1/ : 11 DNCEM CPF YJKVG o00 FRK KOCIG
8#4+#06 X4GU 8A86oX4GU) - 86A+4 8A+4oX4GU) - o00
8#4+#06 X2CIG6[RG 8A86oX2CIG6[RG) - 86A+ // UGV VQ 2CIG6[RG HQT
// UCXGCU
8A+oX2CIG6[RG) - 1 // YK2CIG6[RG$9
+OI'FKV1&KURNC[$NCPM+OCIGbb0 oo00 X4GU X4GU X2CIG6[RG)
// 4GUGV DNP+U4GEVCPING
DNP+U4GEVCPING - (#.5'
// 2CUVG FCVC VQ PGY KOCIG ECNN %QORNGVG2CUVG VQ EQOOKV VJG RCUVG
// QRGTCVKQP
+OI'FKV1%NKRDQCTF2CUVGGXVGXV)
+OI'FKV1OometePaste)
_
Convert PageType M et hod
377
Convert PageType Met hod
Descript ion Converts a displayed image to the page type specified and optionally repaints the image.
Available Wit h
Applies To Image Edit control.
Usage object.ConvertPageType PageType[,Repaint]
Argument s The ConvertPageType method has the following arguments:
Ret urns None.
Remarks An image must be displayed before the ConvertPageType method can be invoked. If the
R epaint 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.
See Also ImageModified property, PageType property, Save method, SaveAs method, SavePage
method.
Convert PageType Example VB
This example shows how to convert an image, burn in annotation marks, and save the
image under a new file name.
2TKXCVG 5WD EOF$WTP+PA%NKEM)
%QPUV #..A/#4-5 - 0
%QPUV 9+0&195A&'(#7.6 -
'+H [QW YKUJ VQ UCXG EQNQT CPPQVCVKQPU QP C DNCEM CPF YJKVG KOCIG [QW
'OWUV HKTUV EQPXGTV VJG KOCIG VQ C PQP DNCEM CPF YJKVG V[RG
+OI'FKV1OonvertPaqeTye YK2CIG6[RG2CN8 6TWG
'5CXG CNN OCTMU KP VJGKT QTKIKPCN EQNQTU
+OI'FKV1$WTP+P#PPQVCVKQPU #..A/#4-5 9+0&195A&'(#7.6
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
PageType Integer (enumerated) The desired PageType setting (see page 528).
R epaint Boolean True Image is repainted (default).
False Image is not repainted.
Chapt er 7
378
'%QNQT $WTP KP CNYC[U EQPXGTVU VQ 4)$4 6Q UCXG FKUM URCEG UCXG VJG
'KOCIG CU CP 8 DKV RCNGVVK\GF KOCIG
+OI'FKV15CXG#U %>KOIUCXG>CPPQVCVGVKH YK(KNG6[RG6+((
YK2CIG6[RG2CN8
'PF 5WD
Convert PageType Example VC++
This example shows how to convert an image, burn in annotation marks, and save the
image under a new file name.
XQKF %+OI'FKV1&NI1P$WTPKP)
]
// %QPXGTVU CP KOCIG DWTPU KP CPPQVCVKQP OCTMU CPF UCXGU KV WPFGT C PGY
// HKNG PCOG
=FGHKPG #..A/#4-5 0
=FGHKPG 9+0&195A&'(#7.6
// 6Q UCXG EQNQT CPPQVCVKQPU QP C DNCEM CPF YJKVG KOCIG [QW OWUV HKTUV
// EQPXGTV VJG KOCIG VQ C PQP DNCEM CPF YJKVG V[RG
8#4+#06 X4GRCKPV 8A86oX4GRCKPV) - 86A$11. 8A$11.oX4GRCKPV) - 647'
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1OonvertPaqeTyebX4GRCKPV) // YK2CIG6[RG2CN8 6TWG
// 5CXG CNN OCTMU KP VJGKT QTKIKPCN EQNQTU
+OI'FKV1$WTP+P#PPQVCVKQPU#..A/#4-5 9+0&195A&'(#7.6GXV)
// %QNQT $WTP KP CNYC[U EQPXGTVU VQ 4)$4 6Q UCXG FKUM URCEG UCXG VJG
// KOCIG CU CP 8 DKV RCNGVVK\GF KOCIG
8#4+#06 X(KNG6[RG 8A86oX(KNG6[RG) - 86A+ // UGV (KNG6[RG HQT UCXGCU
8#4+#06 X2CIG6[RG 8A86oX2CIG6[RG) - 86A+ // UGV VQ 2CIG6[RG HQT
// UCXGCU
8A+oX(KNG6[RG) - 1
8A+oX2CIG6[RG) - b
// YK(KNG6[RG6+(( YK2CIG6[RG2CN8
+OI'FKV15CXG#U%>>KOIUCXG>>CPPQVCVGVKHX(KNG6[RG
X2CIG6[RGGXVGXVGXV)
_
Crop Met hod
Descript ion Crops the displayed image to the rectangle specified. The cur rent selection rectangle is used
if no rectangle is specified.
Available Wit h
Applies To Image Edit control.
Usage object.Crop [Left,Top,Width,Height]
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Delet eAnnot at ionGroup M et hod
379
Argument s The Crop method has the following arguments:
Ret urns None.
Remarks The Display method must be invoked pr ior 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.
See Also StatusCode property, AutoCrop method, Display method, DrawSelectionR ect
method, ImageModified property, Save method, SaveAs method, SavePage method,
SelectionR ectangle property, SelectionR ectDrawn event.
Delet eAnnot at ionGroup Met hod
Descript ion Deletes an annotation group and its annotation marks, and then redisplays the image.
Available Wit h
Applies To Image Edit control.
Usage object.DeleteAnnotationGroup GroupName
Argument s The DeleteAnnotationGroup method has the following argument:
Paramet er Dat a Type Set t ing
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.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
GroupName Str ing The name of the annotation group to delete.
Chapt er 7
380
Ret urns None.
Remarks The Display method must be invoked pr ior 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.
See Also AddAnnotationGroup method, DeleteSelectedAnnotations method, Display method,
ImageModified property, Save method, SaveAs method, SavePage method.
Delet eAnnot at ionGroup Example 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.
2TKXCVG 5WD EOF&GNGVG)TQWRA%NKEM)
&KO UVT%WT)TQWR #U 5VTKPI
')GV VJG PCOG QH VJG ITQWR VJG WUGT ENKEMGF QP KP VJG NKUVDQZ
UVT%WT)TQWR - #PPQ)TQWRU.KUV#PPQ)TQWRU.KUV+PFGZ)
(QTO1+OI'FKV1DeeteAnnotat1onOrou UVT%WT)TQWR)
'PF 5WD
Delet eAnnot at ionGroup Example 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.
XQKF %(TO)TQWR1P&GNGVG)TQWR)
]
// 6JKU YQWNF CNNQY C WUGT VQ UGNGEV C )TQWR HTQO C NKUV CPF FGNGVG KV
// 5GG GZCORNG HQT )GV#PPQVCVKQP)TQWR OGVJQF HQT JQY VQ NKUV
// CPPQVCVKQP ITQWRU
%5VTKPI U\%WT)TQWR
// )GV VJG PCOG QH VJG ITQWR VJG WUGT ENKEMGF QP KP VJG NKUVDQZ
OA)TQWR.KUV)GV6GZVOA)TQWR.KUV)GV%WT5GN)U\%WT)TQWR)
// 4GOQXG VJG ITQWR PCOG
OA)TQWR.KUV&GNGVG5VTKPIOA)TQWR.KUV)GV%WT5GN))
KHR2CTGPV&NI)
]
R2CTGPV&NI+OI'FKV1DeeteAnnotat1onOrou U\%WT)TQWR)
_
_
Delet eImageDat a M et hod
381
Delet eImageDat a Met hod
Descript ion Deletes a selected or specified portion of an image.
Available Wit h
Applies To Image Edit control.
Usage object.DeleteImageData [Left,Top,Width,Height]
Argument s The DeleteImageData method has the following arguments:
Ret urns 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.
See Also StatusCode property, DeleteSelectedAnnotations method, DrawSelectionR ect method,
ImageModified property, Save method, SaveAs method, SavePage method,
SelectionR ectangle property, SelectionR ectDrawn event.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
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.
Chapt er 7
382
Delet eSelect edAnnot at ions Met hod
Descript ion Deletes selected annotations.
Available Wit h
Applies To Image Edit control.
Usage object.DeleteSelectedAnnotations
Argument s None.
Ret urns 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 er ror.
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.
See Also StatusCode property, DeleteAnnotationGroup method, ImageModified property, Save
method, SaveAs method, SavePage method, SelectAnnotationGroup method.
Despeckle Met hod
Descript ion Despeckles (removes black pixels from) the displayed image.
Available Wit h
Applies To Image Edit control.
Usage object.Despeckle [Pattern]
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Despeckle M et hod
383
Argument s The Despeckle method has the following argument:
Ret urns 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 pr ior 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.
See Also Display method, ImageModified property, Save method, SaveAs method, SavePage
method.
Despeckle Example 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.)
2TKXCVG 5WD EOF%NGCPWRA%NKEM)
'2GTHQTO CWVQOCVKE UVTCKIJVGP QP VJG KOCIG
+OI'FKV1#WVQ&GUMGY
'4GOQXG URGEMNGU QP VJG KOCIG WUKPI VJG FGHCWNV VJTGUJQNF XCNWG HQT
'FQV UK\G
+OI'FKV1Desecke
'+H VJGTG KU C NQV QH GZVTCPGQWU URCEG CTQWPF KOCIG
'DQTFGTU ETQRRKPI OKIJV TGFWEG RTQEGUUKPI VKOG
+OI'FKV1#WVQ%TQR
'5JQY VJG 1%4 FKCNQI DQZ
+OI1%415JQY1%4
'PF 5WD
Paramet er Dat a Type Set t ing Descript ion
Pattern Long
(enumerated)
0 (default) R emoves dots using a single- pixel patter n.
1 R emoves dots smaller than average.
2 R emoves dots of average size, those typically
encountered and safely removed.
3 R emoves dots slightly larger than average.
4 R emoves most dots.
5 R emove very large dots.
Chapt er 7
384
Despeckle Example 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.)
XQKF %+OI'FKV1&NI1P%NGCPWR)
]
// *GTG CTG UQOG HWPEVKQPU [QW OKIJV YCPV VQ RGTHQTO QP CP KOCIG
// RTKQT VQ 1%4
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
// 2GTHQTO CWVQOCVKE UVTCKIJVGP QP VJG KOCIG
+OI'FKV1#WVQ&GUMGY)
// 4GOQXG URGEMNGU QP VJG KOCIG WUKPI VJG FGHCWNV VJTGUJQNF XCNWG
// HQT FQV UK\G
+OI'FKV1DeseckeGXV)
// +H VJGTG KU C NQV QH GZVTCPGQWU URCEG CTQWPF KOCIG
// DQTFGTU ETQRRKPI OKIJV TGFWEG RTQEGUUKPI VKOG
+OI'FKV1#WVQ%TQRGXV)
// 5JQY VJG 1%4 FKCNQI DQZ
+OI1ET15JQY1ET)
_
Display Met hod
Descript ion Displays the image specified in the Image property.
Available Wit h
Applies To Image Edit control.
Usage object.Display
Argument s None.
Ret urns None.
Remarks The Display method tr iggers 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- or iented properties (for example, Zoom, ScrollPosition, etc.). If an image
is already displayed, this method tr iggers a Close event.
See Also Close event, Image property, ImageDisplayed property, Load event, Page property.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Display M et hod
385
Display Example VB
This example displays a user- selected image file in an Image Edit control.
2TKXCVG 5WD EOF&KURNC[+OCIGA%NKEM)
'7UG VJG +OI#FOKP 1RGP FKCNQI DQZ VQ FKURNC[ C HKNG KP VJG +OCIG
''FKV CPF 6JWODPCKN EQPVTQNU
+OI#FOKP15JQY(KNG&KCNQI 1RGP&NI
'5GG VJG UCORNG EQFG HQT JCPFNKPI VJG %CPEGN MG[ KP VJG
'5JQY(KNG&KCNQI OGVJQF
'5GV VJG KOCIG RTQRGTVKGU KP VJG +OCIG 'FKV CPF 6JWODPCKN EQPVTQNU
'VQ VJG PCOG QH VJG HKNG UGNGEVGF KP VJG FKCNQI DQZ
+OI'FKV1+OCIG - +OI#FOKP1+OCIG
+OI6JWODPCKN1+OCIG - +OI#FOKP1+OCIG
'5GV VJG RCIG VQ 1 KP ECUG C RCIG QVJGT VJCP 1 YCU UJQYP HQT CP KOCIG
'FKURNC[GF RTKQT VQ VJKU QPG
+OI'FKV12CIG - 1
+OI'FKV1D1say
'5GV VJG HQEWU VQ VJG KOCIG YKPFQY UQ VJCV MG[UVTQMGU UWEJ
'CU UETQNN MG[U CTG UGPV VQ VJG KOCIG YKPFQY
+OI'FKV15GV(QEWU
'PF 5WD
Display Example VC++
This example displays a user- selected image file in an Image Edit control.
XQKF %+OI'FKV1&NI1P&KURNC[)
]
// 7UG VJG +OI#FOKP 1RGP FKCNQI DQZ VQ FKURNC[ C HKNG KP VJG
// +OCIG 'FKV CPF 6JWODPCKN EQPVTQNU
8#4+#06 XJ9PF 8A86oXJ9PF) - 86A+4
8A+4oXJ9PF) - NQPI)OAJ9PF
+OI#FOKP15JQY(KNG&KCNQI0XJ9PF) // 1RGP&NI
// 5GG VJG UCORNG EQFG HQT JCPFNKPI VJG %CPEGN MG[ KP VJG
// 5JQY(KNG&KCNQI OGVJQF
// 5GV VJG KOCIG RTQRGTVKGU KP VJG +OCIG 'FKV CPF 6JWODPCKN EQPVTQNU
// VQ VJG PCOG QH VJG HKNG UGNGEVGF KP VJG FKCNQI DQZ
+OI'FKV15GV+OCIG+OI#FOKP1)GV+OCIG))
+OI6JWODPCKN15GV+OCIG+OI#FOKP1)GV+OCIG))
// 5GV VJG RCIG VQ 1 KP ECUG C RCIG QVJGT VJCP 1 YCU UJQYP
// HQT CP KOCIG FKURNC[GF RTKQT VQ VJKU QPG
+OI'FKV15GV2CIG1)
+OI'FKV1D1say)
// 5GV VJG HQEWU VQ VJG KOCIG YKPFQY UQ VJCV MG[UVTQMGU UWEJ
// CU UETQNN MG[U CTG UGPV VQ VJG KOCIG YKPFQY
+OI'FKV15GV(QEWU)
_
Chapt er 7
386
DisplayBlankImage Met hod
Descript ion Displays a blank image according to the dimensions specified.
Available Wit h
Applies To Image Edit control.
Usage object.DisplayBlankImage ImageWidth,ImageHeight
[,ResolutionX,ResolutionY,PageType]
Argument s The DisplayBlankImage method has the following arguments:
Ret urns None.
Remarks When the DisplayBlankImage method is invoked with an image already displayed, it
tr iggers 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 R esolutionX parameter or the R esolutionY parameter is not entered, a value of 200
is used as a default. If the PageType parameter is not entered, the Black- and- White page
type is used as a default.
See Also Close event.
DisplayBlankImage Example VB
This example creates a new blank image and then places a company logo at the top of the
new page.
2TKXCVG 5WD EOF&TCY.QIQA%NKEM)
'%TGCVG C PGY 8 1/ : 11 DNCEM CPF YJKVG KOCIG CV 100 FRK
+OI'FKV1D1sayBankImaqe 8b0 1100 100 100 YK2CIG6[RG$9
+OI'FKV1#PPQVCVKQP+OCIG - &>KOCIG>EQTRNQIQDOR
'.QIQ YQWNF QDUEWTG CP[ VGZV WPFGT KV KH 1RCSWG
+OI'FKV1#PPQVCVKQP(KNN5V[NG - YK1RCSWG '1
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
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).
R esolutionX Long The hor izontal resolution of the image in dots per inch.
R esolutionY Long The vertical resolution of the image in dots per inch.
PageType Integer
(enumerated)
The desired PageType setting (see page 528).
Draw M et hod
387
'+H KOCIG KU GODGFFGF TCVJGT VJCP TGHGTGPEGF VJG UQWTEG
'KOCIG PGGF PQV DG RTGUGPV YJGP VJG KOCIG KU FKURNC[GF
+OI'FKV1#PPQVCVKQP6[RG - YK+OCIG'ODGFFGF 'b
'+OCIG OCTM QPN[ TGSWKTGU NGHV CPF VQR RCTCOGVGTU VQ FTCY
'5VCTV PQV SWKVG JCNHYC[ CETQUU RCIG b RKZGNU HTQO VQR 1/4)
+OI'FKV1&TCY ob0 b
'PF 5WD
DisplayBlankImage Example VC++
This example creates a new blank image and then places a company logo at the top of the
new page.
XQKF %+OI'FKV1&NI1P+OCIG5VCOR)
]
// %TGCVG C PGY 8 1/ : 11 DNCEM CPF YJKVG KOCIG CV 100 FRK
8#4+#06 X2CIG6[RG 8A86oX2CIG6[RG) - 86A+ // UGV VQ 2CIG6[RG HQT
// UCXGCU
8A+oX2CIG6[RG) - 1 // YK2CIG6[RG$9
8#4+#06 X4GU 8A86oX4GU) - 86A+4 8A+4oX4GU) - 100
+OI'FKV1D1sayBankImaqe 8b0 1100 X4GU X4GU X2CIG6[RG)
+OI'FKV15GV#PPQVCVKQP+OCIG&>>KOCIG>>EQTRNQIQDOR)
// .QIQ YQWNF QDUEWTG CP[ VGZV WPFGT KV KH 1RCSWG
+OI'FKV15GV#PPQVCVKQP(KNN5V[NG1) // YK1RCSWG // 1
// +H KOCIG KU GODGFFGF TCVJGT VJCP TGHGTGPEGF VJG UQWTEG
// KOCIG PGGF PQV DG RTGUGPV YJGP VJG KOCIG KU FKURNC[GF
+OI'FKV15GV#PPQVCVKQP6[RGb) // YK+OCIG'ODGFFGF // b
// +OCIG OCTM QPN[ TGSWKTGU NGHV CPF VQR RCTCOGVGTU VQ FTCY
// 5VCTV PQV SWKVG JCNHYC[ CETQUU RCIG b RKZGNU HTQO VQR 1/4)
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1&TCYob0 b GXV GXV)
_
Draw Met hod
Descript ion Draws the annotation.
Available Wit h
Applies To Image Edit and Image Annotation controls.
Usage object.Draw Left,Top[,Width,Height]
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
388
Argument s The Draw method has the following arguments:
Ret urns 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:
s
Attach- a- Note
s
Filled R ectangle
s
Freehand Line
s
Hollow R ectangle
s
Select Annotations (optional; see the following Note)
s
Straight Line
s
Text
Invoking the Draw method sets the ImageModifed property of the Image Edit control to
True.
See Also AnnotationType property, HyperlinkGoToDoc event, HyperlinkGoToPage event,
ImageModified property, MarkEnd event, SelectTool method.
Paramet er Dat a Type Set t ing
Left Long The starting hor izontal coordinate of the annotation, in
image pixels (see page 544).
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.
Not e: Widt h and height paramet er ent ry is opt ional w hen using t he Select Annot at ions
annot at ion t ype. If only t he lef t and t op paramet ers are specif ied, select ion can be
made by point . If all of t he paramet ers are specif ied, select ion can be made using
t he Select Annot at ions rect angle.
Draw Select ionRect M et hod
389
Draw Example 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.
2TKXCVG 5WD EOF5GNGEV6QQNA%NKEM)
'+H VJG CPPQVCVKQP VQQN RCNGVVG KU WVKNK\GF YKVJKP CP CRRNKECVKQP
'5GNGEV6QQN UJQWNF DG WUGF TCVJGT VJCP UGVVKPI VJG #PPQVCVKQP6[RG
'RTQRGTV[ HQT FTCYKPI OCTMU RTQITCOCVKECNN[
+OI'FKV15GNGEV6QQN 9 '6GZV HTQO HKNG
+OI'FKV1#PPQVCVKQP6GZV(KNG - %>VGZV>FKUENCKOVZV
+OI'FKV1Draw 0 0
'PF 5WD
Draw Example 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.
XQKF %+OI'FKV1&NI1P5GNGEV6QQN)
]
// 7UGU VJG 5GNGEV6QQN OGVJQF VQ UGNGEV VJG 6GZV HTQO HKNG CPPQVCVKQP
// V[RG 1XGTNC[U VGZV HTQO C VGZV HKNG QPVQ KOCIG
// +H VJG CPPQVCVKQP VQQN RCNGVVG KU WVKNK\GF YKVJKP CP CRRNKECVKQP
// 5GNGEV6QQN UJQWNF DG WUGF TCVJGT VJCP UGVVKPI VJG #PPQVCVKQP6[RG
// RTQRGTV[ HQT FTCYKPI OCTMU RTQITCOCVKECNN[
+OI'FKV15GNGEV6QQN9) // 6GZV HTQO HKNG
+OI'FKV15GV#PPQVCVKQP6GZV(KNG%>>VGZV>>FKUENCKOVZV)
8#4+#06 GXV 8A86oGXV) - 86A'4414// UGV VQ FGHCWNV
+OI'FKV1Draw10 10 GXV GXV)
_
DrawSelect ionRect Met hod
Descript ion Draws a selection rectangle on an image.
Available Wit h
Applies To Image Edit control.
Usage object.DrawSelectionRect Left,Top,Width,Height
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
390
Argument s The DrawSelectionR ect method has the following arguments:
Ret urns None.
Remarks None.
See Also ClipboardCopy method, ClipboardCut method, DeleteImageData method,
SelectionR ectangle property, SelectionR ectDrawn event, ZoomToSelection event.
DrawSelect ionRect Example VB
This example draws a selection rectangle on an image and zooms in on the area bound by
the rectangle.
2TKXCVG 5WD EOF<QQO5GNGEVA%NKEM)
''PCDNG TGEVCPING FTCYKPI
+OI'FKV15GNGEVKQP4GEVCPING - 6TWG
'&TCY TGEVCPING
+OI'FKV1DrawSeect1onRect 1b0 00 400 400
+OI'FKV1<QQO6Q5GNGEVKQP
'PF 5WD
DrawSelect ionRect Example VC++
This example draws a selection rectangle on an image and zooms in on the area bound by
the rectangle.
XQKF %+OI'FKV1&NI1P<QQOVQ)
]
// 6JKU YQWNF FTCY C TGEVCPING QP CP KOCIG CPF YQWNF \QQO KP QP VJG CTGC
// DQWPF D[ VJG TGEVCPING
// 'PCDNG TGEVCPING FTCYKPI
+OI'FKV15GV5GNGEVKQP4GEVCPING647')
// &TCY TGEVCPING
+OI'FKV1DrawSeect1onRect1b0 00 400 400)
+OI'FKV1<QQO6Q5GNGEVKQP)
_
Paramet er Dat a Type Set t ing
Left Long The beginning hor izontal position of the rectangle rela-
tive 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.
Edit Select edAnnot at i onText M et hod
391
Edit Select edAnnot at ionText Met hod
Descript ion Displays a dialog box (shown here) containing the selected text annotation. The dialog box
enables end users to modify the text.
Available Wit h
Applies To Image Edit control.
Usage object.EditSelectedAnnotationText Left,Top
Argument s The EditSelectedAnnotationText method has the following arguments:
Ret urns 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.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
Left Long The beginning hor izontal position of the mark to be edited.
Top Long The beginning vertical position of the mark to be edited.
Not e: Hyperlink annot at ions are available w it h Imaging f or Window s Prof essional Edit ion
only.
Chapt er 7
392
See Also AnnotationType property, EditingTextAnnotation event, ExecuteTextEditCommand
method, ImageModified property, MarkSelect event, Save method, SaveAs method,
SavePage method, SelectAnnotationGroup method.
Edit Select edAnnot at ionText Example 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.
2TKXCVG 5WD +OI'FKV1A/CTM5GNGEV$[8CN $WVVQP #U +PVGIGT $[8CN 5JKHV #U
+PVGIGT $[8CN .GHV #U .QPI $[8CN 6QR #U .QPI $[8CN 9KFVJ #U .QPI
$[8CN *GKIJV #U .QPI $[8CN /CTM6[RG #U +PVGIGT $[8CN )TQWR0COG #U
5VTKPI)
'&KOGPUKQP /CTM.GHV CPF /CTM6QR CU INQDCN XCTKCDNGU UQ VJGUG
'XCNWGU ECP DG RCUUGF DCEM VQ VJG 'FKV5GNGEVGF#PPQVCVKQP6GZV OGVJQF
/CTM.GHV - .GHV
/CTM6QR - 6QR
'PF 5WD
2TKXCVG 5WD EOF'FKV6GZVA%NKEM)
'6JKU YQWNF CNNQY VJG WUGT VQ GFKV VJG VGZV QH CP GZKUVKPI UGNGEVGF
'CPPQVCVKQP OCTM
1P 'TTQT )Q6Q *CPFNG+V
'%QQTFKPCVGU QH VJG OCTM CTG QDVCKPGF HTQO VJG /CTM5GNGEV GXGPV
'UGG EQFG CDQXG)
+OI'FKV1Ed1tSeectedAnnotat1onText /CTM.GHV /CTM6QR
'ZKV 5WD
*CPFNG+V
'*CPFNG GTTQT KH PQ OCTM KU UGNGEVGF QT VJG YTQPI V[RG QH OCTM KU
'UGNGEVGF
/UI$QZ 'TT&GUETKRVKQP
'PF 5WD
Edit Select edAnnot at ionText Example 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.
XQKF %+OI'FKV&NI1P#PPQVGZV)
]
// 6JKU YQWNF CNNQY VJG WUGT VQ GFKV VJG VGZV QH CP GZKUVKPI UGNGEVGF
// CPPQVCVKQP OCTM
64;
]
// %QQTFKPCVGU QH VJG OCTM CTG QDVCKPGF HTQO VJG /CTM5GNGEV GXGPV
// UGG EQFG DGNQY)
+OI'FKV1Ed1tSeectedAnnotat1onTextOA/CTM.GHV OA/CTM6QR)
_
%#6%* %1NG&KURCVEJ'ZEGRVKQP G)
]
// *CPFNG GTTQT KH PQ OCTM KU UGNGEVGF QT VJG YTQPI V[RG QH OCTM KU
// UGNGEVGF
#HZ/GUUCIG$QZGOAUVT&GUETKRVKQP)
Execut eText Edit Command M et hod
393
//'TT&GUETKRVKQP
_
'0&A%#6%*
_
XQKF %+OI'FKV&NI1P/CTM5GNGEVUJQTV $WVVQP UJQTV 5JKHV NQPI .GHV
NQPI 6QR NQPI 9KFVJ NQPI *GKIJV UJQTV /CTM6[RG .2%6564 )TQWR0COG)
]
OA/CTM.GHV - .GHV
OA/CTM6QR - 6QR
_
Execut eText Edit Command Met hod
Descript ion 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 Wit h
Applies To Image Edit control.
Usage object.ExecuteTextEditCommand EditCommand
Imaging for Windows Professional Edition V2.0
Imaging for Windows Professional Edition V1.0 and V1.1
Imaging for Windows 98
Imaging for Windows 95
Imaging for Windows NT 4.0
Chapt er 7
394
Argument s The ExecuteTextEditCommand method has the following argument:
Paramet er
Dat a
Type
Const ant Value
Command
Descript ion
EditCommand Integer wiCutEditText 0 Cut Cuts any selected
text to the clipboard.
wiCopyEditText 1 Copy Copies any selected
text to the clipboard.
wiPasteEditText 2 Paste Pastes text from the
clipboard.
wiUndoEditText 3 Undo/ R edo Undoes or
R edoes the last textual oper-
ation.
wiSelectAllEditText 4 Select All Selects All text.
wiDeleteEditText 5 Delete/ Clear Deletes or
Clears any selected text.
wiCanUndoEditText 6 Can Undo Checks to see
if there is anything to be
undone.
wiIsEditTextSelected 7 Is Text Selected Checks
to see if there is any text
selected.
wiFinishEditText 8 Finish Saves any text
changes, closes the text
editing session.
wiCancelEditText 9 Cancel Discards any text
changes and closes the text
editing session.
wiIsModifiedEditText 10 Is Modified Checks to
see if anything was changed.
Execut eText Edit Command M et hod
395
Ret urns Long.
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:
s
An end user double- clicks on a selected Text, Attach- a- Note, or Hyperlink annotation
s
The EditSelectedAnnotationText method is invoked with a Text, Attach- a- Note, or
Hyperlink annotation selected.
s
A new Text, Attach- a- Note, or Hyperlink annotation is created.
See Also EditingTextAnnotation event, EditSelectedAnnotationText method,
SelectAnnotationGroup method.
Command Value Descript ion
Cut 0
Copy 0
Paste 0
Undo/ R edo 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
Not e: Hyperlink annot at ions are available w it h Imaging f or Window s Prof essional Edit ion
only.
Chapt er 7
396
Fit To Met hod
Descript ion Scales the image relative to the image window.
Available Wit h
Applies To Image Edit control.
Usage object.FitTo Option[,Repaint]
Argument s The FitTo method has the following arguments:
Ret urns None.
Remarks The Inch to inch setting calculates the size of the image dependent upon the dots per inch
reported by the display dr iver.
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 R epaint parameter is set to True, the image
is redisplayed using the Option setting specified.
See Also Zoom property (ImageEdit), ZoomToSelection method.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er
Dat a
Type
Const ant Set t ing Descript ion
Option Integer BEST_FIT 0 Best fit Fits the image to
the size of the window.
FIT_TO_WIDTH 1 Fit to width Fits the
image to the width of the
window.
FIT_TO_HEIGHT 2 Fit to height Fits the
image to the height of the
window.
INCH_TO_INCH 3 Inch to inch Maintains
the relative size of the or igi-
nal image regardless of the
resolution of the image.
R epaint Boolean True
False
Image is repainted (default)
Image is not repainted.
Fit To M et hod
397
Fit To Example 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.
2TKXCVG 5WD EOF9KFVJ*GKIJVA%NKEM)
+OI'FKV1+OCIG - &>KOCIG>QETVKH
+OI'FKV1F1tTo $'56A(+6
+OI'FKV1&KURNC[
.QCF HTO+PHQ
'&KURNC[ VJG FKOGPUKQPU QH VJG KOCIG RCIG
HTO+PHQNDN+OI*GKIJV%CRVKQP - +OI'FKV1+OCIG*GKIJV
HTO+PHQNDN+OI9KFVJ%CRVKQP - +OI'FKV1+OCIG9KFVJ
'&KURNC[ VJG : CPF ; TGUQNWVKQP QH VJG KOCIG RCIG
HTO+PHQNDN+OI4GU:%CRVKQP - +OI'FKV1+OCIG4GUQNWVKQP:
HTO+PHQNDN+OI4GU;%CRVKQP - +OI'FKV1+OCIG4GUQNWVKQP;
'&KURNC[ +OCIG 5ECNG *GKIJV
HTO+PHQNDN+OI5ECNG*GKIJV%CRVKQP - +OI'FKV1+OCIG5ECNG*GKIJV
HTO+PHQNDN+OI5ECNG9KFVJ%CRVKQP - +OI'FKV1+OCIG5ECNG9KFVJ
HTO+PHQ5JQY 1
'PF 5WD
Fit To Example 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.
XQKF %+OI'FKV1&NI1P9KFVJ*GKIJV)
]
// &KURNC[U CP KOCIG VJCV KU HKV VQ YKPFQY CPF VJGP FKURNC[U JGKIJV
// YKFVJ TGUQNWVKQP UECNGF JGKIJV CPF UECNGF YKFVJ 6JKU KNNWUVTCVGU
// VJG FKHHGTGPEG DGVYGGP +OCIG*GKIJV/9KFVJ CPF +OCIG5ECNG*GKIJV/9KFVJ
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1F1tTo0GXV) //$'56A(+6
+OI'FKV1&KURNC[)
%(TO+PHQ HTO+PHQ
// &KURNC[ VJG FKOGPUKQPU QH VJG KOCIG RCIG
%5VTKPI U\9KPFQY6GZV
NQPI N+PHQ
N+PHQ - +OI'FKV1)GV+OCIG*GKIJV)
HTO+PHQNDN+OI*GKIJV(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG9KFVJ)
HTO+PHQNDN+OI9KFVJ(QTOCV'KN+PHQ)
// &KURNC[ VJG : CPF ; TGUQNWVKQP QH VJG KOCIG RCIG
N+PHQ - +OI'FKV1)GV+OCIG4GUQNWVKQP:)
HTO+PHQNDN+OI4GU:(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG4GUQNWVKQP;)
HTO+PHQNDN+OI4GU;(QTOCV'KN+PHQ)
// &KURNC[ +OCIG 5ECNG *GKIJV
N+PHQ - +OI'FKV1)GV+OCIG5ECNG*GKIJV)
Chapt er 7
398
HTO+PHQNDN+OI5ECNG*GKIJV(QTOCV'KN+PHQ)
N+PHQ - +OI'FKV1)GV+OCIG5ECNG9KFVJ)
HTO+PHQNDN+OI5ECNG9KFVJ(QTOCV'KN+PHQ)
HTO+PHQ&Q/QFCN)
_
Flip Met hod
Descript ion R otates a displayed image by 180 degrees.
Available Wit h
Applies To Image Edit control.
Usage object.Flip
Argument s None.
Ret urns None.
Remarks The Display method must be invoked pr ior 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.
See Also Display method, ImageModified property, R otate method, R otateAll method, R otateLeft
method, R otateR ight method, Save method, SaveAs method, SavePage method.
Flip Example VB
This example shows several ways to or ient an image, and then redisplay it.
2TKXCVG 5WD EOF4QVCVGA%NKEM)
+OI'FKV14QVCVG 6TWG 'TQVCVG CNN RCIGU
+OI'FKV14QVCVG (CNUG 'TQVCVG EWTTGPV RCIG
'#WVQTGHTGUJ OWUV DG UGV VQ VTWG QT OWUV ECNN 4GHTGUJ CHVGT VJGUG
'OGVJQFU
+OI'FKV1#WVQ4GHTGUJ - 6TWG
+OI'FKV14QVCVG.GHV 'FGHCWNVU VQ 90 FGITGGU
+OI'FKV14QVCVG4KIJV 4b 'QRVKQPCNN[ ECP URGEKH[ FGITGGU
+OI'FKV1F1 '180 FGITGGU
';QW OWUV UCXG VJG KOCIG VQ OCKPVCKP QTKGPVCVKQP
'PF 5WD
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Get Annot at ionGroup M et hod
399
Flip Example VC++
This example shows several ways to or ient an image, and then redisplay it.
XQKF %+OI'FKV1&NI1P4QVCVG)
]
// #P GZCORNG QH UQOG QH VJG FKHHGTGPV YC[U CP KOCIG EQWNF DG QTKGPVGF
// 6JKU OGVJQF FKURNC[U C FKCNQI DQZ YJKEJ CNNQYU WUGT VQ URGEKH[
// TQVCVKQP D[ FGITGGU 4GRCKPVU VJG UETGGP CWVQOCVKECNN[ 4QVCVG CNN
// YTKVGU VJG HKNG VQ FKUM
+OI'FKV14QVCVG647') // TQVCVG CNN RCIGU
+OI'FKV14QVCVG(#.5') // TQVCVG EWTTGPV RCIG
// #WVQTGHTGUJ OWUV DG UGV VQ VTWG QT OWUV ECNN 4GHTGUJ CHVGT VJGUG
// OGVJQFU
+OI'FKV15GV#WVQ4GHTGUJ647')
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV14QVCVG.GHVGXV) // FGHCWNVU VQ 90 FGITGGU
8#4+#06 X4QVCVG#OV 8A86oX4QVCVG#OV) - 86A+4 8A+4oX4QVCVG#OV) - 4b
+OI'FKV14QVCVG4KIJVX4QVCVG#OV) // QRVKQPCNN[ ECP URGEKH[ FGITGGU
+OI'FKV1F1) // 180 FGITGGU
// ;QW OWUV UCXG VJG KOCIG VQ OCKPVCKP QTKGPVCVKQP
_
Get Annot at ionGroup Met hod
Descript ion R eturns the name of the annotation group based on the index specified.
Available Wit h
Applies To Image Edit control.
Usage object.GetAnnotationGroup(Index)
Argument s The GetAnnotationGroup method has the following argument:
Ret urns Str ing.
Remarks The Display method must be invoked pr ior 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.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
Index Integer The index value of the annotation group.
Chapt er 7
400
See Also AnnotationGroupCount property, Display method, GetCurrentAnnotationGroup method,
HideAnnotationGroup method, SelectAnnotationGroup method,
SetCurrentAnnotationGroup method, ShowAnnotationGroup method.
Get Annot at ionGroup Example VB
This example uses the AnnotationGroupCount property to deter mine the number of
groups on an image. Then it uses the GetAnnotationGroup method to get the group
names.
2TKXCVG 5WD EOF.KUV)TQWRUA%NKEM)
&KO KPV0WO)TQWRU #U +PVGIGT
&KO UVT)TQWR0COG #U 5VTKPI
&KO KPV%QWPV #U +PVGIGT
'(KPF QWV JQY OCP[ ITQWRU CTG QP VJG RCIG
KPV0WO)TQWRU - +OI'FKV1#PPQVCVKQP)TQWR%QWPV
.QCF HTO)TQWR.KUV
'5KPEG KPFGZ XCNWGU QH )GV#PPQVCVKQP)TQWR UVCTV YKVJ
'0 JCXG VQ NQQR QPG NGUU VJCP VJG PWODGT QH ITQWRU
(QT KPV%QWPV - 0 6Q KPV0WO)TQWRU 1
UVT)TQWR0COG - +OI'FKV1OetAnnotat1onOrouKPV%QWPV)
'9TKVG PCOGU QH ITQWRU VQ C NKUVDQZ
HTO)TQWR.KUV#PPQ)TQWRU#FF+VGO UVT)TQWR0COG)
0GZV KPV%QWPV
HTO)TQWR.KUV5JQY
'PF 5WD
Get Annot at ionGroup Example VC++
This example uses the AnnotationGroupCount property to deter mine the number of
groups on an image. Then it uses the GetAnnotationGroup method to get the group
names.
$11. %(TO)TQWR1P+PKV&KCNQI)
]
%&KCNQI1P+PKV&KCNQI)
// 6JKU TQWVKPG WUGU #PPQVCVKQP)TQWR%QWPV VQ FGVGTOKPG VJG PWODGT QH
// ITQWRU QP CP KOCIG CPF VJGP IGVU VJG ITQWR PCOGU WUKPI VJG
// )GV#PPQVCVKQP)TQWR OGVJQF
KPV K0WO)TQWRU
%5VTKPI U\)TQWR0COG
KPV K%QWPV
// (KPF QWV JQY OCP[ ITQWRU CTG QP VJG RCIG
K0WO)TQWRU - R2CTGPV&NI+OI'FKV1)GV#PPQVCVKQP)TQWR%QWPV)
// 5KPEG KPFGZ XCNWGU QH )GV#PPQVCVKQP)TQWR UVCTV YKVJ
// 0 JCXG VQ NQQR QPG NGUU VJCP VJG PWODGT QH ITQWRU
HQT K%QWPV - 0K%QWPV K0WO)TQWRU K%QWPV)
]
U\)TQWR0COG - R2CTGPV&NI+OI'FKV1OetAnnotat1onOrouK%QWPV)
// 9TKVG PCOGU QH ITQWRU VQ C NKUVDQZ
OA)TQWR.KUV#FF5VTKPI U\)TQWR0COG)

Get Annot at i onM arkCount M et hod
401
_
TGVWTP 647' // TGVWTP 647' WPNGUU [QW UGV VJG HQEWU VQ C EQPVTQN
// ':%'26+10 1%: 2TQRGTV[ 2CIGU UJQWNF TGVWTP (#.5'
_
Get Annot at ionMarkCount Met hod
Descript ion R eturns the number of annotation marks on an image page or in an annotation group.
Available Wit h
Applies To Image Edit control.
Usage object.GetAnnotationMarkCount([GroupName,AnnotationType])
Argument s The GetAnnotationMarkCount method has the following arguments:
Ret urns Integer.
Remarks The Display method must be invoked pr ior to calling this method.
If the GroupName and Annotation Type parameters are both entered, the
GetAnnotationMarkCount method retur ns 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 retur ns 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 retur ns the number of annotation marks of the type
specified that are in all of the annotation groups.
If no parameters are entered, the GetAnnotationMarkCount method returns the total
number of annotation marks that are on the page.
The GetAnnotationMarkCount method is valid only at run- time.
See Also AnnotationGroupCount property, AnnotationType property, Display method.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
GroupName Str ing The name of the annotation group.
AnnotationType Integer (enumerated) The desired AnnotationType setting
(see page 529).
Chapt er 7
402
Get Annot at ionMarkCount Example VB
This example shows some methods for deter mining the number and types of annotations
on a page.
2TKXCVG 5WD EOF/CTM%QWPVA%NKEM)
&KO KPV/CTM%QWPV #U +PVGIGT
'4GVWTPU C EQWPV QH CNN OCTMU QP VJG RCIG FKURNC[GF
KPV/CTM%QWPV - +OI'FKV1OetAnnotat1onMarkOount
'4GVWTPU C EQWPV QH CNN OCTMU KP VJG CPPQVCVKQP ITQWR ECNNGF CEEQWPVKPI
KPV/CTM%QWPV - +OI'FKV1OetAnnotat1onMarkOountCEEQWPVKPI)
'4GVWTPU C EQWPV QH CNN 1%4 TGIKQPU
KPV/CTM%QWPV - +OI'FKV1OetAnnotat1onMarkOount YK1ET4GIKQP)
'4GVWTPU C EQWPV QH CNN VGZV CPPQVCVKQP OCTMU KP VJG CPPQVCVKQP ITQWR
'ECNNGF CEEQWPVKPI
KPV/CTM%QWPV - +OI'FKV1OetAnnotat1onMarkOountCEEQWPVKPI YK6GZV)
'PF 5WD
Get Annot at ionMarkCount Example VC++
This example shows some methods for deter mining the number and types of annotations
on a page.
XQKF %+OI'FKV1&NI1P)GV%QWPV)
]
// 5QOG OGVJQFU HQT FGVGTOKPKPI VJG PWODGT CPF V[RGU QH CPPQVCVKQPU QP
// C RCIG
KPV K/CTM%QWPV
%5VTKPI U\%WT)TQWRCEEQWPVKPI)
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
8#4+#06 X%WT)TQWR 8A86oX%WT)TQWR) - 86A$5648A$564oX%WT)TQWR) -
U\%WT)TQWR#NNQE5[U5VTKPI)
8#4+#06 X%WT6[RG 8A86oX%WT6[RG) - 86A+
// 4GVWTPU C EQWPV QH CNN OCTMU QP VJG RCIG FKURNC[GF
K/CTM%QWPV - +OI'FKV1OetAnnotat1onMarkOountGXVGXV)
// 4GVWTPU C EQWPV QH CNN OCTMU KP VJG CPPQVCVKQP ITQWR ECNNGF
// CEEQWPVKPI
K/CTM%QWPV - +OI'FKV1OetAnnotat1onMarkOountX%WT)TQWRGXV)
// 4GVWTPU C EQWPV QH CNN 1%4 TGIKQPU
8A+oX%WT6[RG) - 1 // YK1ET4GIKQP
K/CTM%QWPV - +OI'FKV1OetAnnotat1onMarkOountGXV X%WT6[RG)
// 4GVWTPU C EQWPV QH CNN VGZV CPPQVCVKQP OCTMU KP VJG CPPQVCVKQP ITQWR
// ECNNGF CEEQWPVKPI
8A+oX%WT6[RG) - 7 // YK6GZV
K/CTM%QWPV - +OI'FKV1OetAnnotat1onMarkOountX%WT)TQWR X%WT6[RG)
_
Get Current Annot at ionGroup M et hod
403
Get Current Annot at ionGroup Met hod
Descript ion R eturns the name of the annotation group to which subsequent annotations will belong.
Available Wit h
Applies To Image Edit control.
Usage object.GetCurrentAnnotationGroup
Argument s None.
Ret urns Str ing.
Remarks The GetCurrentAnnotationGroup method is valid only at run- time.
See Also GetAnnotationGroup method, SetCurrentAnnotationGroup method.
Get RubberSt ampIt em Met hod
Descript ion R eturns the item number for the currently selected rubber stamp, according to its position
on the R ubber Stamp Properties dialog box (see page 497) and drop- down menu.
Available Wit h
Applies To Image Edit control.
Usage object.GetRubberStampItem
Argument s None.
Ret urns Integer.
Remarks The item number is zero based. For example, if the R eceived stamp is selected, an
ItemNumber of 2 is retur ned because it is the third item on the R ubber Stamp Properties
dialog box and drop- down menu.
The R ubber Stamp Properties dialog box is accessible by r ight- clicking on the R ubber
Stamp tool in the Annotation Tool Palette (see page 533). The drop- down menu is
accessible by left- clicking on the tool.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 98
Imaging for Windows 95
Imaging for Windows NT 4.0
Chapt er 7
404
See Also GetR ubberStampMenuItems method, SetR ubberStampItem method,
ShowR ubberStampDialog method.
Get RubberSt ampIt em Example VB
This example uses the GetR ubberStampMenuItems method to populate a list box with the
names of the rubber stamps that are cur rently available. It also uses the
GetR ubberStampItem method to obtain the item number of the stamp that is cur rently
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.
2TKXCVG 5WD EOF5VCORUA%NKEM)
')GV VJG PCOGU QH CNN CXCKNCDNG TWDDGT UVCORU CPF YTKVG VJGO VQ C
'NKUVDQZ 6JKU EQWNF DG WUGF YJGP FGUKIPKPI C EWUVQO VQQN RCNGVVG UQ
'VJCV YJGP VJG WUGT ENKEMU QP VJG UVCOR KEQP VJG[ EQWNF
'VJGP UGNGEV VJG FGUKTGF UVCOR HTQO C NKUV
&KO UVT#NN5VCORU #U 5VTKPI
&KO UVT5VCOR0COG #U 5VTKPI
&KO KPV%WT5VCOR #U +PVGIGT
&KO KPV5VCTV2QU #U +PVGIGT
&KO KPV'PF2QU #U +PVGIGT
')GV VJG UVCOR NKUV
UVT#NN5VCORU - HTO/CKP+OI'FKV1)GV4WDDGT5VCOR/GPW+VGOU
'.QCF VJG NKUV DQZ
.QCF HTO5VCOR.KUV
KPV5VCTV2QU - 0
KPV'PF2QU - 1
'.QQR VQ RCTUG UVCORU
&Q 9JKNG KPV'PF2QU 0
'(KPF NQECVKQP QH NKPG HGGF EJCTCEVGTU YJKEJ UGRCTCVG UVCOR PCOGU
KPV'PF2QU - +P5VTKPV5VCTV2QU 1 UVT#NN5VCORU XD.H)
'+H KPV'PF2QU KU 0 YG CTG CV VJG GPF QH VJG UVTKPI
+H KPV'PF2QU - 0 6JGP 'ZKV &Q
'4GVTKGXG VGZV WR VQ VJG NKPG HGGF EJCTCEVGT
UVT5VCOR0COG - /KFUVT#NN5VCORU KPV5VCTV2QU 1)
KPV'PF2QU KPV5VCTV2QU 1))
HTO5VCOR.KUV.KUV1#FF+VGO UVT5VCOR0COG
KPV5VCTV2QU - KPV'PF2QU
.QQR
'*KIJNKIJV VJG UVCOR VJCV KU VJG EWTTGPVN[ UGNGEVGF UVCOR 6JKU YKNN DG
'VJG HKTUV UVCOR KP VJG NKUV KH PQPG JCXG DGGP UGNGEVGF QVJGTYKUG KV
'YKNN DG VJG OQUV TGEGPVN[ UGNGEVGF UVCOR
KPV%WT5VCOR - HTO/CKP+OI'FKV1OetRubberStamItem
HTO5VCOR.KUV.KUV1.KUV+PFGZ - KPV%WT5VCOR
HTO5VCOR.KUV5JQY
'PF 5WD
Get RubberSt ampIt em M et hod
405
Get RubberSt ampIt em Example VC++
This example uses the GetR ubberStampMenuItems method to populate a list box with the
names of the cur rently available rubber stamps. It also uses the GetR ubberStampItem
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.
$11. %5VCOR.KUV1P+PKV&KCNQI)
]
// )GV VJG PCOGU QH CNN CXCKNCDNG TWDDGT UVCORU CPF YTKVG VJGO VQ C
// NKUVDQZ 6JKU EQWNF DG WUGF YJGP FGUKIPKPI C EWUVQO VQQN RCNGVVG UQ
// VJCV YJGP VJG WUGT ENKEMU QP VJG UVCOR KEQP VJG[
// EQWNF VJGP UGNGEV VJG FGUKTGF UVCOR HTQO C NKUV
%&KCNQI1P+PKV&KCNQI)
%5VTKPI UVT#NN5VCORU
KPV KPV%WT5VCOR
// )GV VJG UVCOR NKUV
UVT#NN5VCORU - OAR2CTGPV+OI'FKV1)GV4WDDGT5VCOR/GPW+VGOU)
// .QQR VQ RCTUG UVCORU
EJCT UGR=? - >P
EJCT ' VQMGP
/' 'UVCDNKUJ UVTKPI CPF IGV VJG HKTUV VQMGP '/
VQMGP - AVEUVQM UVT#NN5VCORU)GV$WHHGTUVT#NN5VCORU)GV.GPIVJ
))UGR)
YJKNG VQMGP !- 07.. )
]
OA5VCOR.KUV#FF5VTKPIVQMGP)
VQMGP - AVEUVQM 07.. UGR )
_
// *KIJNKIJV VJG UVCOR VJCV KU VJG EWTTGPVN[ UGNGEVGF UVCOR
KPV%WT5VCOR - OAR2CTGPV+OI'FKV1OetRubberStamItem)
OA5VCOR.KUV5GV%WT5GNKPV%WT5VCOR)
TGVWTP 647' // TGVWTP 647' WPNGUU [QW UGV VJG HQEWU VQ C EQPVTQN
// ':%'26+10 1%: 2TQRGTV[ 2CIGU UJQWNF TGVWTP (#.5'
_
XQKF %5VCOR.KUV1P1-)
]
// )GV VJG KPFGZ PWODGT QH VJG UVCOR VJCV YCU UGNGEVGF KP VJG NKUV DQZ
OAKPV0GY5VCOR - OA5VCOR.KUV)GV%WT5GN)
// 5GV VJG UGNGEVGF UVCOR CU VJG EWTTGPV UVCOR VQ DG WUGF
%&KCNQI1P1-)
_
Chapt er 7
406
Get RubberSt ampMenuIt ems Met hod
Descript ion R eturns the menu items for the R ubber Stamp tool on the Annotation Tool Palette
(see page 533).
Available Wit h
Applies To Image Edit control.
Usage object.GetRubberStampMenuItems
Argument s None.
Ret urns Str ing.
Remarks The retur ned str ings are separated by a new line character (\ n).
The R ubber Stamp drop- down menu is accessible by left- clicking the R ubber Stamp tool
on the palette.
See Also GetR ubberStampItem method, SetR ubberStampItem method.
Get RubberSt ampMenuIt ems Example VB
This example uses GetR ubberStampMenuItems to populate a list box with the names of
the rubber stamps that are cur rently available. It also uses the GetR ubberStampItem
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.
2TKXCVG 5WD EOF5VCORUA%NKEM)
')GV VJG PCOGU QH CNN CXCKNCDNG TWDDGT UVCORU CPF YTKVG VJGO VQ C
'NKUVDQZ 6JKU EQWNF DG WUGF YJGP FGUKIPKPI C EWUVQO VQQN RCNGVVG UQ
'VJCV YJGP VJG WUGT ENKEMU QP VJG UVCOR KEQP VJG[ EQWNF
'VJGP UGNGEV VJG FGUKTGF UVCOR HTQO C NKUV
&KO UVT#NN5VCORU #U 5VTKPI
&KO UVT5VCOR0COG #U 5VTKPI
&KO KPV%WT5VCOR #U +PVGIGT
&KO KPV5VCTV2QU #U +PVGIGT
&KO KPV'PF2QU #U +PVGIGT
')GV VJG UVCOR NKUV
UVT#NN5VCORU - HTO/CKP+OI'FKV1OetRubberStamMenuItems
'.QCF VJG NKUV DQZ
.QCF HTO5VCOR.KUV
KPV5VCTV2QU - 0
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 98
Imaging for Windows 95
Imaging for Windows NT 4.0
Get RubberSt ampM enuIt ems M et hod
407
KPV'PF2QU - 1
'.QQR VQ RCTUG UVCORU
&Q 9JKNG KPV'PF2QU 0
'(KPF NQECVKQP QH NKPG HGGF EJCTCEVGTU YJKEJ UGRCTCVG UVCOR PCOGU
KPV'PF2QU - +P5VTKPV5VCTV2QU 1 UVT#NN5VCORU XD.H)
'+H KPV'PF2QU KU 0 YG CTG CV VJG GPF QH VJG UVTKPI
+H KPV'PF2QU - 0 6JGP 'ZKV &Q
'4GVTKGXG VGZV WR VQ VJG NKPG HGGF EJCTCEVGT
UVT5VCOR0COG - /KFUVT#NN5VCORU KPV5VCTV2QU 1)
KPV'PF2QU KPV5VCTV2QU 1))
HTO5VCOR.KUV.KUV1#FF+VGO UVT5VCOR0COG
KPV5VCTV2QU - KPV'PF2QU
.QQR
'*KIJNKIJV VJG UVCOR VJCV KU VJG EWTTGPVN[ UGNGEVGF UVCOR 6JKU YKNN DG
'VJG HKTUV UVCOR KP VJG NKUV KH PQPG JCXG DGGP UGNGEVGF QVJGTYKUG KV
'YKNN DG VJG OQUV TGEGPVN[ UGNGEVGF UVCOR
KPV%WT5VCOR - HTO/CKP+OI'FKV1)GV4WDDGT5VCOR+VGO
HTO5VCOR.KUV.KUV1.KUV+PFGZ - KPV%WT5VCOR
HTO5VCOR.KUV5JQY
'PF 5WD
Get RubberSt ampMenuIt ems Example VC++
This example uses the GetR ubberStampMenuItems method to populate a list box with the
names of the rubber stamps that are cur rently available. It also uses the
GetR ubberStampItem method to obtain the item number of the stamp that is cur rently
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.
$11. %5VCOR.KUV1P+PKV&KCNQI)
]
// )GV VJG PCOGU QH CNN CXCKNCDNG TWDDGT UVCORU CPF YTKVG VJGO VQ C
// NKUVDQZ 6JKU EQWNF DG WUGF YJGP FGUKIPKPI C EWUVQO VQQN RCNGVVG UQ
// VJCV YJGP VJG WUGT ENKEMU QP VJG UVCOR KEQP VJG[
// EQWNF VJGP UGNGEV VJG FGUKTGF UVCOR HTQO C NKUV
%&KCNQI1P+PKV&KCNQI)
%5VTKPI UVT#NN5VCORU
KPV KPV%WT5VCOR
// )GV VJG UVCOR NKUV
UVT#NN5VCORU - OAR2CTGPV+OI'FKV1OetRubberStamMenuItems)
// .QQR VQ RCTUG UVCORU
EJCT UGR=? - >P
EJCT ' VQMGP
/' 'UVCDNKUJ UVTKPI CPF IGV VJG HKTUV VQMGP '/
VQMGP - AVEUVQM UVT#NN5VCORU)GV$WHHGTUVT#NN5VCORU)GV.GPIVJ
))UGR)
YJKNG VQMGP !- 07.. )
]
OA5VCOR.KUV#FF5VTKPIVQMGP)
VQMGP - AVEUVQM 07.. UGR )
Chapt er 7
408
_
// *KIJNKIJV VJG UVCOR VJCV KU VJG EWTTGPVN[ UGNGEVGF UVCOR
KPV%WT5VCOR - OAR2CTGPV+OI'FKV1)GV4WDDGT5VCOR+VGO)
OA5VCOR.KUV5GV%WT5GNKPV%WT5VCOR)
TGVWTP 647' // TGVWTP 647' WPNGUU [QW UGV VJG HQEWU VQ C EQPVTQN
// ':%'26+10 1%: 2TQRGTV[ 2CIGU UJQWNF TGVWTP (#.5'
_
XQKF %5VCOR.KUV1P1-)
]
// )GV VJG KPFGZ PWODGT QH VJG UVCOR VJCV YCU UGNGEVGF KP VJG NKUV DQZ
OAKPV0GY5VCOR - OA5VCOR.KUV)GV%WT5GN)
// 5GV VJG UGNGEVGF UVCOR CU VJG EWTTGPV UVCOR VQ DG WUGF
%&KCNQI1P1-)
_
Get Select edAnnot at ionBackColor Met hod
Descript ion R eturns the background color of a selected Attach- a- Note annotation.
Available Wit h
Applies To Image Edit control.
Usage object.GetSelectedAnnotationBackColor
Argument s None.
Ret urns 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 R GB for mat (see page 540).
See Also AnnotationBackColor property, AnnotationType property,
SetSelectedAnnotationBackColor method.
Get Select edAnnot at ionBackColor Example 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.
2TKXCVG 5WD EOF$CEM%QNQTA%NKEM)
'6JKU GZCORNG WUGU VJG /KETQUQHV EQNQT FKCNQI DQZ VQ EJCPIG
'C UGNGEVGF VGZV CVVCEJOGPV CPPQVCVKQP OCTMNU DCEMITQWPF EQNQT
&KO $CEM%QNQT #U 1.'A%1.14
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Get Select edAnnot at ionFillColor M et hod
409
'&GVGTOKPG VJG EWTTGPV EQNQT QH VJG UGNGEVGF CPPQVCVKQP
'OCTM CPF KPKV VJG FKCNQI DQZ EQNQT RTQRGTV[ VQ VJCV EQNQT
$CEM%QNQT - +OI'FKV1OetSeectedAnnotat1onBackOoor
%QOOQP&KCNQI1%QNQT - $CEM%QNQT
%QOOQP&KCNQI1(NCIU - EFN%%4)$+PKV
'&KURNC[ VJG FKCNQI DQZ CPF UGV VJG CPPQVCVKQP DCEMITQWPF EQNQT VQ VJG
'EQNQT UGNGEVGF
%QOOQP&KCNQI15JQY%QNQT
+OI'FKV15GV5GNGEVGF#PPQVCVKQP$CEM%QNQT %QOOQP&KCNQI1%QNQT
'PF 5WD
Get Select edAnnot at ionBackColor Example 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.
XQKF %+OI'FKV&NI1P$CEMEQNQT)
]
// 6JKU GZCORNG WUGU VJG /KETQUQHV EQNQT FKCNQI DQZ VQ EJCPIG
// C UGNGEVGF VGZV CVVCEJOGPV CPPQVCVKQP OCTMNU DCEMITQWPF EQNQT
NQPI $CEM%QNQT
// &GVGTOKPG VJG EWTTGPV EQNQT QH VJG UGNGEVGF CPPQVCVKQP
// OCTM CPF KPKV VJG FKCNQI DQZ EQNQT RTQRGTV[ VQ VJCV EQNQT
$CEM%QNQT - +OI'FKV1OetSeectedAnnotat1onBackOoor)
%QOOQP&KCNQI15GV%QNQT$CEM%QNQT)
%QOOQP&KCNQI15GV(NCIU1) // EFN%%4)$+PKV
%QOOQP&KCNQI15JQY%QNQT)
+OI'FKV15GV5GNGEVGF#PPQVCVKQP$CEM%QNQT%QOOQP&KCNQI1)GV%QNQT))
_
Get Select edAnnot at ionFillColor Met hod
Descript ion R eturns the color used to fill a selected Filled R ectangle annotation.
Available Wit h
Applies To Image Edit control.
Usage object.GetSelectedAnnotationFillColor
Argument s None.
Ret urns OLE_COLOR .
Remarks The GetSelectedAnnotationFillColor method is valid only at run- time. It is used with
annotations of the Filled R ectangle type.
Color is expressed using the R GB for mat (see page 540).
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
410
See Also AnnotationFillColor property, AnnotationType property, SetSelectedAnnotationFillColor
method.
Get Select edAnnot at ionFillColor Example VB
This example uses the GetSelectedAnnotationFillColor method to deter mine 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.
2TKXCVG 5WD EOF(KNN%QNQTA%NKEM)
'6JKU GZCORNG WUGU VJG /KETQUQHV EQNQT FKCNQI DQZ VQ
'EJCPIG C UGNGEVGF CPPQVCVKQP OCTMNU HKNN EQNQT
&KO (KNN%QNQT #U 1.'A%1.14
'&GVGTOKPG VJG EWTTGPV EQNQT QH VJG UGNGEVGF CPPQVCVKQP
'OCTM CPF KPKV VJG FKCNQI DQZ EQNQT RTQRGTV[ VQ VJCV EQNQT
(KNN%QNQT - +OI'FKV1OetSeectedAnnotat1onF1Ooor
%QOOQP&KCNQI1%QNQT - (KNN%QNQT
%QOOQP&KCNQI1(NCIU - EFN%%4)$+PKV
%QOOQP&KCNQI15JQY%QNQT
+OI'FKV15GV5GNGEVGF#PPQVCVKQP(KNN%QNQT %QOOQP&KCNQI1%QNQT
'PF 5WD
Get Select edAnnot at ionFillColor Example VC++
This example uses the GetSelectedAnnotationFillColor method to deter mine 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.
XQKF %+OI'FKV&NI1P(KNNEQNQT)
]
// 6JKU GZCORNG WUGU VJG /KETQUQHV EQNQT FKCNQI DQZ VQ
// EJCPIG C UGNGEVGF CPPQVCVKQP OCTMNU HKNN EQNQT
NQPI (KNN%QNQT
// &GVGTOKPG VJG EWTTGPV EQNQT QH VJG UGNGEVGF CPPQVCVKQP
// OCTM CPF KPKV VJG FKCNQI DQZ EQNQT RTQRGTV[ VQ VJCV EQNQT
(KNN%QNQT - +OI'FKV1OetSeectedAnnotat1onF1Ooor)
%QOOQP&KCNQI15GV%QNQT(KNN%QNQT)
%QOOQP&KCNQI15GV(NCIU1) // EFN%%4)$+PKV
%QOOQP&KCNQI15JQY%QNQT)
+OI'FKV15GV5GNGEVGF#PPQVCVKQP(KNN%QNQT%QOOQP&KCNQI1)GV%QNQT))
_
Get Select edAnnot at ionFil lSt yle M et hod
411
Get Select edAnnot at ionFillSt yle Met hod
Descript ion R eturns the style used to fill a selected image or Filled R ectangle annotation.
Available Wit h
Applies To Image Edit control.
Usage object.GetSelectedAnnotationFillStyle
Argument s None.
Ret urns Integer (enumerated).
Remarks The GetSelectedAnnotationFillStyle method is valid only at run- time. It is used with
annotations of the following types:
s
Filled R ectangle
s
Image Embedded
s
Image R eference
See Also AnnotationFillStyle property, AnnotationType property, SetSelectedAnnotationFillStyle
method.
Get Select edAnnot at ionFillSt yle Example VB
This example uses the GetSelectedAnnotationFillStyle method to deter mine whether a
selected image or filled rectangle annotation is opaque or transparent, and the
SetSelectedAnnotationFillStyle method to change the fill style.
2TKXCVG 5WD (QTOA.QCF)
'6JKU GZCORNG FGVGTOKPGU YJGVJGT C UGNGEVGF CPPQVCVKQP KOCIG QT
'HKNNGF TGEVCPING KU QRCSWG QT VTCPURCTGPV CPF CNNQYU VJCV
'CVVTKDWVG VQ DG EJCPIGF 6JG HQTO WUGF JCU QRVKQP DWVVQPU
'QPG NCDGNGF 1RCSWG CPF QPG NCDGNGF 6TCPURCTGPV
&KO (KNN5V[NG #U #PPQVCVKQP5V[NG%QPUVCPVU
'&GVGTOKPG KH VJG UGNGEVGF KOCIG CPPQVCVKQP KU QRCSWG QT
'VTCPURCTGPV CPF UGV VJG EQTTGURQPFKPI QRVKQP DWVVQP QP VJG HQTO
(KNN5V[NG - HTO/CKP+OI'FKV1OetSeectedAnnotat1onF1Stye
+H (KNN5V[NG - YK1RCSWG 6JGP
QRV1RCSWG8CNWG - 6TWG
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Cont ant Value Descript ion
wiTransparent 0 Transparent
wiOpaque 1 Opaque
Chapt er 7
412
'NUG
QRV6TCPURCTGPV8CNWG - 6TWG
'PF +H
HTO(KNN5V[NG5JQY
'PF 5WD
2TKXCVG 5WD QRV1RCSWGA%NKEM)
'+H VJG WUGT ENKEMU QP VJG 1RCSWG QRVKQP DWVVQP VJG CPPQVCVKQP KU
'EJCPIGF VQ DG QRCSWG
HTO/CKP+OI'FKV15GV5GNGEVGF#PPQVCVKQP(KNN5V[NG YK1RCSWG
'PF 5WD
Get Select edAnnot at ionFillSt yle Example VC++
This example uses the GetSelectedAnnotationFillStyle method to deter mine whether a
selected image or filled rectangle annotation is opaque or transparent, and the
SetSelectedAnnotationFillStyle method to change the fill style.
XQKF %.KPG5V[NGU1P1-)
]
KHOA6TCPURCTGPV)GV%JGEM) oo OAD.KPG5V[NG)
OAR2CTGPV+OI'FKV15GV5GNGEVGF#PPQVCVKQP.KPG5V[NG0)
GNUG
OAR2CTGPV+OI'FKV15GV5GNGEVGF#PPQVCVKQP.KPG5V[NG1)
KHOA6TCPURCTGPV)GV%JGEM) oo !OAD.KPG5V[NG)
OAR2CTGPV+OI'FKV15GV5GNGEVGF#PPQVCVKQP(KNN5V[NG0)
GNUG
OAR2CTGPV+OI'FKV15GV5GNGEVGF#PPQVCVKQP(KNN5V[NG1)
%&KCNQI1P1-)
_
$11. %.KPG5V[NGU1P+PKV&KCNQI)
]
%&KCNQI1P+PKV&KCNQI)
UJQTV .KPG5V[NG
// &GVGTOKPG KH VJG UGNGEVGF NKPG QT HKNN CPPQVCVKQP KU QRCSWG QT
// VTCPURCTGPV CPF UGV VJG EQTTGURQPFKPI QRVKQP DWVVQP QP VJG HQTO
KHOAD.KPG5V[NG)
.KPG5V[NG - OAR2CTGPV+OI'FKV1)GV5GNGEVGF#PPQVCVKQP.KPG5V[NG)
GNUG
]
.KPG5V[NG - OAR2CTGPV+OI'FKV1OetSeectedAnnotat1onF1Stye)
5GV9KPFQY6GZV(KNN 5V[NGU)
_
KH.KPG5V[NG -- 1) // YK1RCSWG
]
OA1RCSWG5GV%JGEM1)
OA6TCPURCTGPV5GV%JGEM0)
_
GNUG
]
OA1RCSWG5GV%JGEM0)
OA6TCPURCTGPV5GV%JGEM1)
_
Get Select edAnnot at ionFont M et hod
413
TGVWTP 647' // TGVWTP 647' WPNGUU [QW UGV VJG HQEWU VQ C EQPVTQN
// ':%'26+10 1%: 2TQRGTV[ 2CIGU UJQWNF TGVWTP (#.5'
_
Get Select edAnnot at ionFont Met hod
Descript ion R eturns a font objects properties. Applies to selected text annotations.
Available Wit h
Applies To Image Edit control.
Usage object.GetSelectedAnnotationFont
Argument s None.
Ret urns IFontDisp.
Remarks The GetSelectedAnnotationFont method is valid only at run- time. It is used with
annotations of the following types:
s
Attach- a- Note
s
Text
s
Hyperlink
s
Text From File
s
Text Stamp
See Also AnnotationFont property, AnnotationType property, SetSelectedAnnotationFont method.
Get Select edAnnot at ionFont Example VB
This example uses the GetSelectedAnnotationFont method to deter mine the font attr ibutes
of a selected annotation. It then updates the Microsoft common dialog box to indicate the
attr ibutes obtained.
This example also uses the Microsoft common dialog box and the
SetSelectedAnnotationFont method to change the font attr ibutes of a selected annotation.
2TKXCVG 5WD EOF)GV#PPQ(QPVA%NKEM)
'6JKU GZCORNG WUGU VJG /KETQUQHV HQPV FKCNQI DQZ VQ
'EJCPIG C UGNGEVGF VGZV CPPQVCVKQP OCTMNU HQPV
&KO #PPQ(QPV #U +(QPV&KUR
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Not e: Hyperlink annot at ions are available w it h Imaging f or Window s Prof essional Edit ion
only.
Chapt er 7
414
&KO (QPV%QNQT #U 1.'A%1.14
'&GVGTOKPG VJG EWTTGPV HQPV WUGF KP VJG UGNGEVGF CPPQVCVKQP
'OCTM CPF KPKV VJG FKCNQI DQZ HQPV RTQRGTV[ VQ VJCV HQPV
5GV #PPQ(QPV - +OI'FKV1OetSeectedAnnotat1onFont
(QPV%QNQT - +OI'FKV1)GV5GNGEVGF#PPQVCVKQP(QPV%QNQT
%QOOQP&KCNQI1(QPV0COG - #PPQ(QPV0COG
%QOOQP&KCNQI1(QPV$QNF - #PPQ(QPV$QNF
%QOOQP&KCNQI1(QPV+VCNKE - #PPQ(QPV+VCNKE
%QOOQP&KCNQI1(QPV5K\G - #PPQ(QPV5K\G
%QOOQP&KCNQI1(QPV7PFGTNKPG - #PPQ(QPV7PFGTNKPG
%QOOQP&KCNQI1(QPV5VTKMGVJTW - #PPQ(QPV5VTKMGVJTQWIJ
%QOOQP&KCNQI1%QNQT - (QPV%QNQT
%QOOQP&KCNQI1(NCIU - EFN%(5ETGGP(QPVU 1T EFN%('HHGEVU
%QOOQP&KCNQI15JQY(QPV
'6CMG XCNWGU UGV KP VJG HQPV FKCNQI DQZ CPF UGV VJGUG CVVTKDWVGU KP VJG
'CPPQVCVKQP HQPV
#PPQ(QPV0COG - %QOOQP&KCNQI1(QPV0COG
#PPQ(QPV$QNF - %QOOQP&KCNQI1(QPV$QNF
#PPQ(QPV+VCNKE - %QOOQP&KCNQI1(QPV+VCNKE
#PPQ(QPV5K\G - %QOOQP&KCNQI1(QPV5K\G
#PPQ(QPV7PFGTNKPG - %QOOQP&KCNQI1(QPV7PFGTNKPG
#PPQ(QPV5VTKMGVJTQWIJ - %QOOQP&KCNQI1(QPV5VTKMGVJTW
'#RRN[ VJG PGY HQPV CPF HQPV EQNQT VQ VJG UGNGEVGF CPPQVCVKQP
+OI'FKV15GV5GNGEVGF#PPQVCVKQP(QPV #PPQ(QPV
+OI'FKV15GV5GNGEVGF#PPQVCVKQP(QPV%QNQT %QOOQP&KCNQI1%QNQT
'PF 5WD
Get Select edAnnot at ionFont Example VC++
This example uses the GetSelectedAnnotationFont method to deter mine the font attr ibutes
of a selected annotation. It then updates the Microsoft common dialog box to indicate the
attr ibutes obtained.
This example also uses the Microsoft common dialog box and the
SetSelectedAnnotationFont method to change the font attr ibutes of a selected annotation.
XQKF %+OI'FKV&NI1P#PPQHQPV)
]
// 6JKU GZCORNG WUGU VJG /KETQUQHV HQPV FKCNQI DQZ VQ
// EJCPIG C UGNGEVGF VGZV CPPQVCVKQP OCTMNU HQPV
%1NG(QPV #PPQ(QPV
#PPQ(QPV - +OI'FKV1OetSeectedAnnotat1onFont)
%; E[
NQPI (QPV%QNQT
// &GVGTOKPG VJG EWTTGPV HQPV WUGF KP VJG UGNGEVGF CPPQVCVKQP
// OCTM CPF KPKV VJG FKCNQI DQZ HQPV RTQRGTV[ VQ VJCV HQPV
#PPQ(QPV - +OI'FKV1OetSeectedAnnotat1onFont)
(QPV%QNQT - +OI'FKV1)GV5GNGEVGF#PPQVCVKQP(QPV%QNQT)
%QOOQP&KCNQI15GV(QPV0COG#PPQ(QPV)GV0COG))
%QOOQP&KCNQI15GV(QPV$QNF#PPQ(QPV)GV$QNF))
%QOOQP&KCNQI15GV(QPV+VCNKE#PPQ(QPV)GV+VCNKE))
E[ - #PPQ(QPV)GV5K\G)
Get Select edAnnot at ionFont Color M et hod
415
%QOOQP&KCNQI15GV(QPV5K\GHNQCV)E[.Q / 10000)
%QOOQP&KCNQI15GV(QPV7PFGT.KPG#PPQ(QPV)GV7PFGTNKPG))
%QOOQP&KCNQI15GV(QPV5VTKMG6JTW#PPQ(QPV)GV5VTKMGVJTQWIJ))
%QOOQP&KCNQI15GV%QNQT(QPV%QNQT)
%QOOQP&KCNQI15GV(NCIU0Z101) //EFN%(5ETGGP(QPVU 1T EFN%('HHGEVU
%QOOQP&KCNQI15JQY(QPV)
// 6CMG XCNWGU UGV KP VJG HQPV FKCNQI DQZ CPF UGV VJGUG CVVTKDWVGU KP
// VJG CPPQVCVKQP HQPV
#PPQ(QPV5GV0COG%QOOQP&KCNQI1)GV(QPV0COG))
#PPQ(QPV5GV$QNF%QOOQP&KCNQI1)GV(QPV$QNF))
#PPQ(QPV5GV+VCNKE%QOOQP&KCNQI1)GV(QPV+VCNKE))
E[.Q - WPUKIPGF NQPI)%QOOQP&KCNQI1)GV(QPV5K\G) ' 10000
#PPQ(QPV5GV5K\GE[)
#PPQ(QPV5GV7PFGTNKPG%QOOQP&KCNQI1)GV(QPV7PFGT.KPG))
#PPQ(QPV5GV5VTKMGVJTQWIJ%QOOQP&KCNQI1)GV(QPV5VTKMG6JTW))
// #RRN[ VJG PGY HQPV CPF HQPV EQNQT VQ VJG UGNGEVGF CPPQVCVKQP
+OI'FKV15GV5GNGEVGF#PPQVCVKQP(QPV#PPQ(QPV)
+OI'FKV15GV5GNGEVGF#PPQVCVKQP(QPV%QNQT%QOOQP&KCNQI1)GV%QNQT))
_
Get Select edAnnot at ionFont Color Met hod
Descript ion R eturns the color used in a selected text annotation.
Available Wit h
Applies To Image Edit control.
Usage object.GetSelectedAnnotationFontColor
Argument s None.
Ret urns OLE_COLOR .
Remarks The GetSelectedAnnotationFontColor method is valid only at run- time. It is used with
annotations of the following types:
s
Attach- a- Note
s
Hyperlink
s
Text
s
Text From File
s
Text Stamp
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
416
Color is expressed using the R GB for mat (see page 540).
See Also AnnotationFontColor property, AnnotationType property,
SetSelectedAnnotationFontColor method.
Get Select edAnnot at ionFont Color Example VB
This example uses the GetSelectedAnnotationFontColor method to deter mine 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.
2TKXCVG 5WD EOF(QPV%QNQTA%NKEM)
'6JKU GZCORNG WUGU VJG /KETQUQHV EQNQT FKCNQI DQZ VQ
'EJCPIG C UGNGEVGF CPPQVCVKQP OCTMNU HQPV EQNQT
&KO (QPV%QNQT #U 1.'A%1.14
'&GVGTOKPG VJG EWTTGPV EQNQT QH VJG UGNGEVGF CPPQVCVKQP
'OCTM CPF KPKV VJG FKCNQI DQZ EQNQT RTQRGTV[ VQ VJCV EQNQT
(QPV%QNQT - +OI'FKV1OetSeectedAnnotat1onFontOoor
%QOOQP&KCNQI1%QNQT - (QPV%QNQT
%QOOQP&KCNQI1(NCIU - EFN%%4)$+PKV
%QOOQP&KCNQI15JQY%QNQT
+OI'FKV15GV5GNGEVGF#PPQVCVKQP(QPV%QNQT %QOOQP&KCNQI1%QNQT
'PF 5WD
Get Select edAnnot at ionFont Color Example VC++
This example uses the GetSelectedAnnotationFontColor method to deter mine 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.
XQKF %+OI'FKV&NI1P#PPQHQPV)
]
// 6JKU GZCORNG WUGU VJG /KETQUQHV HQPV FKCNQI DQZ VQ
// EJCPIG C UGNGEVGF VGZV CPPQVCVKQP OCTMNU HQPV
%1NG(QPV #PPQ(QPV
#PPQ(QPV - +OI'FKV1)GV5GNGEVGF#PPQVCVKQP(QPV)
%; E[
NQPI (QPV%QNQT
// &GVGTOKPG VJG EWTTGPV HQPV WUGF KP VJG UGNGEVGF CPPQVCVKQP
// OCTM CPF KPKV VJG FKCNQI DQZ HQPV RTQRGTV[ VQ VJCV HQPV
#PPQ(QPV - +OI'FKV1)GV5GNGEVGF#PPQVCVKQP(QPV)
(QPV%QNQT - +OI'FKV1OetSeectedAnnotat1onFontOoor)
Not e: Hyperlink annot at ions are available w it h Imaging f or Window s Prof essional Edit ion
only.
Get Sel ect edAnnot at ionImage M et hod
417
%QOOQP&KCNQI15GV(QPV0COG#PPQ(QPV)GV0COG))
%QOOQP&KCNQI15GV(QPV$QNF#PPQ(QPV)GV$QNF))
%QOOQP&KCNQI15GV(QPV+VCNKE#PPQ(QPV)GV+VCNKE))
E[ - #PPQ(QPV)GV5K\G)
%QOOQP&KCNQI15GV(QPV5K\GHNQCV)E[.Q / 10000)
%QOOQP&KCNQI15GV(QPV7PFGT.KPG#PPQ(QPV)GV7PFGTNKPG))
%QOOQP&KCNQI15GV(QPV5VTKMG6JTW#PPQ(QPV)GV5VTKMGVJTQWIJ))
%QOOQP&KCNQI15GV%QNQT(QPV%QNQT)
%QOOQP&KCNQI15GV(NCIU0Z101) //EFN%(5ETGGP(QPVU 1T EFN%('HHGEVU
%QOOQP&KCNQI15JQY(QPV)
// 6CMG XCNWGU UGV KP VJG HQPV FKCNQI DQZ CPF UGV VJGUG CVVTKDWVGU KP
// VJG CPPQVCVKQP HQPV
#PPQ(QPV5GV0COG%QOOQP&KCNQI1)GV(QPV0COG))
#PPQ(QPV5GV$QNF%QOOQP&KCNQI1)GV(QPV$QNF))
#PPQ(QPV5GV+VCNKE%QOOQP&KCNQI1)GV(QPV+VCNKE))
E[.Q - WPUKIPGF NQPI)%QOOQP&KCNQI1)GV(QPV5K\G) ' 10000
#PPQ(QPV5GV5K\GE[)
#PPQ(QPV5GV7PFGTNKPG%QOOQP&KCNQI1)GV(QPV7PFGT.KPG))
#PPQ(QPV5GV5VTKMGVJTQWIJ%QOOQP&KCNQI1)GV(QPV5VTKMG6JTW))
// #RRN[ VJG PGY HQPV CPF HQPV EQNQT VQ VJG UGNGEVGF CPPQVCVKQP
+OI'FKV15GV5GNGEVGF#PPQVCVKQP(QPV#PPQ(QPV)
+OI'FKV15GV5GNGEVGF#PPQVCVKQP(QPV%QNQT%QOOQP&KCNQI1)GV%QNQT))
_
Get Select edAnnot at ionImage Met hod
Descript ion R eturns the fully- qualified name (see page 535) of the image that is being used in a selected
image annotation.
Available Wit h
Applies To Image Edit control.
Usage object.GetSelectedAnnotationImage
Argument s None.
Ret urns Str ing.
Remarks The GetSelectedAnnotationImage method is valid only at run- time. It is used with
annotations of the following types:
s
Image Embedded
s
Image R eference
See Also AnnotationImage property, AnnotationType property.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
418
Get Select edAnnot at ionImage Example VB
This example uses the GetSelectedAnnotationImage method to obtain the fully- qualified
file name of the image being used in a selected image annotation.
2TKXCVG 5WD %OF)GV#PPQ+OIA%NKEM)
'&KURNC[U C OGUUCIG DQZ YJKEJ UJQYU VJG HWNN[ SWCNKHKGF
'HKNGPCOG HQT C UGNGEVGF CPPQVCVKQP KOCIG
&KO UVT#PP+OI #U 5VTKPI
'6JG /CTM5GNGEV GXGPV EQWNF DG WUGF VQ FGVGTOKPG KH
'VJG CRRTQRTKCVG V[RG QH CPPQVCVKQP OCTM KU UGNGEVGF
UVT#PP+OI - +OI'FKV1OetSeectedAnnotat1onImaqe
/UI$QZ 6JG CPPQVCVKQP KOCIG KU o UVT#PP+OI
'PF 5WD
Get Select edAnnot at ionLineColor Met hod
Descript ion R eturns the line color used in a selected line or Hollow R ectangle annotation.
Available Wit h
Applies To Image Edit control.
Usage object.GetSelectedAnnotationLineColor
Argument s None.
Ret urns OLE_COLOR .
Remarks The GetSelectedAnnotationLineColor method is valid only at run- time. It is used with
annotations of the following types:
s
Freehand Line
s
Hollow R ectangle
s
Straight Line
Color is expressed using the R GB for mat (see page 540).
See Also AnnotationLineColor property, AnnotationType property,
SetSelectedAnnotationLineColor method.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Get Select edAnnot at ionLineColor M et hod
419
Get Select edAnnot at ionLineColor Example VB
This example uses the GetSelectedAnnotationLineColor method to deter mine 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.
2TKXCVG 5WD EOF.KPG%QNQTA%NKEM)
'6JKU GZCORNG WUGU VJG /KETQUQHV EQNQT FKCNQI DQZ VQ
'EJCPIG C UGNGEVGF CPPQVCVKQP OCTMNU NKPG EQNQT
&KO .KPG%QNQT #U 1.'A%1.14
'&GVGTOKPG VJG EWTTGPV EQNQT QH VJG UGNGEVGF CPPQVCVKQP
'OCTM CPF KPKV VJG FKCNQI DQZ EQNQT RTQRGTV[ VQ VJCV EQNQT
.KPG%QNQT - +OI'FKV1OetSeectedAnnotat1onL1neOoor
%QOOQP&KCNQI1%QNQT - .KPG%QNQT
%QOOQP&KCNQI1(NCIU - EFN%%4)$+PKV
%QOOQP&KCNQI15JQY%QNQT
+OI'FKV15GV5GNGEVGF#PPQVCVKQP.KPG%QNQT %QOOQP&KCNQI1%QNQT
'PF 5WD
Get Select edAnnot at ionLineColor Example VC++
This example uses the GetSelectedAnnotationLineColor method to deter mine 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.
XQKF %+OI'FKV&NI1P.KPGEQNQT)
]
// 6JKU GZCORNG WUGU VJG /KETQUQHV EQNQT FKCNQI DQZ VQ
// EJCPIG C UGNGEVGF CPPQVCVKQP OCTMNU NKPG EQNQT
NQPI .KPG%QNQT
// &GVGTOKPG VJG EWTTGPV EQNQT QH VJG UGNGEVGF CPPQVCVKQP
// OCTM CPF KPKV VJG FKCNQI DQZ EQNQT RTQRGTV[ VQ VJCV EQNQT
.KPG%QNQT - +OI'FKV1OetSeectedAnnotat1onL1neOoor)
%QOOQP&KCNQI15GV%QNQT.KPG%QNQT)
%QOOQP&KCNQI15GV(NCIU1) // EFN%%4)$+PKV
%QOOQP&KCNQI15JQY%QNQT)
+OI'FKV15GV5GNGEVGF#PPQVCVKQP.KPG%QNQT%QOOQP&KCNQI1)GV%QNQT))
_
Chapt er 7
420
Get Select edAnnot at ionLineSt yle Met hod
Descript ion R eturns the line style used in a selected line or Hollow R ectangle annotation.
Available Wit h
Applies To Image Edit control.
Usage object.GetSelectedAnnotationLineStyle
Argument s None.
Ret urns Integer (enumerated).
Remarks The GetSelectedAnnotationLineStyle method is valid only at run- time. It is used with
annotations of the following types:
s
Freehand Line
s
Hollow R ectangle
s
Straight Line
See Also AnnotationLineStyle property, AnnotationType property, SetSelectedAnnotationLineStyle
method.
Get Select edAnnot at ionLineSt yle Example VB
This example uses the GetSelectedAnnotationLineStyle method to deter mine whether a
selected line or hollow rectangle annotation is opaque or transparent, and the
SetSelectedAnnotationLineStyle method to change the line style.
2TKXCVG 5WD (QTOA.QCF)
'6JKU GZCORNG FGVGTOKPGU YJGVJGT C UGNGEVGF CPPQVCVKQP KOCIG QT
'HKNNGF TGEVCPING KU QRCSWG QT VTCPURCTGPV CPF CNNQYU VJCV
'CVVTKDWVG VQ DG EJCPIGF 6JG HQTO WUGF JCU QRVKQP DWVVQPU
'QPG NCDGNGF 1RCSWG CPF QPG NCDGNGF 6TCPURCTGPV
&KO .KPG5V[NG #U #PPQVCVKQP5V[NG%QPUVCPVU
'&GVGTOKPG KH VJG UGNGEVGF NKPG CPPQVCVKQP KU QRCSWG QT VTCPURCTGPV CPF
'UGV VJG EQTTGURQPFKPI QRVKQP DWVVQP QP VJG HQTO
.KPG5V[NG - HTO/CKP+OI'FKV1OetSeectedAnnotat1onL1neStye
+H .KPG5V[NG - YK1RCSWG 6JGP
QRV1RCSWG8CNWG - 6TWG
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Cont ant Value Descript ion
wiTransparent 0 Transparent
wiOpaque 1 Opaque
Get Select edAnnot at ionLineSt yle M et hod
421
'NUG
QRV6TCPURCTGPV8CNWG - 6TWG
'PF +H
HTO.KPG5V[NG5JQY
'PF 5WD
2TKXCVG 5WD QRV1RCSWGA%NKEM)
'+H VJG WUGT ENKEMU QP VJG 1RCSWG QRVKQP DWVVQP VJG CPPQVCVKQP KU
'EJCPIGF VQ DG QRCSWG
HTO/CKP+OI'FKV15GV5GNGEVGF#PPQVCVKQP.KPG5V[NG YK1RCSWG
'PF 5WD
2TKXCVG 5WD QRV6TCPURCTGPVA%NKEM)
'+H VJG WUGT ENKEMU QP VJG 6TCPURCTGPV QRVKQP DWVVQP VJG CPPQVCVKQP
'KU EJCPIGF VQ DG VTCPURCTGPV
HTO/CKP+OI'FKV15GV5GNGEVGF#PPQVCVKQP.KPG5V[NG YK6TCPURCTGPV
'PF 5WD
Get Select edAnnot at ionLineSt yle Example VC++
This example uses the GetSelectedAnnotationLineStyle method to deter mine whether a
selected line or hollow rectangle annotation is opaque or transparent, and the
SetSelectedAnnotationLineStyle method to change the line style.
XQKF %.KPG5V[NGU1P1-)
]
KHOA6TCPURCTGPV)GV%JGEM) oo OAD.KPG5V[NG)
OAR2CTGPV+OI'FKV15GV5GNGEVGF#PPQVCVKQP.KPG5V[NG0)
GNUG
OAR2CTGPV+OI'FKV15GV5GNGEVGF#PPQVCVKQP.KPG5V[NG1)
KHOA6TCPURCTGPV)GV%JGEM) oo !OAD.KPG5V[NG)
OAR2CTGPV+OI'FKV15GV5GNGEVGF#PPQVCVKQP(KNN5V[NG0)
GNUG
OAR2CTGPV+OI'FKV15GV5GNGEVGF#PPQVCVKQP(KNN5V[NG1)
%&KCNQI1P1-)
_
$11. %.KPG5V[NGU1P+PKV&KCNQI)
]
%&KCNQI1P+PKV&KCNQI)
UJQTV .KPG5V[NG
// &GVGTOKPG KH VJG UGNGEVGF NKPG QT HKNN CPPQVCVKQP KU QRCSWG QT
// VTCPURCTGPV CPF UGV VJG EQTTGURQPFKPI QRVKQP DWVVQP QP VJG HQTO
KHOAD.KPG5V[NG)
.KPG5V[NG - OAR2CTGPV+OI'FKV1OetSeectedAnnotat1onL1neStye)
GNUG
]
.KPG5V[NG - OAR2CTGPV+OI'FKV1)GV5GNGEVGF#PPQVCVKQP(KNN5V[NG)
5GV9KPFQY6GZV(KNN 5V[NGU)
_
KH.KPG5V[NG -- 1) // YK1RCSWG
]
OA1RCSWG5GV%JGEM1)
OA6TCPURCTGPV5GV%JGEM0)
_
Chapt er 7
422
GNUG
]
OA1RCSWG5GV%JGEM0)
OA6TCPURCTGPV5GV%JGEM1)
_
TGVWTP 647' // TGVWTP 647' WPNGUU [QW UGV VJG HQEWU VQ C EQPVTQN
// ':%'26+10 1%: 2TQRGTV[ 2CIGU UJQWNF TGVWTP (#.5'
_
Get Select edAnnot at ionLineWidt h Met hod
Descript ion R eturns the line width in pixels used in a selected line or Hollow R ectangle annotation.
Available Wit h
Applies To Image Edit control.
Usage object.GetSelectedAnnotationLineWidth
Argument s None.
Ret urns Integer.
Remarks The GetSelectedAnnotationLineWidth method is valid only at run- time. It is used with
annotations of the following types:
s
Freehand Line
s
Hollow R ectangle
s
Straight Line
See Also AnnotationLineWidth property, AnnotationType property,
SetSelectedAnnotationLineWidth method.
Get Select edAnnot at ionLineWidt h Example VB
This example uses the GetSelectedAnnotationLineWidth method to deter mine the width
of a selected line annotation. It then updates a text box and a Line control to illustrate the
width.
2TKXCVG 5WD (QTOA.QCF)
'(KTUV FGVGTOKPG CP CPPQVCVKQP NKPGNU YKFVJ CPF EQNQT 6JKU KU VJGP
'WUGF KP C FKCNQI DQZ YJKEJ EQPVCKPU C UCORNG NKPG YKVJ C VGZV DQZ VQ
'KPFKECVG VJG NKPG YKFVJ KP RKZGNU) CPF CP WRFQYP EQPVTQN NKPMGF VQ VJG
'VGZV DQZ VQ CNNQY VJG YKFVJ VQ DG UETQNNGF WR CPF FQYP 6JG WUGT ECP
'EJCPIG VJG YKFVJ QH VJG NKPG KP VJG FKCNQI DQZ KP QTFGT VQ EJCPIG VJG
'YKFVJ QH VJG CPPQVCVKQP
&KO KPV.KPG9KFVJ #U +PVGIGT
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Get Select edAnnot at i onLineWidt h M et hod
423
&KO .KPG%QNQT #U 1.'A%1.14
')GV VJG NKPG YKFVJ CPF EQNQT VQ KPKVKCNK\G VJG FKCNQI DQZ
KPV.KPG9KFVJ - HTO/CKP+OI'FKV1OetSeectedAnnotat1onL1neW1dth
.KPG%QNQT - HTO/CKP+OI'FKV1)GV5GNGEVGF#PPQVCVKQP.KPG%QNQT
'5GV EWTTGPV NKPG YKFVJ KP VJG VGZV DQZ VQ VJG YKFVJ QH VJG RKZGN YKFVJ
'QH VJG CPPQVCVKQP OCTM
VZV9KFVJ6GZV - 5VTKPV.KPG9KFVJ)
'5GV VJG XCNWG QH VJG 7R&QYP EQPVTQN VQ VJG EWTTGPV NKPG YKFVJ
7R&QYP18CNWG - KPV.KPG9KFVJ
'5GV VJG YKFVJ QH VJG UCORNG NKPG KP VJG FKCNQI DQZ
.KPG1$QTFGT9KFVJ - KPV.KPG9KFVJ
'5GV VJG EQNQT QH VJG UCORNG NKPG
.KPG1$QTFGT%QNQT - .KPG%QNQT
'&KURNC[ VJG FKCNQI DQZ
HTO.KPG9KFVJ5JQY
'PF 5WD
Get Select edAnnot at ionLineWidt h Example VC++
This example uses the GetSelectedAnnotationLineWidth method to deter mine 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.
$11. %.KPG9KFVJ1P+PKV&KCNQI)
]
%&KCNQI1P+PKV&KCNQI)
KPV KPV.KPG9KFVJ
NQPI .KPG%QNQT
// )GV VJG NKPG YKFVJ CPF EQNQT VQ KPKVKCNK\G VJG FKCNQI DQZ
KPV.KPG9KFVJ - OAR2CTGPV+OI'FKV1OetSeectedAnnotat1onL1neW1dth)
.KPG%QNQT - OAR2CTGPV+OI'FKV1)GV5GNGEVGF#PPQVCVKQP.KPG%QNQT)
// 5GV VJG EWTTGPV NKPG YKFVJ KP VJG VGZV DQZ
EJCT V.KPG9KFVJ =b?
AKVQCKPV.KPG9KFVJV.KPG9KFVJ10)
OA'FKV5GV9KPFQY6GZVV.KPG9KFVJ)
TGVWTP 647' // TGVWTP 647' WPNGUU [QW UGV VJG HQEWU VQ C EQPVTQN
// ':%'26+10 1%: 2TQRGTV[ 2CIGU UJQWNF TGVWTP (#.5'
_
XQKF %.KPG9KFVJ1P1-)
]
%5VTKPI V.KPG9KFVJ
KPV K.KPG9KFVJ
OA'FKV)GV9KPFQY6GZVV.KPG9KFVJ)
K.KPG9KFVJ - CVQKV.KPG9KFVJ)
OAR2CTGPV+OI'FKV15GV5GNGEVGF#PPQVCVKQP.KPG9KFVJK.KPG9KFVJ)
%&KCNQI1P1-)
_
Chapt er 7
424
Get Select edAnnot at ionOcrType Met hod
Descript ion R eturns the type of OCR zone drawn on an image page.
Available Wit h
Applies To Image Edit control.
Usage object.GetSelectedAnnotationOcrType
Argument s None.
Ret urns Integer (enumerated)
Remarks The GetSelectedAnnotationOcrType method is valid only at run- time. An OCR zone
must be selected pr ior to invoking this method.
Applies to the OCR Zones annotation type only.
See Also AnnotationOcrType property, AnnotationType property, ImageOCR control,
OcrZoneVisibility property, SelectFirstOcrZone method, SelectNextOcrZone method,
SetSelectedAnnotationOcrType method.
Get Select edAnnot at ionOcrType Example VB
This example uses the GetSelectedAnnotationOcrType method to deter mine whether a
selected OCR Zone annotation is a Picture zone or a Text zone. It then updates the
appropr iate option button on the for m 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 for m. It uses the
SetSelectedAnnotationOcrType method to set the OCR type.
2TKXCVG 5WD (QTOA.QCF)
'6JKU GZCORNG FGVGTOKPGU YJGVJGT C UGNGEVGF 1%4 TGEQIPKVKQP \QPG KU
'FGHKPGF CU C 2KEVWTG <QPG QT C 6GZV <QPG CPF UJQYU C FKCNQI DQZ VQ
'CNNQY VJG WUGT VQ EJCPIG VJG 1%4 \QPG V[RG (QTO WUGF JCU
'QRVKQP DWVVQPU NCDGNGF 2KEVWTG <QPG CPF 6GZV <QPG
&KO 1%46[RG #U #PPQVCVKQP1ET6[RG%QPUVCPVU
'&GVGTOKPG KH VJG UGNGEVGF 1%4 CPPQVCVKQP OCTM KU C 6GZV <QPG QT C
'2KEVWTG <QPG CPF UGV VJG EQTTGURQPFKPI QRVKQP DWVVQP QP VJG HQTO
1%46[RG - HTO/CKP+OI'FKV1OetSeectedAnnotat1onOcrTye
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Const ant Value Descript ion
wiOcrTypeText 0 OCR Text zone
wiOcrTypePicture 1 OCR Picture zone
Get Select edAnnot at ionOcrType M et hod
425
+H 1%46[RG - YK1ET6[RG6GZV 6JGP
QRV6GZV<QPG8CNWG - 6TWG
'NUG
QRV2KEVWTG<QPG8CNWG - 6TWG
'PF +H
HTO1%46[RG5JQY
'PF 5WD
2TKXCVG 5WD QRV2KEVWTG<QPGA%NKEM)
'+H VJG WUGT ENKEMU QP VJG 2KEVWTG <QPG QRVKQP DWVVQP VJG 1%4
'<QPG V[RG KU EJCPIGF VQ C 2KEVWTG <QPG
HTO/CKP+OI'FKV15GV5GNGEVGF#PPQVCVKQP1ET6[RG YK1ET6[RG2KEVWTG
'PF 5WD
2TKXCVG 5WD QRV6GZV<QPGA%NKEM)
'+H VJG WUGT ENKEMU QP VJG 6GZV <QPG QRVKQP DWVVQP VJG 1%4
'<QPG V[RG KU EJCPIGF VQ C 6GZV <QPG
HTO/CKP+OI'FKV15GV5GNGEVGF#PPQVCVKQP1ET6[RG YK1ET6[RG6GZV
'PF 5WD
Get Select edAnnot at ionOcrType Example VC++
This example uses the GetSelectedAnnotationOcrType method to deter mine whether a
selected OCR Zone annotation is a Picture zone or a Text zone. It then updates the
appropr iate 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.
XQKF %1%4<QPGU1P1-)
]
KHOA6GZV<QPG)GV%JGEM))
OAR2CTGPV+OI'FKV15GV5GNGEVGF#PPQVCVKQP1ET6[RG0)
GNUG
OAR2CTGPV+OI'FKV15GV5GNGEVGF#PPQVCVKQP1ET6[RG1)
%&KCNQI1P1-)
_
$11. %1%4<QPGU1P+PKV&KCNQI)
]
%&KCNQI1P+PKV&KCNQI)
UJQTV 1%46[RG
// &GVGTOKPG KH VJG UGNGEVGF 1%4 CPPQVCVKQP OCTM KU C 6GZV <QPG QT C
// 2KEVWTG <QPG CPF UGV VJG EQTTGURQPFKPI QRVKQP DWVVQP QP VJG HQTO
1%46[RG - OAR2CTGPV+OI'FKV1OetSeectedAnnotat1onOcrTye)
KH1%46[RG -- 0) // YK1ET6[RG6GZV
]
OA6GZV<QPG5GV%JGEM1)
OA2KEVWTG<QPG5GV%JGEM0)
_
GNUG
]
OA6GZV<QPG5GV%JGEM0)
OA2KEVWTG<QPG5GV%JGEM1)
Chapt er 7
426
_
TGVWTP 647' // TGVWTP 647' WPNGUU [QW UGV VJG HQEWU VQ C EQPVTQN
// ':%'26+10 1%: 2TQRGTV[ 2CIGU UJQWNF TGVWTP (#.5'
_
Get Version Met hod
Descript ion R eturns the Product Version number of the Imaging control (for example, 1.09.1403).
Available Wit h
The GetVersion method of the Image Annotation Tool Button control is available in all
versions of Imaging for Windows.
Applies To Image Edit, Image Annotation, Image Admin, Image OCR , Image Scan, and Image
Thumbnail controls.
Usage object.GetVersion
Argument s None.
Ret urns Str ing.
Remarks None.
HideAnnot at ionGroup Met hod
Descript ion Hides an annotation group.
Available Wit h
Applies To Image Edit control.
Usage object.HideAnnotationGroup [GroupName]
Argument s The HideAnnotationGroup method has the following argument:
Imaging for Windows Professional Edition V2.0
Imaging for Windows Professional Edition V1.0 and V1.1
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
GroupName Str ing The name of the annotation group to hide
HideAnnot at ionGroup M et hod
427
Ret urns None.
Remarks The Display method must be invoked pr ior 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.
See Also Display method, GetAnnotationGroup method, GetCurrentAnnotationGroup method,
ImageModified property, OcrZoneVisibility property, SetCur rentAnnotationGroup
method, ShowAnnotationGroup method.
HideAnnot at ionGroup Example 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.
2TKXCVG 5WD EOF*KFG)TQWRA%NKEM)
&KO UVT%WT)TQWR #U 5VTKPI
'&GVGTOKPG YJKEJ ITQWR VJG WUGT UGNGEVGF HTQO VJG NKUVDQZ
UVT%WT)TQWR - #PPQ)TQWRU.KUV#PPQ)TQWRU.KUV+PFGZ)
(QTO1+OI'FKV1H1deAnnotat1onOrou UVT%WT)TQWR)
'%CNN TGHTGUJ VQ TGRCKPV YKVJ VJG ITQWR JKFFGP
(QTO1+OI'FKV14GHTGUJ
'PF 5WD
HideAnnot at ionGroup Example 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.
XQKF %(TO)TQWR1P*KFG)TQWR)
]
// 6JKU CNNQYU C WUGT VQ UGNGEV C )TQWR HTQO C NKUV CPF JKFG KV 5GG
// )GV#PPQVCVKQP)TQWR OGVJQF GZCORNG HQT JQY VQ NKUV CPPQVCVKQP ITQWRU
%5VTKPI U\%WT)TQWR
// )GV VJG PCOG QH VJG ITQWR VJG WUGT ENKEMGF QP KP VJG NKUVDQZ
OA)TQWR.KUV)GV6GZVOA)TQWR.KUV)GV%WT5GN)U\%WT)TQWR)
KHR2CTGPV&NI)
]
8#4+#06 X%WT)TQWR 8A86oX%WT)TQWR) - 86A$564 8A$564oX%WT)TQWR) -
U\%WT)TQWR#NNQE5[U5VTKPI)
R2CTGPV&NI+OI'FKV1H1deAnnotat1onOrou X%WT)TQWR)
// %CNN TGHTGUJ VQ TGRCKPV YKVJ VJG ITQWR JKFFGP
R2CTGPV&NI+OI'FKV14GHTGUJ)
_
_
Not e: OCR Zone annot at ions are available w it h Imaging f or Window s Prof essional Edit ion
only.
Chapt er 7
428
HideAnnot at ionToolPalet t e Met hod
Descript ion Hides the Annotation Tool Palette (see page 533).
Available Wit h
Applies To Image Edit control.
Usage object.HideAnnotationToolPalette
Argument s None.
Ret urns None.
Remarks The ShowAnnotationToolPalette method must be invoked pr ior to calling this method.
See Also ShowAnnotationToolPalette method, ToolPaletteHidden event.
Invert Met hod
Descript ion Inverts the image, making it appear like a photographic negative.
Available Wit h
Applies To Image Edit control.
Usage object.Invert
Argument s None.
Ret urns None.
Remarks The Display method must be invoked pr ior 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.
See Also Display method, ImageModified property, Save method, SaveAs method, SavePage
method.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Imaging for Windows Professional Edition V2.0
Imaging for Windows Professional Edition V1.0 and V1.1
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
IsClipboardDat aAvailable M et hod
429
IsClipboardDat aAvailable Met hod
Descript ion Deter mines whether image or annotation data is present on the Clipboard.
Available Wit h
Applies To Image Edit control.
Usage object.IsClipboardDataAvailable
Argument s None.
Ret urns Boolean.
Remarks Use the IsClipboardDataAvailable method to deter mine whether the ClipboardPaste
method can be invoked.
See Also ClipboardCopy method, ClipboardCut method, ClipboardPaste method.
IsClipboardDat aAvailable Example VB
This example uses the IsClipboardDataAvailable method to deter mine whether there is data
on the Clipboard. If True, it enables the Paste item on the Edit menu.
2TKXCVG 5WD OPW'FKVA%NKEM)
'6JKU GZCORNG WUGU VJG +U%NKRDQCTF&CVC#XCKNCDNG OGVJQF VQ FGVGTOKPG
'YJGVJGT VJGTG KU FCVC QP VJG ENKRDQCTF CPF KH UQ YKNN GPCDNG VJG
'2CUVG OGPW KVGO QP VJG 'FKV OGPW
&KO DNP%NKR&CVC #U $QQNGCP
DNP%NKR&CVC - +OI'FKV1IsO1boardDataAva1abe
+H DNP%NKR&CVC 6JGP
OPW'FKV2CUVG'PCDNGF - 6TWG
'NUG
OPW'FKV2CUVG'PCDNGF - (CNUG
'PF +H
'PF 5WD
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Value Descript ion
True Image or annotation data is on the clipboard.
False Image or annotation data is not on the clipboard.
Chapt er 7
430
IsClipboardDat aAvailable Example VC++
This example uses the IsClipboardDataAvailable method to deter mine whether there is data
on the Clipboard. If True, it enables the Paste item on the Edit menu.
XQKF %+OI'FKV&NI1P'PCDNGRCUVG)
]
// 6JKU GZCORNG WUGU VJG +U%NKRDQCTF&CVC#XCKNCDNG OGVJQF VQ FGVGTOKPG
// YJGVJGT VQ GPCDNG VJG 2CUVG OGPW KVGO QP VJG 'FKV OGPW
KPV PNP%NKR&CVC
PNP%NKR&CVC - +OI'FKV1IsO1boardDataAva1abe)
KHPNP%NKR&CVC)
#HZ/GUUCIG$QZ2CUVG 'PCDNGF)
GNUG
#HZ/GUUCIG$QZ2CUVG &KUCDNGF)
_
LoadAnnot at ions Met hod
Descript ion Loads annotations from a file and places them on the image currently being displayed.
Available Wit h
Applies To Image Edit control.
Usage object.LoadAnnotations FileName,StartPage,EndPage,Flags
Argument s The LoadAnnotations method has the following arguments:
Imaging for Windows Professional Edition V2.0
Imaging for Windows Professional Edition V1.0 and V1.1
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
FileName Str ing The fully- qualified name (see page 535) of the file con-
taining 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 cur rently.
LoadAnnot at ions M et hod
431
Ret urns Long.
Remarks The Display method must be invoked pr ior to calling this method.
To support StartPage and EndPage parameter entr ies that span more than one page, the
image file on display must be a multipage image file type (AWD or TIFF).
Not es Regarding t he St art Page and EndPage Paramet ers
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 perfor m 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.
See Also Display method, Save method, SaveAnnotations method, SaveAs method, SavePage
method.
LoadAnnot at ions Example VB
This example uses the LoadAnnotations method to load annotations from a file that is
separate from the image file.
2TKXCVG 5WD EOF.QCF#PPQUA%NKEM)
'.QCF CPPQVCVKQPU YJKEJ YGTG RTGXKQWUN[ UCXGF VQ C PGY KOCIG HKNG ;QW
'EQWNF ETGCVG C VGORNCVG HQT 1%4 TGEQIPKVKQP \QPGU WUKPI VJGUG OGVJQFU
'7UGF KP EQPLWPEVKQP YKVJ VJG 5CXG#PPQVCVKQPU OGVJQF .QCF CPPQVCVKQPU
'HTQO HKNG QET\QPGUCPQ QPVQ RCIG 1 QH VJG EWTTGPVN[ FKURNC[GF KOCIG
+OI'FKV1LoadAnnotat1ons &>QET\QPGUCPQ 1 1 0
'PF 5WD
LoadAnnot at ions Example VC++
This example uses the LoadAnnotations method to load annotations from a file that is
separate from the image file.
XQKF %+OI'FKV&NI1P.QCFCPPQVCVKQPU)
]
// .QCF CPPQVCVKQPU YJKEJ YGTG RTGXKQWUN[ UCXGF QP VQ C PGY KOCIG HKNG
// ;QW EQWNF ETGCVG C VGORNCVG HQT 1%4 TGEQIPKVKQP \QPGU WUKPI VJGUG
// OGVJQFU 7UGF KP EQPLWPEVKQP YKVJ VJG 5CXG#PPQVCVKQPU OGVJQF
// .QCF CPPQVCVKQPU HTQO HKNG QET\QPGUCPQ QPVQ RCIG 1 QH VJG VJG
// EWTTGPVN[ FKURNC[GF KOCIG
+OI'FKV1LoadAnnotat1ons E>>UCXGOCTMCPQ 1 1 0)

_
Value Descript ion
0 Failed
1 Success
Chapt er 7
432
ManualDeSkew Met hod
Descript ion Displays the Straighten Page dialog box (see page 523), which per mits end users to
manually deskew (straighten) the displayed image.
Available Wit h
Applies To Image Edit control.
Usage object.ManualDeSkew
Argument s None.
Ret urns None.
Remarks The Display method must be invoked pr ior 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.
See Also AutoDeskew method, Display method, ImageModified property, Page property, Save
method, SaveAs method, SavePage method, StraightenPage event.
Print Image Met hod
Descript ion Pr ints the image specified in the Image property.
Available Wit h
Applies To Image Edit control.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Print Image M et hod
433
Usage object.PrintImage [StartPage,EndPage,OutputFormat,
Annotations,Printer,Driver,PortNumber]
Argument s The Pr intImage method has the following arguments:
The OutputFor mat parameter setting of 3 (Best fit) is available with Imaging for Windows
Professional Edition V2.0 only.
The Pr inter Device Context (HDC) Pr inter parameter setting is available with Imaging for
Windows Professional Edition and Imaging for Windows 98 only.
Out put Format Def ault Set t ings By Product Version
Ret urns None.
Paramet er Dat a Type Set t ing
StartPage Long The starting page in a range of pages to be pr inted.
EndPage Long The ending page in a range of pages to be pr inted.
OutputFor mat Integer
(enumerated)
The output for mat to be used:
0 Pixel to pixel
1 Inch to inch
2 Fit to page
3 Best fit
Annotations Boolean Whether annotations and OCR zones will be pr inted
with the image:
True Annotations and OCR zones will be pr inted.
False Annotations and OCR zones will not be
pr inted.
Pr inter Str ing or The name of the pr inter.
Long The Pr inter Device Context (HDC) value (C+ + only
see Binder Pr inting on page 434).
Dr iver Str ing The name of the pr inter dr iver (applicable only when
the Pr inter parameter is specified as a str ing).
PortNumber Str ing The name of the output port (applicable only when
the Pr inter parameter is specified as a str ing).
Product Version Def ault Set t ing
Imaging for Windows Professional Edition V1.0 and V1.1
Imaging for Windows 98
1 Inch to inch
Imaging for Windows 95 and NT 4.0 2 Fit to page
Imaging for Windows Professional Edition V2.0 3 Best fit
Chapt er 7
434
Remarks If an image is displayed when the Pr intImage method is invoked, the image is pr inted as it
appears, including any changes made.
If an image is not being displayed, the Pr intImage method pr ints 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 Pr intImage method generates an er ror.
If the StartPage and EndPage parameters are not entered, this method pr ints all pages by
default.
If the Annotations parameter is not specified, all annotations are pr inted by default.
Binder Print ing
This option is intended for use when pr inting images from Microsoft Binder.
If you use a hardware device context (HDC) value to specify the Pr inter parameter, you
must call StartDoc and StartPage pr ior 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 pr ior to calling the Pr intImage method. EndPage and
EndDoc are C+ + calls that must be executed after calling the Pr intImage method. Note
that if you specify an HDC value for the Pr inter parameter, you do not have to specify the
Dr iver and PortNumber parameters.
See Also CheckContinuePr inting event, ContinuePr inting property, Image property,
UseCheckContinuePr inting property.
Print Image Example VB
This example pr ints the image that is cur rently displayed in the Image Edit control. It uses
the Pr int Dialog box in the Admin control to obtain parameters for the pr int- out.
2TKXCVG 5WD EOF2TKPVA%NKEM)
1P 'TTQT )Q6Q 2TKPV'TT
'&KURNC[ CP KOCIG
+OI'FKV1+OCIG - &>KOCIG>4RCIGVKH
+OI'FKV1&KURNC[
'5GV HKNGPCOG VQ DG RTKPVGF VQ VJG FKURNC[GF HKNG +H VJKU RTQRGTV[ KU
'PQV UGV VJG FKCNQI YKNN PQV FKURNC[
+OI#FOKP1+OCIG - +OI'FKV1+OCIG
+OI#FOKP15JQY2TKPV&KCNQI
+OI'FKV1Pr1ntImaqe +OI#FOKP12TKPV5VCTV2CIG +OI#FOKP12TKPV'PF2CIG
+OI#FOKP12TKPV1WVRWV(QTOCV +OI#FOKP12TKPV#PPQVCVKQPU
2TKPV'TT
'7UGT RTGUUGF VJG ECPEGN DWVVQP
'ZKV 5WD
'PF 5WD
Redo M et hod
435
Print Image Example VC++
This example pr ints the image that is cur rently displayed in the Image Edit control. It uses
the Pr int Dialog box in the Admin control to obtain parameters for the pr int- out.
XQKF %+OI'FKV1&NI1P2TKPV)
]
// 6JKU GZCORNG YKNN RTKPV VJG KOCIG VJCV KU FKURNC[GF KP VJG +OCIG 'FKV
// EQPVTQN +V WUGU VJG 2TKPV &KCNQI DQZ KP VJG #FOKP EQPVTQN VQ QDVCKP
// RCTCOGVGTU HQT VJG RTKPV QWVRWV
// &KURNC[ CP KOCIG
+OI'FKV15GV+OCIG&>>KOCIG>>4RCIGVKH)
+OI'FKV1&KURNC[)
// 5GV HKNGPCOG VQ DG RTKPVGF VQ VJG FKURNC[GF HKNG +H VJKU RTQRGTV[ KU
// PQV UGV VJG FKCNQI YKNN PQV FKURNC[
+OI#FOKP15GV+OCIG+OI'FKV1)GV+OCIG))
8#4+#06 XJ9PF 8A86oXJ9PF) - 86A+4
8A+4oXJ9PF) - NQPI)OAJ9PF
+OI#FOKP15JQY2TKPV&KCNQI XJ9PF)
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1Pr1ntImaqeGXV GXV GXV GXV GXV GXV GXV)
_
Redo Met hod
Descript ion R edoes the last imaging operation that was undone by the Undo method.
Available Wit h
Applies To Image Edit control.
Usage object.Redo [Option]
Argument s The R edo method has the following argument:
Ret urns None.
Remarks The Display method must be invoked pr ior to calling this method.
The R edo method requires the successful completion of an undo operation (using the
Undo method). Imaging deletes the redo infor mation when the next imaging operation is
perfor med. If R edo is called before anything is undone, an er ror is generated. Check the
StatusCode property for the error.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 98
Imaging for Windows 95
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
Option Long 0 (default)
Chapt er 7
436
The R edo method modifies the displayed image. The Save, SaveAs, or SavePage method
must be invoked to save the modified image.
Invoking the R edo method sets the ImageModified property to True.
See Also StatusCode property, Display method, ImageModified property, Save method, SaveAs
method, SavePage method, Undo method.
Ref resh Met hod
Descript ion R epaints the contents of the Image Edit control.
Available Wit h
Applies To Image Edit control.
Usage object.Refresh
Argument s None.
Ret urns None.
Remarks The Display method must be invoked pr ior to calling this method.
See Also Display method, DisplayScaleAlgor ithm property, ImagePalette property,
ImageR esolutionX property, ImageR esolutionY property, ScrollBars property,
ScrollPositionX property, ScrollPositionY property, Zoom property (Image Edit).
Ref resh Example 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.
2TKXCVG 5WD EOF*KFG)TQWRA%NKEM)
&KO UVT%WT)TQWR #U 5VTKPI
'&GVGTOKPG YJKEJ ITQWR VJG WUGT UGNGEVGF HTQO VJG NKUVDQZ
UVT%WT)TQWR - #PPQ)TQWRU.KUV#PPQ)TQWRU.KUV+PFGZ)
(QTO1+OI'FKV1*KFG#PPQVCVKQP)TQWR UVT%WT)TQWR)
'%CNN TGHTGUJ VQ TGRCKPV YKVJ VJG ITQWR JKFFGP
(QTO1+OI'FKV1Refresh
'PF 5WD
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
RemoveAl lOCRM arks M et hod
437
Ref resh Example 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.
XQKF %(TO)TQWR1P*KFG)TQWR)
]
// 6JKU YQWNF CNNQY C WUGT VQ UGNGEV C )TQWR HTQO C NKUV CPF JKFG KV 5GG
// GZCORNG HQT )GV#PPQVCVKQP)TQWR OGVJQF HQT JQY VQ NKUV CPPQVCVKQP
// ITQWRU
%5VTKPI U\%WT)TQWR
// )GV VJG PCOG QH VJG ITQWR VJG WUGT ENKEMGF QP KP VJG NKUVDQZ
OA)TQWR.KUV)GV6GZVOA)TQWR.KUV)GV%WT5GN)U\%WT)TQWR)
KHR2CTGPV&NI)
]
8#4+#06 X%WT)TQWR 8A86oX%WT)TQWR) - 86A$564 8A$564oX%WT)TQWR) -
U\%WT)TQWR#NNQE5[U5VTKPI)
R2CTGPV&NI+OI'FKV1*KFG#PPQVCVKQP)TQWR X%WT)TQWR)
// %CNN TGHTGUJ VQ TGRCKPV YKVJ VJG ITQWR JKFFGP
R2CTGPV&NI+OI'FKV1Refresh)
_
_
RemoveAllOCRMarks Met hod
Descript ion R emoves all OCR zones from all image pages in the displayed image document.
Available Wit h
Applies To Image Edit control.
Usage object.RemoveAllOCRMarks
Argument s None.
Ret urns None.
Remarks The Display method must be invoked pr ior to calling this method.
The R emoveAllOCR Marks method saves the displayed image to disk. As such, you cannot
use the Undo method to undo the operation perfor med.
Invoking the R emoveAllOCR Marks method sets the ImageModified property to True.
See Also Display method, Image OCR control, Image property, ImageModified property, Save
method, SaveAs method, SavePage method, Undo method.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Chapt er 7
438
Rot at e Met hod
Descript ion 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 Wit h
Applies To Image Edit control.
Usage object.Rotate Option
Argument s The R otate method has the following argument:
Ret urns None.
Remarks The Display method must be invoked pr ior to calling this method.
This method rotates annotations only when 90, 180, or 270 degrees is specified.
When set to True, the R otate method saves the image document to disk. As such, you
cannot use the Undo method to undo the rotation perfor med.
When set to False, the R otate method modifies the displayed image, but does not save it. In
this case, you can use the Undo method to undo the rotation perfor med. The Save,
SaveAs, or SavePage method must be invoked to save the modified image.
Invoking the R otate method sets the ImageModified property to True.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
Option Boolean True Displays the R otate All Pages dialog box (see
below); rotates all pages in the displayed image document
as directed by the user.
False Displays the R otate Page dialog box (see below);
rotates the displayed image page as directed by the user.
Rot at e M et hod
439
See Also Display method, Flip method, ImageModified property, R otateAll method, R otateLeft
method, R otateR ight method, Save method, SaveAs method, SavePage method, Undo
method.
Rot at e Example VB
This example shows several ways to or ient an image, and then redisplay it.
2TKXCVG 5WD EOF4QVCVGA%NKEM)
+OI'FKV1Rotate 6TWG 'TQVCVG CNN RCIGU
+OI'FKV1Rotate (CNUG 'TQVCVG EWTTGPV RCIG
'/WUV UGV #WVQ4GHTGUJ VQ VTWG QT OWUV ECNN 4GHTGUJ CHVGT VJGUG OGVJQFU
+OI'FKV1#WVQ4GHTGUJ - 6TWG
+OI'FKV14QVCVG.GHV 'FGHCWNVU VQ 90 FGITGGU
+OI'FKV14QVCVG4KIJV 4b 'QRVKQPCNN[ ECP URGEKH[ FGITGGU
+OI'FKV1(NKR '180 FGITGGU
';QW OWUV UCXG VJG KOCIG VQ OCKPVCKP QTKGPVCVKQP
'PF 5WD
Rot at e Example VC++
This example shows several ways to or ient an image, and then redisplay it.
XQKF %+OI'FKV1&NI1P4QVCVG)
]
// #P GZCORNG QH UQOG QH VJG FKHHGTGPV YC[U CP KOCIG EQWNF DG QTKGPVGF
// 6JKU OGVJQF FKURNC[U C FKCNQI DQZ YJKEJ CNNQYU WUGT VQ URGEKH[
// TQVCVKQP D[ FGITGGU 4GRCKPVU VJG UETGGP CWVQOCVKECNN[ 4QVCVG CNN
// YTKVGU VJG HKNG VQ FKUM
+OI'FKV1Rotate647') // TQVCVG CNN RCIGU
+OI'FKV1Rotate(#.5') // TQVCVG EWTTGPV RCIG
// #WVQTGHTGUJ OWUV DG UGV VQ VTWG QT OWUV ECNN 4GHTGUJ CHVGT VJGUG
// OGVJQFU
+OI'FKV15GV#WVQ4GHTGUJ647')
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV14QVCVG.GHVGXV) // FGHCWNVU VQ 90 FGITGGU
8#4+#06 X4QVCVG#OV 8A86oX4QVCVG#OV) - 86A+4 8A+4oX4QVCVG#OV) - 4b
+OI'FKV14QVCVG4KIJVX4QVCVG#OV) // QRVKQPCNN[ ECP URGEKH[ FGITGGU
+OI'FKV1(NKR) // 180 FGITGGU
// ;QW OWUV UCXG VJG KOCIG VQ OCKPVCKP QTKGPVCVKQP
_
Chapt er 7
440
Rot at eAll Met hod
Descript ion R otates all pages within the displayed image document to the degree and in the direction
specified. Then saves the image document.
Available Wit h
Applies To Image Edit control.
Usage object.RotateAll [Degrees]
Argument s The R otateAll method has the following argument:
Ret urns None.
Remarks The Display method must be invoked pr ior to calling this method.
This method saves the image document to disk. As such, you cannot use the Undo method
to undo the rotation perfor med.
This method rotates annotations only when 900, 1800, or 2700 tenths of a degree (90, 180,
or 270 degrees) is specified (positive or negative).
See Also Display method, Flip method, R otate method, R otateLeft method, R otateR ight method,
Undo method.
Rot at eAll Example VB
This example shows several ways to or ient an image, and then redisplay it.
2TKXCVG 5WD EOF4QVCVGA%NKEM)
+OI'FKV14QVCVG 6TWG 'TQVCVG CNN RCIGU
+OI'FKV14QVCVG (CNUG 'TQVCVG EWTTGPV RCIG
'#WVQTGHTGUJ OWUV DG UGV VQ VTWG QT OWUV ECNN 4GHTGUJ CHVGT VJGUG
'OGVJQFU
+OI'FKV1#WVQ4GHTGUJ - 6TWG
+OI'FKV14QVCVG.GHV 'FGHCWNVU VQ 90 FGITGGU
+OI'FKV14QVCVG4KIJV 4b 'QRVKQPCNN[ ECP URGEKH[ FGITGGU
+OI'FKV1RotateA 900 'TQVCVG CNN RCIGU 90 FGITGGU NGHV
Imaging for Windows Professional Edition V2.0
Imaging for Windows Professional Edition V1.0 and V1.1
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
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, nega-
tive values for clockwise rotation.
Rot at eLef t M et hod
441
+OI'FKV1(NKR '180 FGITGGU
';QW OWUV UCXG VJG KOCIG VQ OCKPVCKP QTKGPVCVKQP
'PF 5WD
Rot at eAll Example VC++
This example shows several ways to or ient an image, and then redisplay it.
XQKF %+OI'FKV1&NI1P4QVCVG)
]
// #P GZCORNG QH UQOG QH VJG FKHHGTGPV YC[U CP KOCIG EQWNF DG QTKGPVGF
// 6JKU OGVJQF FKURNC[U C FKCNQI DQZ YJKEJ CNNQYU WUGT VQ URGEKH[
// TQVCVKQP D[ FGITGGU 4GRCKPVU VJG UETGGP CWVQOCVKECNN[ 4QVCVG CNN
// YTKVGU VJG HKNG VQ FKUM
+OI'FKV14QVCVG647') // TQVCVG CNN RCIGU
+OI'FKV14QVCVG(#.5') // TQVCVG EWTTGPV RCIG
// #WVQTGHTGUJ OWUV DG UGV VQ VTWG QT OWUV ECNN 4GHTGUJ CHVGT VJGUG
// OGVJQFU
+OI'FKV15GV#WVQ4GHTGUJ647')
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV14QVCVG.GHVGXV) // FGHCWNVU VQ 90 FGITGGU
8#4+#06 X4QVCVG#OV 8A86oX4QVCVG#OV) - 86A+4 8A+4oX4QVCVG#OV) - 4b
+OI'FKV14QVCVG4KIJVX4QVCVG#OV) // QRVKQPCNN[ ECP URGEKH[ FGITGGU
8#4+#06 X4QVCVG#NN#OV 8A86oX4QVCVG#NN#OV) - 86A+4
8A+4oX4QVCVG#NN#OV) - 900
+OI'FKV1RotateAX4QVCVG#NN#OV) //TQVCVG CNN RCIGU 90 FGITGGU NGHV
+OI'FKV1(NKR) // 180 FGITGGU
// ;QW OWUV UCXG VJG KOCIG VQ OCKPVCKP QTKGPVCVKQP
_
Rot at eLef t Met hod
Descript ion R otates the displayed image 90 degrees to the left, or to the degree specified.
Available Wit h
Applies To Image Edit control.
Usage object.RotateLeft [Degrees]
Argument s The R otateLeft method has the following argument:
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
Degrees Long Amount to rotate the displayed image in tenths of a degree
(for example, enter 450 to rotate the image 45 degrees).
Chapt er 7
442
Ret urns None.
Remarks The Display method must be invoked pr ior 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 R otateLeft method modifies the displayed image. The Save, SaveAs, or
SavePage method must be invoked to save the modified image.
Invoking the R otateLeft method sets the ImageModified property to True.
See Also Display method, Flip method, ImageModified property, R otate method, R otateAll
method, R otateR ight method, Save method, SaveAs method, SavePage method.
Rot at eLef t Example VB
This example shows several ways to or ient an image, and then redisplay it.
2TKXCVG 5WD EOF4QVCVGA%NKEM)
+OI'FKV14QVCVG 6TWG 'TQVCVG CNN RCIGU
+OI'FKV14QVCVG (CNUG 'TQVCVG EWTTGPV RCIG
'#WVQTGHTGUJ OWUV DG UGV VQ VTWG QT OWUV ECNN 4GHTGUJ CHVGT VJGUG
'OGVJQFU
+OI'FKV1#WVQ4GHTGUJ - 6TWG
+OI'FKV1RotateLeft 'FGHCWNVU VQ 90 FGITGGU
+OI'FKV14QVCVG4KIJV 4b 'QRVKQPCNN[ ECP URGEKH[ FGITGGU
+OI'FKV1(NKR '180 FGITGGU
';QW OWUV UCXG VJG KOCIG VQ OCKPVCKP QTKGPVCVKQP
'PF 5WD
Rot at eLef t Example VC++
This example shows several ways to or ient an image, and then redisplay it.
XQKF %+OI'FKV1&NI1P4QVCVG)
]
// #P GZCORNG QH UQOG QH VJG FKHHGTGPV YC[U CP KOCIG EQWNF DG QTKGPVGF
// 6JKU OGVJQF FKURNC[U C FKCNQI DQZ YJKEJ CNNQYU WUGT VQ URGEKH[
// TQVCVKQP D[ FGITGGU 4GRCKPVU VJG UETGGP CWVQOCVKECNN[ 4QVCVG CNN
// YTKVGU VJG HKNG VQ FKUM
+OI'FKV14QVCVG647') // TQVCVG CNN RCIGU
+OI'FKV14QVCVG(#.5') // TQVCVG EWTTGPV RCIG
// #WVQTGHTGUJ OWUV DG UGV VQ VTWG QT OWUV ECNN 4GHTGUJ CHVGT VJGUG
// OGVJQFU
+OI'FKV15GV#WVQ4GHTGUJ647')
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1RotateLeftGXV) // FGHCWNVU VQ 90 FGITGGU
Not e: The Degrees argument is available w it h Imaging f or Window s Prof essional Edit ion
V1.0, V1.1, and V2.0.
It is also available w it h Imaging f or Window s 98, but accept s only t he f ollow ing val-
ues: 900, 1800, and 2700 t ent hs of a degree.
Rot at eRight M et hod
443
8#4+#06 X4QVCVG#OV 8A86oX4QVCVG#OV) - 86A+4 8A+4oX4QVCVG#OV) - 4b
+OI'FKV14QVCVG4KIJVX4QVCVG#OV) // QRVKQPCNN[ ECP URGEKH[ FGITGGU
+OI'FKV1(NKR) // 180 FGITGGU
// ;QW OWUV UCXG VJG KOCIG VQ OCKPVCKP QTKGPVCVKQP
_
Rot at eRight Met hod
Descript ion R otates the displayed image 90 degrees to the r ight, or to the degree specified.
Available Wit h
Applies To Image Edit control.
Usage object.RotateRight [Degrees]
Argument s The R otateR ight method has the following argument:
Ret urns None.
Remarks The Display method must be invoked pr ior 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 R otateR ight method modifies the displayed image. The Save, SaveAs, or
SavePage method must be invoked to save the modified image.
Invoking the R otateR ight method sets the ImageModified property to True.
See Also Display method, Flip method, ImageModified property, R otate method, R otateAll
method, R otateLeft method, Save method, SaveAs method, SavePage method.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
Degrees Long Amount to rotate the displayed image in tenths of a degree
(for example, enter 450 to rotate the image 45 degrees)
Not e: The Degrees argument is available w it h Imaging f or Window s Prof essional Edit ion
V1.0, V1.1, and V2.0.
It is also available w it h Imaging f or Window s 98, but accept s only t he f ollow ing val-
ues: 900, 1800, and 2700 t ent hs of a degree.
Chapt er 7
444
Rot at eRight Example VB
This example shows several ways to or ient an image, and then redisplay it.
2TKXCVG 5WD EOF4QVCVGA%NKEM)
+OI'FKV14QVCVG 6TWG 'TQVCVG CNN RCIGU
+OI'FKV14QVCVG (CNUG 'TQVCVG EWTTGPV RCIG
'#WVQTGHTGUJ OWUV DG UGV VQ VTWG QT OWUV ECNN 4GHTGUJ CHVGT VJGUG
'OGVJQFU
+OI'FKV1#WVQ4GHTGUJ - 6TWG
+OI'FKV14QVCVG.GHV 'FGHCWNVU VQ 90 FGITGGU
+OI'FKV1RotateR1qht 4b 'QRVKQPCNN[ ECP URGEKH[ FGITGGU
+OI'FKV1(NKR '180 FGITGGU
';QW OWUV UCXG VJG KOCIG VQ OCKPVCKP QTKGPVCVKQP
'PF 5WD
Rot at eRight Example VC++
This example shows several ways to or ient an image, and then redisplay it.
XQKF %+OI'FKV1&NI1P4QVCVG)
]
// #P GZCORNG QH UQOG QH VJG FKHHGTGPV YC[U CP KOCIG EQWNF DG QTKGPVGF
// 6JKU OGVJQF FKURNC[U C FKCNQI DQZ YJKEJ CNNQYU WUGT VQ URGEKH[
// TQVCVKQP D[ FGITGGU 4GRCKPVU VJG UETGGP CWVQOCVKECNN[ 4QVCVG CNN
// YTKVGU VJG HKNG VQ FKUM
+OI'FKV14QVCVG647') // TQVCVG CNN RCIGU
+OI'FKV14QVCVG(#.5') // TQVCVG EWTTGPV RCIG
// #WVQTGHTGUJ OWUV DG UGV VQ VTWG QT OWUV ECNN 4GHTGUJ CHVGT VJGUG
// OGVJQFU
+OI'FKV15GV#WVQ4GHTGUJ647')
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV14QVCVG.GHVGXV) // FGHCWNVU VQ 90 FGITGGU
8#4+#06 X4QVCVG#OV 8A86oX4QVCVG#OV) - 86A+4 8A+4oX4QVCVG#OV) - 4b
+OI'FKV1RotateR1qhtX4QVCVG#OV) // QRVKQPCNN[ ECP URGEKH[ FGITGGU
+OI'FKV1(NKR) // 180 FGITGGU
// ;QW OWUV UCXG VJG KOCIG VQ OCKPVCKP QTKGPVCVKQP
_
Save Met hod
Descript ion Saves the displayed image (page) to the or iginal path and file.
Available Wit h
Applies To Image Edit control.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Save M et hod
445
Usage object.Save [SaveAtZoom]
Argument s The Save method has the following argument:
Ret urns None.
Remarks The Display method must be invoked pr ior 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 pr ior to calling the
Save method. The Bur nInAnnotations method bur ns annotations onto an image, causing
them to be per manently incor porated 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 or iginal 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.
See Also Bur nInAnnotations method, Close event, Display method, Image property, ImageModified
property, SaveAs method, SavePage method, Zoom property (Image Edit).
Save Example VB
This example uses the ImageModified property to see if changes were made to an existing
image before per mitting 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.
2TKXCVG 5WD +OI'FKV1A%NQUG)
'6JKU EQFG EQWNF DG WUGF CV VJG VKOG C WUGT CVVGORVU VQ QRGP C PGY HKNG
'QT ENGCT C RTGXKQWUN[ FKURNC[GF KOCIG KP QTFGT VQ RTQORV HQT EJCPIGU VQ
'DG UCXGF KH VJG KOCIG JCU DGGP OQFKHKGF
&KO KPV5CXG+OI #U +PVGIGT
Paramet er Dat a Type Set t ing
SaveAtZoom Boolean Whether the image is saved using the current or or igi-
nal scale percentage value:
True The image is saved using the cur rent scale per-
centage value, as specified in the Zoom property.
False The image is saved using the or iginal scale per-
centage value (Zoom value of 100 percent).
Not e: The Save met hod does not f unct ion w hen a URL has been ent ered int o t he Image
propert y.
Chapt er 7
446
+H +OI'FKV1+OCIG/QFKHKGF - 6TWG 6JGP
KPV5CXG+OI - /UI$QZ&Q [QW YCPV VQ UCXG EJCPIGU! XD;GU0Q%CPEGN
+OCIG JCU DGGP OQFKHKGF)
5GNGEV %CUG KPV5CXG+OI
%CUG XD;GU
'5CXG VJG EJCPIGU
+OI'FKV1Save
'&TQR FQYP VQ VJG 1RGP HKNG EQFG
%CUG XD0Q
'&QP'V UCXG HKNG LWUV FTQR FQYP VQ VJG 1RGP HKNG EQFG
%CUG XD%CPEGN
'7UGT RTGUUGF ECPEGN &QP'V QRGP C HKNG FQP'V UCXG EJCPIGU
'ZKV 5WD
'PF 5GNGEV
'PF +H
'1RGP C PGY HKNG CV VJKU RQKPV
'PF 5WD
Save Example VC++
This example uses the ImageModified property to see if changes were made to an existing
image before per mitting 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.
XQKF %+OI'FKV1&NI1P%NQUG'FKVEVTN1)
]
// 6JKU EQFG EQWNF DG WUGF CV VJG VKOG C WUGT CVVGORVU VQ QRGP C PGY HKNG
// QT ENGCT C RTGXKQWUN[ FKURNC[GF KOCIG KP QTFGT VQ RTQORV HQT EJCPIGU
// VQ DG UCXGF KH VJG KOCIG JCU DGGP OQFKHKGF
KPV K5CXG+OI
KH+OI'FKV1)GV+OCIG/QFKHKGF))
]
K5CXG+OI - #HZ/GUUCIG$QZ&Q [QW YCPV VQ UCXG EJCPIGU!
/$A;'501%#0%'.)
UYKVEJ K5CXG+OI)
]
ECUG +&;'5
// 5CXG VJG EJCPIGU
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV HQT UCXG CV
// \QQO
+OI'FKV1SaveGXV)
DTGCM
// &TQR FQYP VQ VJG 1RGP HKNG EQFG
ECUG +&01
// &QP'V UCXG HKNG LWUV FTQR FQYP VQ VJG 1RGP HKNG EQFG
DTGCM
ECUG +&%#0%'.
// 7UGT RTGUUGF ECPEGN &QP'V QRGP C HKNG FQP'V UCXG EJCPIGU
TGVWTP
SaveAnnot at ions M et hod
447
_
_
// 1RGP C PGY HKNG CV VJKU RQKPV
_
SaveAnnot at ions Met hod
Descript ion Saves the annotations on the image cur rently being displayed to a file.
Available Wit h
Applies To Image Edit control.
Usage object.SaveAnnotations FileName,StartPage,EndPage,Flags
Argument s The SaveAnnotations method has the following arguments:
Ret urns Long.
Remarks The Display method must be invoked pr ior to calling this method.
Imaging for Windows Professional Edition V2.0
Imaging for Windows Professional Edition V1.0 and V1.1
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
FileName Str ing The fully- qualified name (see page 535) of the file to which
the annotations will be saved.
StartPage Long The starting page in the cur rently 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 R etain the annotations in the
currently displayed file.
R EMOVE_ANNOTATIONS R emove the annotations
from the cur rently displayed file that have been saved to the
file specified in the FileName parameter.
Value Descript ion
0 Failed
1 Success
Chapt er 7
448
To support StartPage and EndPage parameter entr ies that span more than one page, the
image file on display must be a multipage image file type (AWD or TIFF).
Not es Regarding t he St art Page and EndPage Paramet ers
If the StartPage and EndPage parameters are set to the first and last pages of the source
image file (cur rently 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 perfor m the best fit it can.
See Also Display method, Image property, LoadAnnotations method.
SaveAnnot at ions Example VB
This example uses the SaveAnnotations method to save annotations to a file that is separate
from the image file.
2TKXCVG 5WD EOF5CXG#PPQUA%NKEM)
'6JKU GZCORNG GPCDNGU CPPQVCVKQPU VQ DG UCXGF VQ C HKNG CPF UVQTGF
'UGRCTCVGN[ HTQO VJG KOCIG HKNG +V KU WUGHWN KH [QW YCPV VQ CPPQVCVG
'KOCIGU DWV PQV OQFKH[ VJG QTKIKPCN HKNG HQT NGICN RWTRQUGU QT KH VJG
'KOCIG KU QP QRVKECN FKUM) 7UG KP EQPLWPEVKQP YKVJ VJG .QCF#PPQVCVKQPU
'OGVJQF 5CXG VJG CPPQVCVKQP OCTMU QP RCIG 1 QH VJG FKURNC[GF HKNG VQ C
'PGY HKNG CPF TGOQXG VJGO HTQO VJG GZKUVKPI HKNG
+OI'FKV1SaveAnnotat1ons &>VGORNCVG>UCXGOCTMCPQ 1 1
4'/18'A#0016#6+105
'PF 5WD
SaveAnnot at ions Example VC++
This example uses the SaveAnnotations method to save annotations to a file that is separate
from the image file.
XQKF %+OI'FKV&NI1P5CXGCPQVCVKQP)
Not e: The SaveAnnot at ions met hod does not f unct ion w hen a URL has been ent ered int o
t he Image propert y.
SaveAs M et hod
449
]
// 6JKU GZCORNG YQWNF GPCDNG CPPQVCVKQPU VQ DG UCXGF VQ C HKNG CPF
// UVQTGF UGRCTCVGN[ HTQO VJG KOCIG HKNG 7UGHWN KH [QW YCPV VQ CPPQVCVG
// KOCIGU DWV PQV OQFKH[ VJG QTKIKPCN HKNG GZ HQT NGICN RWTRQUGU QT
// KH VJG KOCIG KU QP QRVKECN FKUM) 7UG KP EQPLWPEVKQP YKVJ
// .QCF#PPQVCVKQPU
// 5CXG VJG CPPQVCVKQP OCTMU QP RCIG 1 QH VJG FKURNC[GF HKNG VQ C PGY
// HKNG CPF TGOQXG VJGO HTQO VJG GZKUVKPI HKNG
=FGHKPG -''2A#0016#6+105 0
=FGHKPG 4'/18'A#0016#6+105 1
+OI'FKV1SaveAnnotat1ons E>>UCXGOCTMCPQ 1 1
4'/18'A#0016#6+105)
_
SaveAs Met hod
Descript ion Saves the displayed image document file or managed image document using the fully-
qualified name (see page 535) specified.
Available Wit h
Applies To Image Edit control.
Usage object.SaveAs Image[,FileType,PageType,CompressionType,
CompressionInfo,SaveAtZoom]
Argument s The SaveAs method has the following arguments:
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
Image Str ing The fully- qualified name (see page 535) of the image
document being saved.
FileType Integer
(enumerated)
The FileType (see page 530) the image is being
saved as.
PageType Integer
(enumerated)
The PageType (see page 529) the image is being
saved as.
CompressionType Integer
(enumerated)
The CompressionType (see page 531) at which the
image is being saved.
CompressionInfo Integer
(enumerated)
The CompressionInfo setting (see page 531) of the
image being saved.
Chapt er 7
450
Ret urns None.
Remarks The Display method must be invoked pr ior 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 overwr itten.
Upon successful completion of the SaveAs method, the image display window continues to
display the or iginal image; the Image property value remains unchanged. Continuing to
display the or iginal image ensures that the image on display is the same as the image
specified in the Image property. For example, assume the cur rently 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 cur rently being
displayed is saved to the new file. Note that this restr iction does not apply to Imaging 1x
documents. The entire document is saved in the or iginal file type 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 pr ior to calling the SaveAs method. The Bur nInAnnotations method bur ns
annotations onto an image, causing them to be per manently incor porated 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 or iginal FileType
setting of the image as a default. If the or iginal FileType setting cannot be deter mined or is
read- only, and the SaveAs method is saving to a local dr ive or file server, the method throws
an Invalid File For mat er ror. 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
or iginal PageType setting of the image as a default. However, if a FileType is entered, the
SaveAtZoom Boolean Whether the image is being saved using the current
or or iginal scale percentage value:
True The image is being saved using the current
scale percentage value.
False The image is being saved using the or iginal
scale percentage value.
Paramet er Dat a Type Set t ing
SaveAs M et hod
451
SaveAs method uses a PageType default setting that is associated with the FileType setting of
the image. The following list descr ibes the default PageType settings:
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 descr ibes the default CompressionType settings:
To use a PageType setting of 4 (Palettized4), the displayed image must already be a
Palettized4 image.
FileType Set t ing Def ault PageType Set t ing
1 TIFF PageType setting of the displayed image.
2 AWD 1 Black- and- white.
3 BMP PageType setting of the displayed image.
FileType Set t ing PageType Set t ing
Def ault CompressionType
Set t ing
2 AWD 1 Black- and- white 1 No compression
3 BMP 1,5,7 All supported PageTypes 1 No compression
1 TIFF 1 Black- and- white 2 Group3(1D)
1 TIFF 2 Gray4 1 No compression
1 TIFF 3 Gray8 1 No compression
1 TIFF 4 Palettized4 1 No compression
1 TIFF 5 Palettized8 1 No compression
1 TIFF 6 R GB24 1 No compression
Not e: AWD is not available w it h Imaging f or Window s NT 4.0.
Chapt er 7
452
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 descr ibes the default CompressionInfo settings:
When a CompressionInfo value of 0 is entered with the CompressionType parameter set to
1 (no compression), the file is saved using no compression.
When a CompressionInfo value of 0 is entered with the CompressionType parameter set to
a value other than 1, the file is saved using the default CompressionInfo parameter settings
that correspond to the setting of the CompressionType parameter (as explained in the
preceding list).
For example, if the end user specifies a CompressionType value of 1 (no compression) and
then a CompressionInfo value of 0, the file is saved using no compression. If the end user
specifies a CompressionType value of 2 (Group3[1D]) and then a CompressionInfo value of
0, the file is saved using the default CompressionInfo values for Group3(1D):
8 Compressed LTR ,
16 Expand LTR ,
1 EOL, and
4 Prefixed EOL
If the SaveAtZoom parameter is not specified, the image is saved using the original zoom
scale percentage value.
Invoking the SaveAs method sets the ImageModified property to False.
CompressionType Set t ing CompressionInf o Def ault Set t ing
1 No compression 0 No compression
2 Group3(1D) 8 Compressed LTR ,
16 Expand LTR ,
1 EOL, and
4 Prefixed EOL
3 Group3(Modified Huffman) 8 Compressed LTR and
16 Expand LTR
4 PackBits 16 Expand LTR
5 Group4(2D) 2 Packed Lines,
8 Compressed LTR , and
16 Expand LTR
6 JPEG 1024 Medium R esolution/ Medium Quality
9 LZW 0 No compression
SaveAs M et hod
453
Special Not e Regarding Imaging 1.x/3.x Document s 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
appropr iate 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
deter mine 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 deter mine the location
of the file repository.
You cannot save image documents to Imaging 3.x Servers.
Imaging 1.x and 3.x Server access is available with Imaging for Windows Professional
Edition V1.1 and V2.0 only.
Special Not e Regarding URLs
The SaveAs method does not function when a UR L has been entered into the Image
property.
See Also BadDocumentFileType event, Bur nInAnnotations method, Close event, CompressionInfo
property, CompressionType property, Display method, FileStgLoc1x property, FileType
property, ForceFileLinking1x property, Image property, ImageModified property, PageType
property, Save method, SavePage method.
SaveAs Example VB
Example 1
This example shows how to convert an image, burn in annotation marks, and save the
image under a new file name.
2TKXCVG 5WD EOF$WTP+PA%NKEM)
%QPUV #..A/#4-5 - 0
%QPUV 9+0&195A&'(#7.6 -
'+H [QW YKUJ VQ UCXG EQNQT CPPQVCVKQPU QP C DNCEM CPF YJKVG KOCIG [QW
'OWUV HKTUV EQPXGTV VJG KOCIG VQ C PQP DNCEM CPF YJKVG V[RG
+OI'FKV1%QPXGTV2CIG6[RG YK2CIG6[RG2CN8 6TWG
'5CXG CNN OCTMU KP VJGKT QTKIKPCN EQNQTU
+OI'FKV1$WTP+P#PPQVCVKQPU #..A/#4-5 9+0&195A&'(#7.6
'%QNQT $WTP KP CNYC[U EQPXGTVU VQ 4)$4 6Q UCXG FKUM URCEG UCXG VJG
'KOCIG CU CP 8 DKV RCNGVVK\GF KOCIG
+OI'FKV1SaveAs %>KOIUCXG>CPPQVCVGVKH YK(KNG6[RG6+((
YK2CIG6[RG2CN8
'PF 5WD
Chapt er 7
454
Example 2
This example shows the options that are available for file linking/ copying when perfor ming
a SaveAs of an Imaging 1x server document.
2TKXCVG 5WD EOF.KPMA%NKEM)
'#P GZCORNG QH VJG QRVKQPU CXCKNCDNG HQT HKNG NKPMKPI/EQR[KPI YJGP
'RGTHQTOKPI C 5CXG#U QH C 1Z UGTXGT FQEWOGPV 6JGUG HWPEVKQPU TGSWKTG
'DQVJ +OI'FKV CPF #FOKP EQPVTQNU VQ DG WVKNK\GF
'1RVKQP 1
'4GSWGUV HKNGU CUUQEKCVGF YKVJ VJG FQEWOGPV DGKPI UCXGF DG EQRKGF VQ PGY
'HKNGU KP C NQECVKQP VQ DG URGEKHKGF 6JKU KU VJG FGHCWNV CPF KP OQUV
'ECUGU VJG RTGHGTTGF OGVJQF VQ WUG
+OI#FOKP1(QTEG(KNG.KPMKPI1Z - (CNUG
'6Q URGEKH[ NQECVKQP QH VJG PGY HKNGU WUG VJG #FOKP EQPVTQN
'(KNG5VI.QE1Z RTQRGTV[
+OI#FOKP1(KNG5VI.QE1Z - +OCIG//UTXTPCOG>PGYAKOCIGU
'&KURNC[GF 1Z FQEWOGPV KU UCXGF VQ C PGY FQEWOGPV PCOG #UUQEKCVGF KOCIG
'HKNGU YKNN DG EQRKGF VQ PGY TCPFQON[ IGPGTCVGF HKNG PCOGU KP FKTGEVQT[
'URGEKHKGF
+OI'FKV1SaveAs +OCIG//UTXTPCOG>FQEAFD>%#$0#/'>&4#9'4>(1.&'4
>0'9 &1%
'1RVKQP
'4GSWGUV HKNGU CUUQEKCVGF YKVJ VJG FQEWOGPV DGKPI UCXGF TGHGTGPEG VJG
'QTKIKPCN HKNGU 6JKU TGUWNVU KP OWNVKRNG FQEWOGPVU CEEGUUKPI VJG UCOG
'HKNGU EQWNF DG WUGHWN VQ RTGXGPV TGYTKVGU QH QRVKECN FKUM HKNGU
+OI#FOKP1(QTEG(KNG.KPMKPI1Z - 6TWG
'&KURNC[GF 1Z FQEWOGPV KU UCXGF VQ C PGY FQEWOGPV PCOG
'DWV QTKIKPCN KOCIG HKNGU CTG NKPMGF VQ VJG PGY FQEWOGPV
+OI'FKV1SaveAs +OCIG//UTXTPCOG>FQEAFD>%#$0#/'>&4#9'4>(1.&'4
>0'9 &1%
'PF 5WD
SaveAs Example VC++
Example 1
This example shows how to convert an image, burn in annotation marks, and save the
image under a new file name.
XQKF %+OI'FKV1&NI1P$WTPKP)
]
// %QPXGTVU CP KOCIG DWTPU KP CPPQVCVKQP OCTMU CPF UCXGU KV WPFGT C PGY
// HKNG PCOG
=FGHKPG #..A/#4-5 0
=FGHKPG 9+0&195A&'(#7.6
// +H [QW YKUJ VQ UCXG EQNQT CPPQVCVKQPU QP C DNCEM CPF YJKVG KOCIG [QW
// OWUV HKTUV EQPXGTV VJG KOCIG VQ C PQP DNCEM CPF YJKVG V[RG
8#4+#06 X4GRCKPV 8A86oX4GRCKPV) - 86A$11. 8A$11.oX4GRCKPV) - 647'
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1%QPXGTV2CIG6[RGbX4GRCKPV) // YK2CIG6[RG2CN8 6TWG
// 5CXG CNN OCTMU KP VJGKT QTKIKPCN EQNQTU
+OI'FKV1$WTP+P#PPQVCVKQPU#..A/#4-5 9+0&195A&'(#7.6GXV)
SaveAs M et hod
455
// %QNQT $WTP KP CNYC[U EQPXGTVU VQ 4)$4 6Q UCXG FKUM URCEG UCXG VJG
// KOCIG CU CP 8 DKV RCNGVVK\GF KOCIG
8#4+#06 X(KNG6[RG 8A86oX(KNG6[RG) - 86A+ // UGV (KNG6[RG HQT UCXGCU
8#4+#06 X2CIG6[RG 8A86oX2CIG6[RG) - 86A+ // UGV VQ 2CIG6[RG HQT
// UCXGCU
8A+oX(KNG6[RG) - 1
8A+oX2CIG6[RG) - b
// YK(KNG6[RG6+(( YK2CIG6[RG2CN8
+OI'FKV1SaveAs%>>KOIUCXG>>CPPQVCVGVKHX(KNG6[RGX2CIG6[RGGXV
GXVGXV)
_
Example 2
This example shows the options that are available for file linking/ copying when perfor ming
a SaveAs of an Imaging 1x server document.
XQKF %+OI'FKV&NI1P(KNGNKPMKPI)
]
// #P GZCORNG QH VJG QRVKQPU CXCKNCDNG HQT HKNG NKPMKPI/EQR[KPI
// YJGP RGTHQTOKPI C 5CXG#U QH C 1Z UGTXGT FQEWOGPV
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV HQT UCXGCU
// 1RVKQP 1
// 4GSWGUV HKNGU CUUQEKCVGF YKVJ VJG FQEWOGPV DGKPI UCXGF DG EQRKGF VQ
// PGY HKNGU KP C NQECVKQP VQ DG URGEKHKGF 6JKU KU VJG FGHCWNV CPF KP
// OQUV ECUGU VJG RTGHGTTGF OGVJQF VQ WUG
+OI#FOKP15GV(QTEG(KNG.KPMKPI1Z(#.5')
// 6Q URGEKH[ NQECVKQP QH VJG PGY HKNGU WUG VJG #FOKP EQPVTQN
// (KNG5VI.QE1Z RTQRGTV[
+OI#FOKP15GV(KNG5VI.QE1Z+OCIG//UGTXGTPCOG>>PGYAKOCIGU)
// &KURNC[GF 1Z FQEWOGPV KU UCXGF VQ C PGY FQEWOGPV PCOG #UUQEKCVGF
// KOCIG HKNGU YKNN DG EQRKGF VQ PGY TCPFQON[ IGPGTCVGF HKNG PCOGU KP
// FKTGEVQT[ URGEKHKGF
+OI'FKV1SaveAs +OCIG//UGTXGTPCOG>>FQEAFD>>%#$0#/'>>&4#9'4
>>(1.&'4>>0'9 &1%GXVGXVGXVGXVGXV)
// 1RVKQP
// 4GSWGUV HKNGU CUUQEKCVGF YKVJ VJG FQEWOGPV DGKPI UCXGF TGHGTGPEG VJG
// QTKIKPCN HKNGU 6JKU TGUWNVU KP OWNVKRNG FQEWOGPVU CEEGUUKPI VJG UCOG
// HKNGU EQWNF DG WUGHWN VQ RTGXGPV TGYTKVGU QH QRVKECN FKUM HKNGU
+OI#FOKP15GV(QTEG(KNG.KPMKPI1Z647')
// &KURNC[GF 1Z FQEWOGPV KU UCXGF VQ C PGY FQEWOGPV PCOG
// DWV QTKIKPCN KOCIG HKNGU CTG NKPMGF VQ VJG PGY FQEWOGPV
+OI'FKV1SaveAs +OCIG//UGTXGTPCOG>>FQEAFD>>%#$0#/'>>&4#9'4
>>(1.&'4>>0'9 &1% GXVGXVGXVGXVGXV)
_
Chapt er 7
456
SavePage Met hod
Descript ion Saves the displayed image page or the entire image document using the fully- qualified name
(see page 535) specified.
Available Wit h
Applies To Image Edit control.
Usage object.SavePage Image[,FileType,PageType,CompressionType,
CompressionInfo,SaveAtZoom,PageNumber]
Argument s The SavePage method has the following arguments:
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 98
Imaging for Windows 95
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
Image Str ing The fully- qualified name (see page 535) of the image
document being saved.
FileType Integer
(enumerated)
The FileType (see page 530) the image is being saved
as.
PageType Integer
(enumerated)
The PageType (see page 529) the image is being saved
as.
CompressionType Integer
(enumerated)
The CompressionType (see page 531) at which the
image is being saved.
CompressionInfo Integer
(enumerated)
The CompressionInfo (see page 531) setting of the
image being saved.
SaveAtZoom Boolean Whether the image is being saved using the current
or or iginal scale percentage value:
True The image is being saved using the cur rent
scale percentage value.
False The image is being saved using the or iginal
scale percentage value.
PageNumber Long 1 or greater Saves the displayed image page to the
name and PageNumber specified.
- 1 Saves all pages in the displayed image document
to the name specified. The default is - 1.
See Special Note R egarding the PageNumber
Parameter for more infor mation.
SavePage M et hod
457
Remarks None.
Special Not e Regarding t he PageNumber Paramet er
The following table descr ibes what occurs when the SavePage method is used to save image
page(s) to an existing image document.
Remarks The Display method must be invoked pr ior 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 er ror 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 or iginal image; the Image property value remains unchanged. Continuing to
display the or iginal image ensures that the image on display is the same as the image
specified in the Image property. For example, assume the cur rently 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 restr iction does not apply to Imaging 1x
documents. The entire document is saved in the or iginal file type 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 pr ior to calling the SavePage method. The Bur nInAnnotations method bur ns
annotations onto an image, causing them to be per manently incor porated into the image.
In addition, document properties are saved within TIFF images only.
PageNumber
Value
Ent ered
Image Page(s) t o
be Saved by t he
SavePage Met hod
Act ion Perf ormed by t he SavePage
Met hod on t he Exist ing Image Document
1 or greater Image page currently
being displayed
Overwr ites the image page that cor responds to
the value entered in the PageNumber parameter
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 cur-
rently being displayed
Overwr ites the entire image document; no exist-
ing image pages are retained.
Chapt er 7
458
If the FileType parameter is not entered, the SavePage method uses the or iginal FileType
setting of the image as a default. If the or iginal FileType setting cannot be deter mined or is
read- only, and the SavePage method is saving to a local drive or file server, the method
throws an Invalid File For mat 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
or iginal 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 descr ibes the default PageType settings:
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 descr ibes the default CompressionType settings:
To use a PageType setting of 4 (Palettized4), the displayed image must already be a
Palettized4 image.
FileType Set t ing Def ault PageType Set t ing
1 TIFF PageType setting of the displayed image
2 AWD 1 Black- and- white
3 BMP PageType setting of the displayed image
FileType Set t ing PageType Set t ing
Def ault CompressionType
Set t ing
2 AWD 1 Black- and- white 1 No compression
3 BMP 1,5,7 All supported PageTypes 1 No compression
1 TIFF 1 Black- and- white 2 Group3(1D)
1 TIFF 2 Gray4 1 No compression
1 TIFF 3 Gray8 1 No compression
1 TIFF 4 Palettized4 1 No compression
1 TIFF 5 Palettized8 1 No compression
1 TIFF 6 R GB24 1 No compression
Not e: AWD is not available w it h Imaging f or Window s NT 4.0.
SavePage M et hod
459
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 descr ibes the default CompressionInfo settings:
When a CompressionInfo value of 0 is entered with the CompressionType parameter set to
1 (no compression), the file is saved using no compression.
When a CompressionInfo value of 0 is entered with the CompressionType parameter set to
a value other than 1, the file is saved using the default CompressionInfo parameter settings
that correspond to the setting of the CompressionType parameter (as explained in the
preceding list).
For example, if the end user specifies a CompressionType value of 1 (no compression) and
then a CompressionInfo value of 0, the file is saved using no compression. If the end user
specifies a CompressionType value of 2 (Group3[1D]) and then a CompressionInfo value of
0, the file is saved using the default CompressionInfo values for Group3(1D):
8 Compressed LTR ,
16 Expand LTR ,
1 EOL, and
4 Prefixed EOL
If the SaveAtZoom parameter is not specified, the image is saved using the original zoom
scale percentage value.
Invoking the SavePage method sets the ImageModified property to False.
CompressionType Set t ing CompressionInf o Def ault Set t ing
1 No compression 0 No compression
2 Group3(1D) 8 Compressed LTR ,
16 Expand LTR ,
1 EOL, and
4 Prefixed EOL
3 Group3(Modified Huffman) 8 Compressed LTR and
16 Expand LTR
4 PackBits 16 Expand LTR
5 Group4(2D) 2 Packed Lines,
8 Compressed LTR , and
16 Expand LTR
6 JPEG 1024 Medium R esolution/ Medium Quality
9 LZW 0 No compression
Chapt er 7
460
Special Not e Regarding Imaging 1.x/3.x Document s and Files
You cannot save image documents to Imaging 3.x Servers.
Imaging 1.x and 3.x Server access is available with Imaging for Windows Professional
Edition V1.1 and V2.0 only.
Special Not e Regarding URLs
The SavePage method does not function when a UR L has been entered into the Image
property.
See Also BadDocumentFileType event, Bur nInAnnotations method, Close event, CompressionInfo
property, CompressionType property, Display method, FileStgLoc1x property, FileType
property, ImageModified property, PageType property, Save method, SaveAs method.
SavePage Example 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.
2TKXCVG 5WD EOF5CXG2CIGA%NKEM)
'5CXG QPN[ VJG EWTTGPVN[ FKURNC[GF RCIG VQ C PGY HKNG -GGR HKNG V[RG
'CPF RCIG V[RG VJG UCOG CU VJG[ YGTG QTKIKPCNN[ 7UG FGHCWNVU HQT HKNG
'EQORTGUUKQP 5CXG CV QTKIKPCN \QQO HCEVQT
+OI'FKV1SavePaqe &>KOCIG>UCXGRCIGVKH (CNUG 1
'5CXG VJG EWTTGPVN[ FKURNC[GF RCIG VQ C PGY WPEQORTGUUGF EQNQT $/2 HKNG
'5CXG CV VJG FKURNC[GF \QQO HCEVQT
+OI'FKV1SavePaqe &>KOCIG>UCXGFDOR YK(KNG6[RG$/2
YK2CIG6[RG$)44 1 0 6TWG 1
'PF 5WD
SavePage Example 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.
XQKF %+OI'FKV1&NI1P5CXG2CIG)
]
// 5QOG GZCORNGU QH VJG 5CXG2CIG OGVJQF
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV HQT UCXGCU
8#4+#06 X(KNG6[RG 8A86oX(KNG6[RG) - 86A+ // UGV (KNG6[RG HQT UCXGCU
8#4+#06 X2CIG6[RG 8A86oX2CIG6[RG) - 86A+ // UGV 2CIG6[RG HQT UCXGCU
// UGV %QORTGUUKQP6[RG HQT UCXGCU
8#4+#06 X%QORTGUKQP6[RG 8A86oX%QORTGUKQP6[RG) - 86A+
// UGV %QORTGUUKQP+PHQ HQT UCXGCU
8#4+#06 X%QORTGUKQP+PHQ 8A86oX%QORTGUKQP+PHQ) - 86A+
// UGV 5CXG#V<QQO HQT UCXGCU
8#4+#06 X5CXG#V<QQO 8A86oX5CXG#V<QQO) - 86A$11.
// UGV %QORTGUUKQP+PHQ HQT UCXGCU
8#4+#06 X2CIG0WODGT 8A86oX2CIG0WODGT) - 86A+
Scrol lImage M et hod
461
// 5CXG QPN[ VJG EWTTGPVN[ FKURNC[GF RCIG VQ C PGY HKNG -GGR HKNG V[RG
// CPF RCIG V[RG VJG UCOG CU VJG[ YGTG QTKIKPCNN[ 7UG FGHCWNVU HQT HKNG
// EQORTGUUKQP 5CXG CV QTKIKPCN \QQO HCEVQT
8A$11.oX5CXG#V<QQO) - (#.5'
8A+oX2CIG0WODGT) - 1
+OI'FKV1SavePaqe &>>KOCIG>>UCXGRCIGVKH GXV GXV GXV GXV
X5CXG#V<QQO X2CIG0WODGT)
// 5CXG VJG EWTTGPVN[ FKURNC[GF RCIG VQ C PGY WPEQORTGUUGF EQNQT $/2
// HKNG 5CXG CV VJG FKURNC[GF \QQO HCEVQT
8A+oX(KNG6[RG) - 1
8A+oX2CIG6[RG) - 1
8A+oX%QORTGUKQP6[RG) - 1
8A+oX%QORTGUKQP+PHQ) - 0
8A$11.oX5CXG#V<QQO) - 647'
8A+oX2CIG0WODGT) - 1
// YK(KNG6[RG$/2 YK2CIG6[RG$)44 1 0 6TWG 1
+OI'FKV1SavePaqe &>>KOCIG>>UCXGFDORX(KNG6[RGX2CIG6[RG
X%QORTGUKQP6[RGX%QORTGUKQP+PHQX5CXG#V<QQOX2CIG0WODGT)
_
ScrollImage Met hod
Descript ion Scrolls a displayed image.
Available Wit h
Applies To Image Edit control.
Usage object.ScrollImage Direction,ScrollAmount
Argument s The ScrollImage method has the following arguments:
Remarks The Display method must be invoked pr ior to calling this method.
See Also Display method, Scroll event, ScrollBars property, ScrollPositionX property, ScrollPositionY
property, ScrollShortcutsEnabled property.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
Direction Integer
(enumerated)
The direction in which to scroll the image:
0 Down
1 Up
2 R ight
3 Left
ScrollAmount Long The number of pixels to scroll the image.
Chapt er 7
462
Select Annot at ionGroup Met hod
Descript ion Selects all annotation marks within a specific group on the image page.
Available Wit h
Applies To Image Edit control.
Usage object.SelectAnnotationGroup GroupName
Argument s The SelectAnnotationGroup method has the following argument:
Ret urns None.
Remarks The Display method must be invoked pr ior to calling this method.
Selecting annotations enables many methods to perfor m functions on them.
See Also AddAnnotationGroup method, DeleteSelectedAnnotations method, Display method,
GetAnnotationGroup method, GetCurrentAnnotationGroup method, MarkSelect event,
SetCurrentAnnotationGroup method, ShowAnnotationGroup method.
Select First OcrZone Met hod
Descript ion Selects the first OCR zone on the displayed image page.
Available Wit h
Applies To Image Edit control.
Usage object.SelectFirstOcrZone ZoneType
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
GroupName Str ing The name of the annotation group to select.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Select Next OcrZone M et hod
463
Argument s The SelectFirstOcrZone has the following argument:
Ret urns Long (NextInfo, which is used by the SelectNextOcrZone method).
Remarks The Display method must be invoked pr ior to calling this method.
This method works in conjunction with the SelectNextOcrZone method.
See Also Display method, Image OCR control, SelectNextOcrZone method.
Select Next OcrZone Met hod
Descript ion Selects the next OCR zone on the displayed image page.
Available Wit h
Applies To Image Edit control.
Usage object.SelectNextOcrZone(NextInfo)
Argument s The SelectNextOcrZone method has the following argument:
Ret urns Long (NextInfo, which is used by the next invocation of this method).
Remarks The Display method must be invoked pr ior to calling this method.
See Also Display method, Image OCR control, SelectFirstOcrZone method.
Paramet er Dat a Type Set t ing
ZoneType Integer
(enumerated)
0 Select the first OCR Text zone.
1 Select the first OCR Picture zone.
2 Select the first OCR Text or Picture zone.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
NextInfo Long Next infor mation from the last invocation of the
SelectFirstOcrZone or SelectNextOcrZone method.
Chapt er 7
464
Select Tool Met hod
Descript ion Selects an annotation tool from the Annotation Tool Palette (see page 533).
Available Wit h
Applies To Image Edit control.
Usage object.SelectTool ToolID
Argument s The SelectTool method has the following argument:
Ret urns None.
Remarks The Highlighter annotation type is composed of a Filled R ectangle annotation type with a
transparent fill style.
When a tool is selected from the tool palette, the previous tool is deselected automatically.
The Annotation Tool Palette does not have to be visible to use this method.
See Also ShowAnnotationToolPalette method, ToolSelected event.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing Descript ion
ToolID Integer
(enumerated)
0
1
2
3
4
5
6
7
8
9
10
11
12
No Tool
Selection
Freehand Line
Highlighter
Straight Line
Hollow R ectangle
Filled R ectangle
Text
Attach- a- Note
Text From File
Text Stamp
Hyperlink
OCR Zones
Not e: Hyperlink and OCR Zone ToolID set t ings are available w it h Imaging f or Window s
Prof essional Edit ion only.
Select Tool M et hod
465
Select Tool Example 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.
2TKXCVG 5WD EOF5GNGEV6QQNA%NKEM)
'7UGU VJG 5GNGEV6QQN OGVJQF VQ UGNGEV VJG 6GZV HTQO HKNG CPPQVCVKQP
'V[RG 1XGTNC[U VGZV HTQO C VGZV HKNG QPVQ CP KOCIG +H VJG CPPQVCVKQP
'VQQN RCNGVVG KU WVKNK\GF YKVJKP CP CRRNKECVKQP 5GNGEV6QQN UJQWNF DG
'WUGF TCVJGT VJCP UGVVKPI VJG #PPQVCVKQP6[RG RTQRGTV[ HQT FTCYKPI OCTMU
'RTQITCOCVKECNN[
+OI'FKV1SeectToo 9 '6GZV HTQO HKNG
+OI'FKV1#PPQVCVKQP6GZV(KNG - %>VGZV>FKUENCKOVZV
+OI'FKV1&TCY 0 0
'PF 5WD
Select Tool Example 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.
XQKF %+OI'FKV1&NI1P5GNGEV6QQN)
]
// 7UGU VJG 5GNGEV6QQN OGVJQF VQ UGNGEV VJG 6GZV HTQO HKNG CPPQVCVKQP
// V[RG 1XGTNC[U VGZV HTQO C VGZV HKNG QPVQ CP KOCIG
// +H VJG CPPQVCVKQP VQQN RCNGVVG KU WVKNK\GF YKVJKP CP CRRNKECVKQP
// 5GNGEV6QQN UJQWNF DG WUGF TCVJGT VJCP UGVVKPI VJG #PPQVCVKQP6[RG
// RTQRGTV[ HQT FTCYKPI OCTMU RTQITCOCVKECNN[
+OI'FKV1SeectToo9) // 6GZV HTQO HKNG
+OI'FKV15GV#PPQVCVKQP6GZV(KNG%>>VGZV>>FKUENCKOVZV)
8#4+#06 GXV 8A86oGXV) - 86A'4414 // UGV VQ FGHCWNV
+OI'FKV1&TCY10 10 GXV GXV)
_
Chapt er 7
466
Set Current Annot at ionGroup Met hod
Descript ion Sets the annotation group to which subsequent annotations will belong.
Available Wit h
Applies To Image Edit control.
Usage object.SetCurrentAnnotationGroup GroupName
Argument s The SetCurrentAnnotationGroup method has the following argument:
Ret urns None.
Remarks The SetCurrentAnnotationGroup method is valid only at run- time.
The names of the groups can be obtained from the GetAnnotationGroup method.
A new group can be created using the AddAnnotationGroup method.
See Also AddAnnotationGroup method, BurnInAnnotations method, GetAnnotationGroup
method, GetCur rentAnnotationGroup method.
Set ImagePalet t e Met hod
Descript ion Sets the palette to be used for the image currently being displayed, or an image to be
displayed.
Available Wit h
Applies To Image Edit control.
Usage object.SetImagePalette Option
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
GroupName Str ing The name of the annotation group
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Set RubberSt ampIt em M et hod
467
Argument s The SetImagePalette method has the following argument:
Ret urns 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 O ption value to 1
(Background) sets the existing palette, which has already been loaded by Windows.
See Also ImagePalette property.
Set RubberSt ampIt em Met hod
Descript ion Sets the item number for the rubber stamp according to its position on the R ubber Stamp
Properties dialog box (shown here) and drop- down menu. Also activates the R ubber Stamp
annotation.
Paramet er Dat a Type Set t ing Descript ion
Option Integer
(enumerated)
0
1
Foreground
Background
Chapt er 7
468
Available Wit h
Applies To Image Edit control.
Usage object.SetRubberStampItem ItemNumber
Argument s The SetR ubberStampItem method has the following argument:
Ret urns None.
Remarks The item number is zero based. For example, an ItemNumber of 2 selects the R eceived
stamp because it is the third item on the R ubber Stamp Properties dialog box and drop-
down menu.
The R ubber Stamp Properties dialog box is accessible by r ight- clicking on the R ubber
Stamp tool in the Annotation Tool Palette (see page 533). The drop- down menu is
accessible by left- clicking on the tool.
See Also GetR ubberStampItem method, GetR ubberStampMenuItems method,
ShowAnnotationToolPalette.
Set RubberSt ampIt em Example VB
This example lets users select the type of rubber stamp they want to use.
2TKXCVG 5WD EOF5GV5VCORA%NKEM)
'6JKU CNNQYU C WUGT VQ ENKEM QP C UVCOR KP QTFGT VQ UGNGEV KV CU VJG
'EWTTGPV UVCOR 5GG VJG )GV4WDDGT5VCOR/GPW+VGOU OGVJQF HQT CP GZCORNG QH
'JQY VQ ETGCVG C NKUV QH UVCORU
&KO KPV0GY5VCOR #U +PVGIGT
')GV VJG KPFGZ PWODGT QH VJG UVCOR VJCV YCU UGNGEVGF KP VJG NKUV DQZ
KPV0GY5VCOR - HTO5VCOR.KUV.KUV1.KUV+PFGZ
'5GV VJG UGNGEVGF UVCOR CU VJG EWTTGPV UVCOR VQ DG WUGF
HTO/CKP+OI'FKV1SetRubberStamItem KPV0GY5VCOR
7PNQCF HTO5VCOR.KUV
'PF 5WD
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 98
Imaging for Windows 95
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
ItemNumber Integer The desired rubber stamp item number
Set Select edAnnot at ionBackColor M et hod
469
Set RubberSt ampIt em Example VC++
This example lets users select the type of rubber stamp they want to use.
XQKF %+OI'FKV&NI1P5GVEWTTGPVUVCOR)
]
// 6JKU CNNQYU C WUGT VQ ENKEM QP C UVCOR KP QTFGT VQ UGNGEV KV CU
// VJG EWTTGPV UVCOR 5GG )GV4WDDGT5VCOR/GPW+VGOU HQT CP GZCORNG QH JQY
// VQ ETGCVG C NKUV QH UVCORU
// .QCF VJG NKUV DQZ
%5VCOR.KUV HTO5VCOR.KUV
HTO5VCOR.KUVOAR2CTGPV- VJKU
HTO5VCOR.KUV&Q/QFCN)
+OI'FKV1SetRubberStamItemHTO5VCOR.KUVOAKPV0GY5VCOR)
_
Set Select edAnnot at ionBackColor Met hod
Descript ion Sets the background color of a selected Attach- a- Note annotation.
Available Wit h
Applies To Image Edit control.
Usage object.SetSelectedAnnotationBackColor Color
Argument s The SetSelectAnnotationBackColor method has the following arguments:
Ret urns None.
Remarks The SetSelectedAnnotationBackColor method is used with annotations of the
Attach- a- Note type.
Use the R GB for mat (see page 540). To ensure 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.
See Also AnnotationBackColor property, AnnotationType property,
GetSelectedAnnotationBackColor method, ImageModified property,
SetSelectedAnnotationFontColor method.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Set t ing
Color Long The desired Attach- a- Note color
Chapt er 7
470
Set Select edAnnot at ionBackColor Example 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.
2TKXCVG 5WD EOF$CEM%QNQTA%NKEM)
'6JKU GZCORNG WUGU VJG /KETQUQHV EQNQT FKCNQI DQZ VQ EJCPIG
'C UGNGEVGF VGZV CVVCEJOGPV CPPQVCVKQP OCTMNU DCEMITQWPF EQNQT
&KO $CEM%QNQT #U .QPI
'&GVGTOKPG VJG EWTTGPV EQNQT QH VJG UGNGEVGF CPPQVCVKQP
'OCTM CPF KPKV VJG FKCNQI DQZ EQNQT RTQRGTV[ VQ VJCV EQNQT
$CEM%QNQT - +OI'FKV1)GV5GNGEVGF#PPQVCVKQP$CEM%QNQT
%QOOQP&KCNQI1%QNQT - $CEM%QNQT
%QOOQP&KCNQI1(NCIU - EFN%%4)$+PKV
'&KURNC[ VJG FKCNQI DQZ CPF UGV VJG CPPQVCVKQP DCEMITQWPF EQNQT VQ VJG
'EQNQT UGNGEVGF
%QOOQP&KCNQI15JQY%QNQT
+OI'FKV1SetSeectedAnnotat1onBackOoor %QOOQP&KCNQI1%QNQT
'PF 5WD
Set Select edAnnot at ionBackColor Example 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.
XQKF %+OI'FKV&NI1P$CEMEQNQT)
]
// 6JKU GZCORNG WUGU VJG /KETQUQHV EQNQT FKCNQI DQZ VQ EJCPIG
// C UGNGEVGF VGZV CVVCEJOGPV CPPQVCVKQP OCTM'U DCEMITQWPF EQNQT
NQPI $CEM%QNQT
// &GVGTOKPG VJG EWTTGPV EQNQT QH VJG UGNGEVGF CPPQVCVKQP
// OCTM CPF KPKV VJG FKCNQI DQZ EQNQT RTQRGTV[ VQ VJCV EQNQT
$CEM%QNQT - +OI'FKV1)GV5GNGEVGF#PPQVCVKQP$CEM%QNQT)
%QOOQP&KCNQI15GV%QNQT$CEM%QNQT)
%QOOQP&KCNQI15GV(NCIU1) // EFN%%4)$+PKV
%QOOQP&KCNQI15JQY%QNQT)
+OI'FKV1SetSeectedAnnotat1onBackOoor%QOOQP&KCNQI1)GV%QNQT))
_
Set Select edAnnot at ionFillColor Met hod
Descript ion Sets the color used to fill a selected Filled R ectangle annotation.
Available Wit h
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Set Select edAnnot at ionFillColor M et hod
471
Applies To Image Edit control.
Usage object.SetSelectedAnnotationFillColor Color
Argument s The SetSelectedAnnotationFillColor method has the following argument:
Remarks The SetSelectedAnnotationFillColor method is used with annotations of the Filled
R ectangle annotation type.
Use the R GB for mat (see page 540).
Invoking the SetSelectedAnnotationFillColor method sets the ImageModified property
to True.
See Also AnnotationFillColor property, AnnotationType property, GetSelectedAnnotationFillColor
method, ImageModified property, SetSelectedAnnotationFontColor method.
Set Select edAnnot at ionFillColor Example VB
This example uses the GetSelectedAnnotationFillColor method to deter mine 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.
2TKXCVG 5WD EOF(KNN%QNQTA%NKEM)
'6JKU GZCORNG WUGU VJG /KETQUQHV EQNQT FKCNQI DQZ VQ
'EJCPIG C UGNGEVGF CPPQVCVKQP OCTM'U HKNN EQNQT
&KO (KNN%QNQT #U .QPI
'&GVGTOKPG VJG EWTTGPV EQNQT QH VJG UGNGEVGF CPPQVCVKQP
'OCTM CPF KPKV VJG FKCNQI DQZ EQNQT RTQRGTV[ VQ VJCV EQNQT
(KNN%QNQT - +OI'FKV1)GV5GNGEVGF#PPQVCVKQP(KNN%QNQT
%QOOQP&KCNQI1%QNQT - (KNN%QNQT
%QOOQP&KCNQI1(NCIU - EFN%%4)$+PKV
%QOOQP&KCNQI15JQY%QNQT
+OI'FKV1SetSeectedAnnotat1onF1Ooor %QOOQP&KCNQI1%QNQT
'PF 5WD
Set Select edAnnot at ionFillColor Example VC++
This example uses the GetSelectedAnnotationFillColor method to deter mine 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.
XQKF %+OI'FKV&NI1P(KNNEQNQT)
]
// 6JKU GZCORNG WUGU VJG /KETQUQHV EQNQT FKCNQI DQZ VQ
Paramet er Dat a Type Set t ing
Color Long The desired Filled R ectangle color
Chapt er 7
472
// EJCPIG C UGNGEVGF CPPQVCVKQP OCTM'U HKNN EQNQT
NQPI (KNN%QNQT
// &GVGTOKPG VJG EWTTGPV EQNQT QH VJG UGNGEVGF CPPQVCVKQP
// OCTM CPF KPKV VJG FKCNQI DQZ EQNQT RTQRGTV[ VQ VJCV EQNQT
(KNN%QNQT - +OI'FKV1)GV5GNGEVGF#PPQVCVKQP(KNN%QNQT)
%QOOQP&KCNQI15GV%QNQT(KNN%QNQT)
%QOOQP&KCNQI15GV(NCIU1) // EFN%%4)$+PKV
%QOOQP&KCNQI15JQY%QNQT)
+OI'FKV1SetSeectedAnnotat1onF1Ooor%QOOQP&KCNQI1)GV%QNQT))
_
Set Select edAnnot at ionFillSt yle Met hod
Descript ion Sets the style used to fill a selected image or Filled R ectangle annotation.
Available Wit h
Applies To Image Edit control.
Usage object.SetSelectedAnnotationFillStyle Style
Argument s The SetSelectedAnnotationFillStyle method has the following argument:
Ret urns None.
Remarks The SetSelectedAnnotationFillStyle method is used with annotations of the following
types:
s
Filled R ectangle
s
Image Embedded
s
Image R eference
Invoking the SetSelectedAnnotationFillStyle method sets the ImageModified property
to True.
Imaging for Windows Professional Edition V1.0, V1.1, and V2.0
Imaging for Windows 95 and 98
Imaging for Windows NT 4.0
Paramet er Dat a Type Const ant Set t ing Descript ion
Style Integer
(enumerated)
wiTransparent 0 Transparent The
underlying image data
is visible.
wiOpaque 1 Opaque The under-
lying image data is
obscured.
Set Select edAnnot at ionFil lSt yle M et hod
473
See Also AnnotationFillStyle property, AnnotationType property, GetSelectedAnnotationFillStyle
method, ImageModified property.
Set Select edAnnot at ionFillSt yle Example VB
This example uses the GetSelectedAnnotationFillStyle method to deter mine whether a
selected image or filled rectangle annotation is opaque or transparent, and the
SetSelectedAnnotationFillStyle method to change the fill style.
2TKXCVG 5WD (QTOA.QCF)
'6JKU GZCORNG YQWNF FGVGTOKPG YJGVJGT C UGNGEVGF CPPQVCVKQP KOCIG QT
'HKNNGF TGEVCPING KU QRCSWG QT VTCPURCTGPV CPF YQWNF CNNQY VJCV
'CVVTKDWVG VQ DG EJCPIGF 6JG HQTO WUGF YQWNF JCXG QRVKQP DWVVQPU
'QPG NCDGNGF 1RCSWG CPF QPG NCDGNGF 6TCPURCTGPV
&KO (KNN5V[NG #U #PPQVCVKQP5V[NG%QPUVCPVU
'&GVGTOKPG KH VJG UGNGEVGF KOCIG CPPQVCVKQP KU QRCSWG QT VTCPURCTGPV CPF
'UGV VJG EQTTGURQPFKPI QRVKQP DWVVQP QP VJG HQTO
(KNN5V[NG - HTO/CKP+OI'FKV1)GV5GNGEVGF#PPQVCVKQP(KNN5V[NG
+H (KNN5V[NG - YK1RCSWG 6JGP
QRV1RCSWG8CNWG - 6TWG
'NUG
QRV6TCPURCTGPV8CNWG - 6TWG
'PF +H
HTO(KNN5V[NG5JQY
'PF 5WD
2TKXCVG 5WD QRV1RCSWGA%NKEM)
'+H VJG WUGT ENKEMU QP VJG 1RCSWG QRVKQP DWVVQP VJG CPPQVCVKQP KU
'EJCPIGF VQ DG QRCSWG
HTO/CKP+OI'FKV1SetSeectedAnnotat1onF1Stye YK1RCSWG
'PF 5WD
2TKXCVG 5WD QRV6TCPURCTGPVA%NKEM)
'+H VJG WUGT ENKEMU QP VJG 6TCPURCTGPV QRVKQP DWVVQP VJG CPPQVCVKQP
'KU EJCPIGF VQ DG VTCPURCTGPV
HTO/CKP+OI'FKV1SetSeectedAnnotat1onF1Stye YK6TCPURCTGPV
'PF 5WD
Set Select edAnnot at ionFillSt yle Example VC++
This example uses the GetSelectedAnnotationFillStyle method to deter mine whether a
selected image or filled rectangle annotation is opaque or transparent, and the
SetSelectedAnnotationFillStyle method to change the fill style.
XQKF %.KPG5V[NGU1P1-)
]
KHOA6TCPURCTGPV)GV%JGEM) oo OAD.KPG5V[NG)
OAR2CTGPV+OI'FKV15GV5GNGEVGF#PPQVCVKQP.KPG5V[NG0)<