Introduction

The LEADTOOLS Screen Capture properties, methods, and events are available with the LEADTOOLS COM objects as the LEAD Screen Capture COM object. The properties, methods, and events allow you to perform the following captures: entire screen, active window, selected menu, menu under cursor, selected window object (button, tool bar, icon, or client area), selected area (rectangle, ellipse, triangle, polygon or freehand), wallpaper, mouse pointer, and resource stored in EXE or DLL. Options include multi-capture, Hot Keys, and time interval.

LEADTOOLS Screen Capture COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

Executable demos are included in all LEADTOOLS 32 bit products. The executable demos provide a quick and easy way to evaluate features and performance.

You can use the LEADTOOLS Screen Capture features in any programming environment that supports OLE custom controls, including the following:

Visual C++ 5.0 and later (32-bit)
Visual Basic 5.0 and later (32-bit)

Summary of All Supported Image File Formats

Please note that due to the large size of the PDF files that contain the LEADTOOLS manuals, these files are no longer included in the setup. Instead, these PDF files can be downloaded from our website at http://support.leadtools.com/SupportPortal/DesktopDefault.aspx?tabindex=3&tabid=27.


Implementing Screen Capture

The Screen Capture libraries provide methods for capturing all or part of the screen into a bitmap. For a list of required DLL's, refer to Files To Be Included With Your Application. You can capture FullScreen, ActiveWindow, ActiveClientArea, MenuUnderCursor, WindowUnderCursor, SelectedObject, MouseCursor or Wallpaper. You can capture a particular area of the screen in any of the following shapes: Rect, Square, RoundRect, RoundSquare, Triangle, Ellipse, Circle, Polygon or FreeHand. Icon, Bitmap, and Cursor resources can be captured 32-bit Windows EXE and DLL files. Captures can be tied to a HotKey combination, can be delayed, and can be repeated with a specified interval. By default, most capture operations are tied to the F11 key. For information concerning which capture methods use F11, refer to the individual methods.

For more information, refer to the dialog properties, methods, and events:

Properties

EnableMethodErrors | ScaleMode
CaptureCursorIndex | CaptureCursor
CaptureStatusCursorIndex | CaptureStatusCursor
CaptureHotKey | CaptureHotKeyModifiers
CaptureCancelKey | CaptureDelay
CaptureCount | CaptureInterval
CaptureInfohWnd | CaptureInfoTop
CaptureInfoLeft | CaptureInfoWidth
CaptureInfoHeight | CaptureInfoResType
CaptureInfoResIndex | CaptureInfoResourceId
CaptureInfoExeName | CaptureAreaFillPattern
CaptureAreaFillForeColor | CaptureAreaFillBackColor
CaptureAreaDrawLineStyle | CaptureAreaDrawLineColor
CaptureAreaDrawEllipseWidth | CaptureAreaDrawEllipseHeight
CaptureAreaDrawCursorIndex | CaptureAreaDrawCursor
CaptureAreaTextForeColor | CaptureAreaTextBackColor
CaptureAreaInfoLeft | CaptureAreaInfoTop
CaptureAreaInfoWidth | CaptureAreaInfoHeight
CaptureAreaShowDrawCursor | CaptureAreaIncludeCursor
CaptureAreaEnableKeyboard | CaptureAreaShowOpaqueText
CaptureAreaShowCursorPosition | CaptureAreaShowAreaSize
CaptureAreaShowInfoWindow | CaptureAreaSensitiveInfoWindow
CaptureAreaBitmapWithRegion | CaptureAreaZoomFactor
CaptureObjectInvert | CaptureObjectEnableKeyboard
CaptureObjectBorderWidth | CaptureObjectSelectCursorIndex
CaptureObjectSelectCursor | Bitmap
TransparentColor | CaptureAreaType
ShowHelpButton property | CaptureAreaUseCrossLinesCursor
OptimizedHotkey property |

Methods

CaptureActiveWindow | CaptureActiveClient
CaptureFullScreen | CaptureMenuUnderCursor
CaptureSelectedObject | CaptureArea
CaptureMouseCursor | CaptureOptionDlg
CaptureAreaOptionDlg | CaptureObjectOptionDlg
CaptureEXEDlg | CaptureGetResourceCount
CaptureEXE | CaptureWallPaper
CaptureWindowUnderCursor | ResetAreaOptions
ResetObjectOptions | StopCapture

IsCaptureActive

Events

CaptureImage | CaptureHotKeyPressed
ScreenDlgHelp event |


Registering and Unregistering the Screen Capture COM Object

Registering a COM Object

Before the Screen Capture COM Object can be used, it must be registered. The installation program automatically registers all the LEADTOOLS Screen Capture COM Object. If you would like to manually register the object run REGSVR32.EXE found in the BIN directory and pass the name of the object (.DLL) to register as a parameter.

EX.:

REGSVR32 LTRSC14N.DLL will register the LEAD Raster Screen Capture Object.

Unregistering a COM Object

To unregister COM Objects, include the "/u" switch before the library name when running REGSVR32.EXE.

EX.:

REGSVR32 /u LTRSC14N.DLL will unregister the LEAD Raster Screen Capture Object.


Example Programs

Note:

You can run some of the example programs on your system by clicking the appropriate buttons in online help. An error message will appear if you try to run an example program that is not on your system.

The executable files for these examples were compiled with a Document/Medical toolkit. To get Document/Medical capabilities, you must buy a LEADTOOLS Document/Medical product. Otherwise, if you recompile the examples, the resulting executable files will not have the Document/Medical capabilities.

Visual C++ 5.0

ScrDemo

EXAMPLES\COM\MSVC5\ScrDemo contains a sample application that demonstrates most of the Screen Capture capabilities in the Visual C++ 5.0 environment. You can open the project in Visual C++; then compile and run it.

Visual Basic

ScrCap32

EXAMPLES\COM\VB\ScrCap32 contains a sample application that demonstrates most of the Screen Capture capabilities in the Visual Basic 5.0 environment. You can open the project in Visual Basic; then compile and run it.


Version History

Current version: | 14.5
Last update: | October 20, 2005

Changes from Version 14 to Version 14.5

Changes from Version 13 to Version 14

Version 13


Changes from Version 14 to Version 14.5

Version 14.5 of the LEADTOOLS Screen Capture COM object has not changed from Version 14.


Changes from Version 13 to Version 14

Version 14 of the LEADTOOLS Screen Capture COM object has changed from Version 13 as follows:

LEADTOOLS Screen Capture COM now supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

Version 14 of LEADTOOLS Screen Capture COM objects has been updated to work better with scripting languages. Methods that used to take pointer parameters now work with the new ILEADRasterVariant object.

Changed Methods:

CaptureAreaOptionDlg method takes 1 new parameter.

CaptureEXEDlg method takes 1 new parameter.

CaptureObjectOptionDlg method takes 1 new parameter.

CaptureOptionDlg method takes 1 new parameter.

The rest of this topic lists the new properties, and event.

OptimizedHotkey property

ShowHelpButton property

ScreenDlgHelp event


Version 13

Version 13 is the first version of LEADTOOLS Screen Capture COM objects.

Screen Capture capabilities becomes the 15th imaging technology category found in LEADTOOLS. New properties, methods, and events allow you to capture all or part of the screen into a bitmap. Capture the entire screen, active window, menu under cursor, window under cursor (button, tool bar, icon, or client area), selected object, mouse cursor or wallpaper. Allows for capture of a selected area of the screen in a wide array of shapes such as rectangle, rounded rectangle, ellipse, polygon or freehand. Icon, bitmap and cursor resources can be captured from 32-bit Windows EXE and DLL files. Options include Multi-capture with callback, Hot Keys, and time interval. Great for presentation and application documentation.

The rest of this topic lists the new properties, methods, and events.

Screen Capture:

CaptureActiveClient method

CaptureActiveWindow method

CaptureArea method

CaptureEXE method

CaptureEXEDlg method

CaptureFullScreen method

CaptureMenuUnderCursor method

CaptureMouseCursor method

CaptureSelectedObject method

CaptureWallPaper method

CaptureWindowUnderCursor method

StopCapture method

CaptureAreaOptionDlg method

CaptureGetResourceCount method

CaptureObjectOptionDlg method

CaptureOptionDlg method

ResetAreaOptions method

ResetObjectOptions method

CaptureInfoHeight property

CaptureInfohWnd property

CaptureInfoLeft property

CaptureInfoTop property

CaptureInfoWidth property

CaptureInfoResIndex property

CaptureInfoResourceId property

CaptureInfoResType property

CaptureInfoExeName property

CaptureHotKey property

CaptureHotKeyModifiers property

CaptureObjectBorderWidth property

CaptureObjectEnableKeyboard property

CaptureObjectInvert property

CaptureObjectSelectCursor property

CaptureObjectSelectCursorIndex property

CaptureCount property

CaptureInterval property

CaptureAreaBitmapWithRegion property

CaptureAreaDrawCursor property

CaptureAreaDrawCursorIndex property

CaptureAreaDrawEllipseHeight property

CaptureAreaDrawEllipseWidth property

CaptureAreaDrawLineColor property

CaptureAreaDrawLineStyle property

CaptureAreaEnableKeyboard property

CaptureAreaFillBackColor property

CaptureAreaFillForeColor property

CaptureAreaFillPattern property

CaptureAreaIncludeCursor property

CaptureAreaInfoHeight property

CaptureAreaInfoLeft property

CaptureAreaInfoTop property

CaptureAreaInfoWidth property

CaptureAreaSensitiveInfoWindow property

CaptureAreaShowAreaSize property

CaptureAreaShowCursorPosition property

CaptureAreaShowDrawCursor property

CaptureAreaShowInfoWindow property

CaptureAreaShowOpaqueText property

CaptureAreaTextBackColor property

CaptureAreaTextForeColor property

CaptureAreaZoomFactor property

Bitmap property

CaptureCancelKey property

CaptureCursor property

CaptureCursorIndex property

CaptureDelay property

CaptureStatusCursor property

CaptureStatusCursorIndex property

EnableMethodErrors property

ScaleMode property

TransparentColor property

CaptureHotKeyPressed event

CaptureImage event

CaptureAreaType property

CaptureAreaUseCrossLinesCursor property

IsCaptureActive method


Copyright notice

Copyright Notices

©Copyright LEAD Technologies, Inc. 1991-2005. ALL RIGHTS RESERVED

Portions of the PCDLIB32.DLL, PCDLIB.DLL, LFFPX7.DLL, LFKODAK.DLL, EKFPIXJPEG140.DLL, PDC_SDK.DLL, PROFIRE.DLL, DC120V154_32.DLL, LFDCR14N.DLL, DCSPROBACK.DLL, DCSPRO3SLR.DLL, LFDCS14N.DLL, and LFKDC14N.DLL files contain material that is ©Copyright Eastman Kodak Company, 1996-2001. This software is based in part on the work of the Independent JPEG Group.

Portions of the LFCRW14N.DLL, LTCMP14.DLL, CDSDK.reg, CDSDK.dll, CDRAPCLS.dll, czs_ui.dll, deimg.dll, deImg010.dll, deImg110.dll, deImg153.dll, deimg301.dll, deimg401.dll, deImg404.dll, deimg602.dll, Deimg603.dll, DeImgd60.dll, pscAdimg.dll, pscCllct.dll, pscCStUI.dll, pscDcd.dll, pscDevUI.dll, pscDvlp.dll, Pscl2STI.dll, pscll.dll, pscParse.dll, pscSetup.dll, psdkdll.dll, psdkReg.dll, psParse.dll. file contain material that is © Canon, Inc. 2002

Portions of the LFFPX7.DLL and LFKODAK.DLL files contain material that is ©Copyright Hewlett Packard, 1996.

Portions of the OCR/ICR/OMR Features and the help file for the OCR/ICR/OMR Features are ©Copyright Scansoft, Inc. 1995-2003. ALL RIGHTS RESERVED

Portions of the Barcode Modules contain material that is ©Copyright Axtel Inc., 1999.

Portions of the LEADTOOLS PDF Plug in and the LEADTOOLS Vector Imaging Pro are ©Copyright 1996, 2000 Artifex Software Inc. All rights reserved.

File filters for decoding MrSID ® and DjVu ® formats are provided under a license from Lizardtech, Inc.

The "FlashPix" format uses Microsoft's OLE structured storage.

Portions of the DICOM help files in Medical Imaging product line are reprinted with permission from the National Electrical Manufacturers Association ©Copyright 1998 by the National Electrical Manufacturers Association. All rights including translation into other languages, reserved under the Universal Copyright Convention, the Berne Convention or the Protection of Literacy and Artistic Works, and the International and Pan American Copyright Conventions.

Portions of LEADTOOLS Data Security Add On contain software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/), including cryptographic software written by Eric Young (eay@cryptsoft.com) and by Tim Hudson (tjh@cryptsoft.com). Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) All rights reserved. Copyright Tim Hudson 1995-1998 (tjh@cryptsoft.com) All rights reserved.

Portions of LEADTOOLS Data Security Add On contain software based on the MD5 Message Digest Algorithm developed by RSA Data Security, Inc.. Copyright (c) 1991-92 RSA Data Security, Inc. All Rights Reserved.

Portions hereof licensed under US patent 5,327,254 and foreign counterparts.

Portions of the LEADTOOLS ICC Profiles material is © Copyright 2004, International Color Consortium.

Trademarks

LEAD® and LEADTOOLS® are registered trademarks of LEAD Technologies, Inc.
Microsoft, Windows, Windows NT, Visual Basic, Visual FoxPro, and Microsoft Access are either trademarks or registered trademarks of the Microsoft Corporation.
OS/2® is a registered trademark of International Business Machines Corporation.

TextBridge®OCR is a registered trademark of Scansoft, Inc.

ISIS® is a registered trademark of Pixel Translations, Inc.

ScanAhead™ is a trademark of Pixel Translations, Inc.

FlashPix™ is a trademark of Eastman Kodak Company.

All other brand or product names used in this online help are trademarks of their respective holders.

Address and Contact Information

LEAD Technologies, Inc.
Suite 400
1201 Greenwood Cliff
Charlotte, NC 28204

(704) 332-5532
FAX: (704) 372-8161
E-mail: support@leadtools.com
Technical support: (704) 372-9681 or support@leadtools.com
Home page: http://www.leadtools.com


Files To Be Included With Your Application

The installation procedure creates a directory tree for the LEADTOOLS files, and adds the demonstration programs and online help to your desktop. You specify the root directory during installation. The following subdirectory is created:

REDIST\

Redistributable Screen Capture files.

The following table summarizes the files you must include on your distribution diskettes to support the LEADTOOLS Screen Capture functions on a WIN32 system. (\REDIST\ subdirectory contains copies of these files.)

Please note that LTR and LTRVR are required for all COM applications. For more information on LTR, LTRVR, or other files for the Main COM objects, refer to Files To Be Included With Your Application .

Note: All Unicode versions of LEADTOOLS require Microsoft Unicode Layer for Windows (UNICOWS.DLL) in order to function on Windows 95/98/Me. You can obtain MSUL from: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/anch_mslu.asp.

Redistributables: | Explanation: | If you are using a standard release without Unicode, the files to use are: | If you are using a standard release with Unicode, the files to use are: | If you are using an evaluation release without Unicode, the files to use are: | If you are using an evaluation release with Unicode, the files to use are:
LTRSC | Screen Capture Support. LEAD Raster Screen Capture COM Object | DLL: LTRSC14N.DLL | DLL: LTRSC14NU.DLL | DLL: LTRSC14E.DLL | DLL: LTRSC14EU.DLL


Installation Directory

The installation procedure creates a directory tree for the LEADTOOLS files, demonstration programs and online help. You specify the root directory during installation.

Please note that due to the large size of the PDF files that contain the LEADTOOLS manuals, these files are no longer included in the setup. Instead, these PDF files can be downloaded from our website at http://support.leadtools.com/SupportPortal/DesktopDefault.aspx?tabindex=3&tabid=27.

The following is a list of the subdirectories in the root directory:

BIN | Executable files for the demonstration programs.
HELP | Online help files.
IMAGES | Sample images and databases containing images.
EXAMPLES\COM | One subdirectory for each example COM objects program.
EXAMPLES\RES | Resource files for the example programs.
INCLUDE | Header files, BAS files, and the ActiveX's MFC interface files for versions of Visual C++ earlier than 4.0.
LIB | Library files.
REDIST | Redistributable files. These are copies of the LEADTOOLS files and other files that you may need to distribute with your application. For exact information about required files, refer to Files To Be Included With Your Application.
REDIST\COM | Redistributable files. These are copies of the LEADTOOLS COM Object files and other files that you may need to distribute with your application. For exact information about required files, refer to Files To Be Included With Your Application.
REDIST\COM\NONAGLTKRN | This directory contains the LEADRaster COM Object DLL that must be distributed with your application.


Technical Support

As a registered user, free technical support is available. You must register your software to receive any technical support. Technical support is available 9 a.m. through 6 p.m. Eastern Standard Time. If you are calling by phone, please be at your computer. You can also contact us through the following methods:

Phone: | (704) 372-9681
E-mail: | support@leadtools.com
FAX: | (704) 372-8161
Home page: | http://www.leadtools.com
FTP: | ftp.leadtools.com

You can also contact LEAD by mail at:
LEAD Technologies, Inc.
Attn: Technical Support
1201 Greenwood Cliff, Suite 400
Charlotte, NC 28204

Before calling technical support, please look in the on-line documentation and the example programs for an answer to your question.


Methods, Properties, and Events

Screen Capture: Capturing images

Screen Capture: Getting and Setting Options

Screen Capture: Capture information properties

Screen Capture: Hot Key properties

Screen Capture: Capture Object properties

Screen Capture: Multi-capture properties

Screen Capture: Capture Area properties

Screen Capture: Providing Help

Screen Capture: Miscellaneous properties


Screen Capture: Capturing images

Screen Capture:
Capturing images

CaptureActiveClient method

CaptureActiveWindow method

CaptureArea method

CaptureEXE method

CaptureEXEDlg method

CaptureFullScreen method

CaptureMenuUnderCursor method

CaptureMouseCursor method

CaptureSelectedObject method

CaptureWallPaper method

CaptureWindowUnderCursor method

StopCapture method

IsCaptureActive method

CaptureImage event


Screen Capture: Getting and Setting Options

Screen Capture:
Getting and Setting Options

CaptureAreaOptionDlg method

CaptureGetResourceCount method

CaptureObjectOptionDlg method

CaptureOptionDlg method

ResetAreaOptions method

ResetObjectOptions method


Screen Capture: Capture information properties

Screen Capture:
Capture information properties

CaptureInfoHeight property

CaptureInfohWnd property

CaptureInfoLeft property

CaptureInfoTop property

CaptureInfoWidth property

CaptureInfoResIndex property

CaptureInfoResourceId property

CaptureInfoResType property

CaptureInfoExeName property


Screen Capture: Hot Key properties

Screen Capture:
Hot Key properties

CaptureHotKey property

CaptureHotKeyModifiers property

CaptureHotKeyPressed event

OptimizedHotkey property


Screen Capture: Capture Object properties

Screen Capture:
Capture Object properties

CaptureObjectBorderWidth property

CaptureObjectEnableKeyboard property

CaptureObjectInvert property

CaptureObjectSelectCursor property

CaptureObjectSelectCursorIndex property


Screen Capture: Multi-capture properties

Screen Capture:
Multi-capture properties

CaptureCount property

CaptureInterval property


Screen Capture: Capture Area properties

Screen Capture:
Capture Area properties

CaptureAreaBitmapWithRegion property

CaptureAreaDrawCursor property

CaptureAreaDrawCursorIndex property

CaptureAreaDrawEllipseHeight property

CaptureAreaDrawEllipseWidth property

CaptureAreaDrawLineColor property

CaptureAreaDrawLineStyle property

CaptureAreaEnableKeyboard property

CaptureAreaFillBackColor property

CaptureAreaFillForeColor property

CaptureAreaFillPattern property

CaptureAreaIncludeCursor property

CaptureAreaInfoHeight property

CaptureAreaInfoLeft property

CaptureAreaInfoTop property

CaptureAreaInfoWidth property

CaptureAreaSensitiveInfoWindow property

CaptureAreaShowAreaSize property

CaptureAreaShowCursorPosition property

CaptureAreaShowDrawCursor property

CaptureAreaShowInfoWindow property

CaptureAreaShowOpaqueText property

CaptureAreaTextBackColor property

CaptureAreaTextForeColor property

CaptureAreaUseCrossLinesCursor property

CaptureAreaZoomFactor property


Screen Capture: Providing Help

Screen Capture:
Providing Help

ScreenDlgHelp event

ShowHelpButton property


Screen Capture: Miscellaneous properties

Screen Capture:
Miscellaneous properties

Bitmap property

CaptureCancelKey property

CaptureCursor property

CaptureCursorIndex property

CaptureDelay property

CaptureStatusCursor property

CaptureStatusCursorIndex property

EnableMethodErrors property

ScaleMode property

TransparentColor property


Error Codes

For a list of all possible error codes for LEADTOOLS Screen Capture COM functions, refer to LEADTOOLS COM Error Codes in the Main COM help file.


A Special Note About UNICODE Support

LEADTOOLS now provides UNICODE support. However, in order to utilize the examples and tutorials in this help file with UNICODE, you must make a few substitutions for class names, IDs, event names, etc. This is true for VB, MFC, Delphi and C++ Builder. Before attempting to compile the samples or tutorials in this help file for UNICODE, replace the class name, ID name, event name, etc. in the first column below, with the corresponding name in the second column. As you can see, this just involves adding "_U" to the end of the class name, ID name, event name, etc.

General Notes For VC++ Programmers:

1.

Replace: | With:
LTRASTERXXXXLib | LTRASTERXXXXLib_U
ILEADRasterXXXX | ILEADRasterXXXX_U
LEADRasterXXXX | LEADRasterXXXX_U
IID_ILEADRasterXXXX | IID_ILEADRasterXXXX_U
CLSID_LEADRasterXXXX | CLSID_LEADRasterXXXX_U
LIBID_LTRASTERXXXXLib | LIBID_LTRASTERXXXXLib_U
_LEADRasterXXXXEvents | _LEADRasterXXXXEvents_U
DIID__LEADRasterXXXXEvents | DIID__LEADRasterXXXXEvents_U

For example:

ILEADRasterIO_U *pRasterIO=NULL;

CoCreateInstance(CLSID_LEADRasterIO_U, NULL, CLSCTX_ALL, IID_ILEADRasterIO_U, (void**)&pRasterIO);

2.

For importing (.DLL) or (.OCX) files in your project:

Replace: | With:
LTRXXXN.OCX | LTRXXXNU.OCX
LTRXXXN.DLL | LTRXXXNU.DLL

For example:

#import "c:\\winnt\\system32\\ltrvr14nu.dll" no_namespace, named_guids

#import "c:\\winnt\\system32\\ltrvw14nu.ocx" no_namespace, named_guids

General Notes For VB Programmers:

Replace: | With:
LTRASTERXXXXLib | LTRASTERXXXXLib_U
LEADRasterXXXX | LEADRasterXXXX_U
LEADRasterXXXX_EventName | LEADRasterXXXX_U_EventName
LEADRasterXXXX.LEADRasterXXXX | LEADRasterXXXX_U.LEADRasterXXXX_U

When adding a Reference or Component to a Visual Basic project, be sure that the desired Reference or Component name ends with (_U).

For example:

To add the Unicode version of LEAD RasterView Control to your project, you have to select LEAD Raster View_U Control (14).

General Notes For Delphi and C++ Builder Programmers:

Replace: | With:
LTRASTERXXXLib_TLB | LTRASTERXXXLib_U_TLB
ILEADRasterXXXX | ILEADRasterXXXX_U
CLASS_LEADRasterXXXX | CLASS_LEADRasterXXXX_U
LEADRasterXXXX | LEADRasterXXXX_U
IID_ILEADRasterXXXX | IID_ILEADRasterXXXX_U
CLSID_LEADRasterXXXX | CLSID_LEADRasterXXXX_U
LIBID_LTRASTERXXXXLib | LIBID_LTRASTERXXXXLib_U
_LEADRasterXXXXEvents | _LEADRasterXXXXEvents_U
DIID__LEADRasterXXXXEvents | DIID__LEADRasterXXXXEvents_U

Note:

When adding an ActiveX Control or Import type library to a Delphi or C++ Builder project, be sure that the desired ActiveX Control or Library name ends with (_U).

For example:

To add the Unicode version of LEAD Raster View Control to your project, you have to select LEAD Raster View_U Control (14).


Tutorial for Visual Basic Programmers

The following topics provide brief and simple examples to help you learn how to use the LEADTOOLS Screen Capture properties, methods, and events.

LEADTOOLS Screen Capture COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

Note:

These tutorial examples are not intended to demonstrate good Visual Basic program design. Instead, they are intended to be easy to understand and easy to test. The example programs in the EXAMPLES subdirectory are more representative of good design.

Capturing an Active Window

Capturing an Area

Capturing an Icon from an EXE

Capturing a Selected Object

Capturing Multiple Images

Miscellaneous Examples


Capturing an Active Window (Visual Basic 5 and later)

Take the following steps to start a project and to add some code that captures the active window and displays the image.

1. | Start Visual Basic, select the Standard EXE, and click "Open".
2. | Add the LEAD Raster View Control to your project.
 | On the Project pull-down menu, use the Components option, and select the LEAD Raster View Control(14).
3. | Select the LEAD Raster View; then add the control to your main form. Size and position the control as you want it to appear at run time.
4. | Add the LEAD Raster Screen Capture Object to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster Screen Capture Object (14).
5. | Add the following declaration to the General section at the top of the main form's code window.

Dim WithEvents LEADRasterScr1 As LEADRasterScr

6.

Code the Form_Load procedure as follows:

Private Sub Form_Load()
Set LEADRasterScr1 = New LEADRasterScr
End Sub

7. | Add a command button and name it as follows:
 | Name | Caption
 | CapWin | Capture Window
8. | Code the CapWin_Click procedure as follows:

Private Sub CapWin_Click()
'set the hot key to F10
LEADRasterScr1.CaptureHotKey = 121
LEADRasterScr1.CaptureDelay = 3000
LEADRasterScr1.CaptureActiveWindow

LEADRasterView1.Raster .Bitmap = LEADRasterScr1.Bitmap
End Sub

9.

Code the Form_Unload procedure as follows:

Private Sub Form_Unload(Cancel As Integer)
LEADRasterScr1.StopCapture
End Sub

10. | Run your program to test it. Click the "Capture Window" button, select the window you wish to capture then press F10 and wait for 3 seconds.
11. | Save the project to use as a starting point for other tasks in this tutorial.
12. | To set the hot key to Alt + F10, substitute the following two lines for

LEADRasterScr1.CaptureHotKey = 121:
LEADRasterScr1.CaptureHotKey = vbKeyF10
LEADRasterScr1.CaptureHotKeyModifiers = SCR_MOD_ALT
' To use Control + F10, set the CaptureHotKeyModifiers to SCR_MOD_CONTROL
' To use Shift + F10, set the CaptureHotKeyModifiers to SCR_MOD_SHIFT


Capturing an Area (Visual Basic)

Capturing an Area (Visual Basic 5 and later)

Take the following steps to add code that will let you capture a triangular area.

1. | Start with the project that you created in Capturing an Active Window.
2. | Add a command button and name it as follows:
 | Name | Caption
 | CapArea | Capture Area
3. | Code the CapArea_Click procedure as follows:

Private Sub CapArea_Click()
'set the units of measure
LEADRasterScr1.ScaleMode = 3

' set up the info window
LEADRasterScr1.CaptureAreaShowInfoWindow = True
LEADRasterScr1.CaptureAreaInfoTop = 0
LEADRasterScr1.CaptureAreaInfoLeft = 0
LEADRasterScr1.CaptureAreaInfoHeight = 300
LEADRasterScr1.CaptureAreaInfoWidth = 300

'show area size and cursor information on an opaque background
LEADRasterScr1.CaptureAreaShowAreaSize = True
LEADRasterScr1.CaptureAreaShowCursorPosition = True
LEADRasterScr1.CaptureAreaShowOpaqueText = True

'set text colors, fill colors, fill pattern, and line style
LEADRasterScr1.CaptureAreaDrawLineColor= vbBlack
LEADRasterScr1.CaptureAreaTextBackColor= vbBlue
LEADRasterScr1.CaptureAreaTextForeColor = vbWhite
LEADRasterScr1.CaptureAreaFillBackColor = vbRed
LEADRasterScr1.CaptureAreaFillForeColor = vbBlue
LEADRasterScr1.CaptureAreaFillPattern= CAPTURE_AREA_PATTERN_CROSS
LEADRasterScr1.CaptureAreaDrawLineStyle= CAPTURE_AREA_LINE_DASH

'do not include the cursor in the image
LEADRasterScr1. CaptureAreaIncludeCursor = False

'do not enable the keyboard
LEADRasterScr1.CaptureAreaEnableKeyboard = False

'save a bitmap with a region
LEADRasterScr1.CaptureAreaBitmapWithRegion = True

'make the info window sensitive to the position of the cursor
LEADRasterScr1.CaptureAreaSensitiveInfoWindow = True

'zoom the image in the info window
LEADRasterScr1.CaptureAreaZoomFactor = CAPTURE_AREA_ZOOM_BY2X

'use the cross lines cursor instead of the CaptureAreaDrawCursorIndex
LEADRasterScr1.CaptureAreaUseCrossLinesCursor = True
LEADRasterScr1.CaptureAreaShowDrawCursor = True

'capture a triangular area
LEADRasterScr1.CaptureArea SCR_CAP_AREA_TRIANGLE

'assign the Screen Capture Control bitmap to the Main Control bitmap
LEADRasterView1.Raster
 .Bitmap
  = LEADRasterScr1.Bitmap
End Sub

4.

Run your program to test it. Click the Capture Area command button, press F11, and click and drag to select a region.


Capturing an Icon from an EXE (Visual Basic 5 and later)

Take the following steps to add code that will let you capture icons from EXEs.

1. | Start with the project that you created in Capturing an Active Window.
2. | Add a command button and name it as follows:
 | Name | Caption
 | CapEXE | Capture EXE
3. | Code the CapEXE_Click procedure as follows:

Private Sub CapEXE_Click()
Dim nCount As Integer

nCount = 0

LEADRasterScr1.CaptureGetResourceCount "c:\win98\calc.exe", SCR_CAP_ICON
nCount =LEADRasterScr1.CaptureResourceCount
If nCount < 1 Then
MsgBox "No Icons."
Else
LEADRasterScr1.TransparentColor = vbWhite
'capture by string resource id
'Please note that the exe and the id may not be the same on your system.
'Be sure to replace these with a valid exe name and id for your system.
LEADRasterScr1.CaptureEXE "c:\win98\calc.exe", SCR_CAP_ICON, "sc", False, False
LEADRasterView1.AutoRepaint = False
LEADRasterView1.Raster .Bitmap = LEADRasterScr1.Bitmap

LEADRasterView1.Raster.BitmapTransparentColor = vbWhite
LEADRasterView1.Raster.BitmapEnableTransparency = True
LEADRasterView1.AutoRepaint = True
MsgBox "wait"
End If

nCount = 0
LEADRasterScr1.CaptureGetResourceCount "c:\win98\defrag.exe", SCR_CAP_ICON
nCount = LEADRasterScr1.CaptureResourceCount
If (nCount < 1) Then
MsgBox "No Icons."
Else
LEADRasterScr1.TransparentColor = vbWhite
'now, capture by numeric resource id
'Please note that the exe and the id may not be the same on your system.
'Be sure to replace these with a valid exe name and id for your system.
LEADRasterScr1.CaptureEXE "c:\win98\defrag.exe", SCR_CAP_ICON, "113", True, False
LEADRasterView1.Raster .Bitmap = LEADRasterScr1.Bitmap
LEADRasterView1.AutoRepaint = False
LEADRasterView1.Raster.Bitmap = LEADRasterScr1.Bitmap
LEADRasterView1.Raster.BitmapTransparentColor = vbWhite
LEADRasterView1.Raster.BitmapEnableTransparency = True
LEADRasterView1.AutoRepaint = True
MsgBox "wait"
End If
nCount = 0
LEADRasterScr1.CaptureGetResourceCount "c:\win98\Explorer.exe", SCR_CAP_ICON
nCount = LEADRasterScr1.CaptureResourceCount
If (nCount < 1) Then
MsgBox "No Icons."
Else
LEADRasterScr1.TransparentColor = vbWhite
'finally, capture by resource index
'Please note that the exe and id may not be the same on your system.
'Be sure to replace this with a valid exe name and id for your system.
LEADRasterScr1.CaptureEXE "c:\win98\Explorer.exe", SCR_CAP_ICON, "0", True, True
LEADRasterView1.Raster .Bitmap = LEADRasterScr1.Bitmap
LEADRasterView1.AutoRepaint = False
LEADRasterView1.Raster.Bitmap = LEADRasterScr1.Bitmap

LEADRasterView1.Raster.BitmapTransparentColor = vbWhite

LEADRasterView1.Raster.BitmapEnableTransparency = True
LEADRasterView1.AutoRepaint = True
MsgBox "wait"
End If
End Sub

4.

Run your program to test it.


Capturing a Selected Object (Visual Basic 5 and later)

Take the following steps to add code that will let you capture a selected object.

1. | Start with the project that you created in Capturing an Active Window.
2. | Add a command button and name it as follows:
 | Name | Caption
 | CapObj | Capture Object
3. | Code the CapObj_Click procedure as follows:

Private Sub CapObj_Click()
'display the capture selected object dialog
LEADRasterScr1.CaptureObjectOptionDlg hWnd
'capture the selected object
LEADRasterScr1.CaptureSelectedObject
'assign the screen control bitmap to the Main control bitmap
LEADRasterView1.Raster .Bitmap = LEADRasterScr1.Bitmap

'reset the object options
LEADRasterScr1.ResetObjectOptions
End Sub

4.

Run your program to test it. Click the Capture Select button. Set the options and click OK. Select the window containing the object you want to capture. Press F11, and click the left mouse button to make the selection.


Capturing Multiple Images (Visual Basic 5 and later)

Take the following steps to add code that will let you capture multiple images.

1. | Start with the project that you created in Capturing an Icon from an EXE.
2. | Add two command buttons and name them as follows:
 | Name | Caption
 | CapMulti | Capture Multi
 | Display | Display Multi
3. | Add the LEAD Raster IO Object Library to your project.
 | On the Project pull-down menu, use the References option, and select the LEAD Raster IO Object Library (14).
4. | Code the CapMulti_Click procedure as follows:

Private Sub CapMulti_Click()
'set the cancel key
LEADRasterScr1.CaptureCancelKey = vbKeyEscape
'set the delay, the interval and the number of captures to perform
LEADRasterScr1.CaptureDelay = 2000
LEADRasterScr1.CaptureInterval = 2000
LEADRasterScr1.CaptureCount = 3
'capture
LEADRasterScr1.CaptureActiveClient
End Sub

5.

Code the Display_Click procedure as follows:

Private Sub Display_Click()
Dim LEADRasterIO1 As New LEADRasterIO
LEADRasterIO1.Load LEADRasterView1.Raster, "D:\Temp\Multi.tif", 0, 1, 1
MsgBox "Loaded Page 1"
LEADRasterIO1.Load LEADRasterView1.Raster, "D:\Temp\Multi.tif", 0, 2, 1
MsgBox "Loaded Page 2"
LEADRasterIO1.Load LEADRasterView1.Raster, "D:\Temp\Multi.tif", 0, 3, 1
MsgBox "Loaded Page 3"
'remove the tif file so you can capture and display again
Kill "D:\Temp\Multi.tif"
End Sub

6.

Code the OnCaptureImage procedure as follows:

Private Sub LEADRasterScr1_OnCaptureImage (ByVal CaptureNumber As Long)
'copy the captured image to the Main control and save it
LEADRasterView1.Raster .Bitmap = LEADRasterScr1.Bitmap
Dim LEADRasterIO1 As New LEADRasterIO
LEADRasterIO1.Save LEADRasterView1.Raster, "D:\Temp\Multi.tif", FILE_TIF, 0, 2, SAVE_APPEND
End Sub

7.

Run your program to test it. Click on Capture Multi, press F11, and then select the window(s) you wish to capture, at the proper times. You may want to decrease the capture interval in the code. To view the images you captured, click on the Display command button after capturing has ended.


Miscellaneous Examples (Visual Basic 5 and later)

Miscellaneous Examples (Visual Basic)

LEADTOOLS Screen Capture COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

You can test the following examples by either adding a command button to one of the previous lessons in the tutorial and pasting the sample code in the Click procedure, or by cutting and pasting event code into the appropriate event in a lesson.

CaptureActiveClient Example for Visual Basic

CaptureActiveWindow Example for Visual Basic

CaptureArea Example for Visual Basic

CaptureAreaOptionDlg Example for Visual Basic

CaptureEXE Example for Visual Basic

CaptureEXEDlg Example for Visual Basic

CaptureFullScreen Example for Visual Basic

CaptureGetResourceCount Example for Visual Basic

CaptureHotKey Example for Visual Basic

CaptureHotKeyPressed Example for Visual Basic

CaptureImage Example for Visual Basic

CaptureMenuUnderCursor Example for Visual Basic

CaptureMouseCursor Example for Visual Basic

CaptureObjectOptionDlg Example for Visual Basic

CaptureOptionDlg Example for Visual Basic

CaptureSelectedObject Example for Visual Basic

CaptureWallPaper Example for Visual Basic

CaptureWindowUnderCursor Example for Visual Basic

OptimizedHotkey Example for Visual Basic


CaptureActiveClient Example for Visual Basic

'set custom Capture cursor
'and include it in captured image
LEADRasterScr1.CaptureDelay = 3000
LEADRasterScr1.CaptureCursor = LoadPicture("d:\temp\test.cur")
LEADRasterScr1.CaptureCursorIndex = 99
LEADRasterScr1.CaptureAreaIncludeCursor = True

'capture the client area of the active window
LEADRasterScr1.CaptureActiveClient

'copy the captured image to a Main Control
LEADRasterView1.Raster Bitmap = LEADRasterScr1.Bitmap


CaptureActiveWindow Example for Visual Basic

'set custom status cursor
LEADRasterScr1.CaptureStatusCursor = LoadPicture("d:\temp\test.cur")
LEADRasterScr1.CaptureStatusCursorIndex = 99

'set cancel key to ESC
LEADRasterScr1.CaptureCancelKey = vbKeyEscape

LEADRasterScr1.CaptureDelay = 5000 'wait 5 secs before starting
LEADRasterScr1.CaptureInterval = 1000 'capture every second
LEADRasterScr1.CaptureCount = 25 'capture 25 images

'start the captures
LEADRasterScr1.CaptureActiveWindow

'display the results
Text1.Text = LEADRasterScr1.CaptureInfohWnd


CaptureArea Example for Visual Basic

LEADRasterScr1.ScaleMode = 1 'set to twips

'show area info window
LEADRasterScr1.CaptureAreaShowInfoWindow = True
'show area size during capture
LEADRasterScr1.CaptureAreaShowAreaSize = True
'enable sensitive  area info window
LEADRasterScr1.CaptureAreaSensitiveInfoWindow = True

'set zoom factor
LEADRasterScr1.CaptureAreaZoomFactor = CAPTURE_AREA_ZOOM_BY3X

'position capture area info window
LEADRasterScr1.CaptureAreaInfoTop = 1440
LEADRasterScr1.CaptureAreaInfoLeft = 1440
'size the capture area info window
LEADRasterScr1.CaptureAreaInfoWidth = 1440
LEADRasterScr1.CaptureAreaInfoHeight = 2880

'set colors
LEADRasterScr1.CaptureAreaDrawLineColor = vbBlack
LEADRasterScr1.CaptureAreaTextForeColor = vbBlue
LEADRasterScr1.CaptureAreaTextBackColor = vbBlack

'capture with a region
LEADRasterScr1.CaptureAreaBitmapWithRegion = True

'show cursor position with opaque background
LEADRasterScr1.CaptureAreaShowCursorPosition = True
LEADRasterScr1.CaptureAreaShowOpaqueText = True

'disable keyboard
LEADRasterScr1.CaptureAreaEnableKeyboard = False

'do not include cursor in captured image
LEADRasterScr1.CaptureAreaIncludeCursor = False

'setup the background
LEADRasterScr1.CaptureAreaFillBackColor = vbRed
LEADRasterScr1.CaptureAreaFillForeColor = vbBlue
LEADRasterScr1.CaptureAreaFillPattern = CAPTURE_AREA_PATTERN_DIAGCROSS

'capture a round rect
LEADRasterScr1.CaptureAreaDrawLineStyle = CAPTURE_AREA_LINE_DASHDOT
LEADRasterScr1.CaptureAreaDrawEllipseHeight = 500
LEADRasterScr1.CaptureAreaDrawEllipseWidth = 500

'show custom cursor while drawing
LEADRasterScr1.CaptureAreaDrawCursor = LoadPicture("d:\temp\test.cur")
LEADRasterScr1.CaptureAreaDrawCursorIndex = 99
LEADRasterScr1.CaptureAreaUseCrossLinesCursor = False
LEADRasterScr1.CaptureAreaShowDrawCursor = True

'do the capture
LEADRasterScr1.CaptureArea SCR_CAP_AREA_ROUNDRECT

'copy the image to a Main Control
LEADRasterView1.Raster
 .Bitmap = LEADRasterScr1.Bitmap


CaptureAreaOptionDlg Example for Visual Basic

'set options
LEADRasterScr1.CaptureAreaOptionDlg hWnd, 0
'do a capture using these options
LEADRasterScr1.CaptureArea LEADRasterScr1.CaptureAreaType

'copy the captured image to a Main Control
LEADRasterView1.Raster .Bitmap = LEADRasterScr1.Bitmap

'display the capture result info
Text1.Text = CStr(LEADRasterScr1.CaptureInfoTop)
Text2.Text = CStr(LEADRasterScr1.CaptureInfoLeft)
Text3.Text = CStr(LEADRasterScr1.CaptureInfoWidth)
Text4.Text = CStr(LEADRasterScr1.CaptureInfoHeight)

'reset area options
LEADRasterScr1.ResetAreaOptions


CaptureEXE Example for Visual Basic

LEADRasterScr1.TransparentColor = vbWhite

'capture by string resource id
LEADRasterScr1.CaptureEXE "c:\windows\calc.exe", SCR_CAP_ICON, "sc", False, False
LEADRasterView1.Raster .Bitmap = LEADRasterScr1.Bitmap
LEADRasterView1.Raster.BitmapTransparentColor = vbWhite
LEADRasterView1.Raster.BitmapEnableTransparency = True
MsgBox "wait"

'now, capture by numeric resource id
LEADRasterScr1.CaptureEXE "c:\windows\defrag.exe", SCR_CAP_ICON, "111", True, False
LEADRasterView1.Raster.Bitmap = LEADRasterScr1.Bitmap
MsgBox "wait"

'finally, capture by resource index
LEADRasterScr1.CaptureEXE "c:\win98\calc.exe", SCR_CAP_ICON, "0", True, True
LEADRasterView1.Raster.Bitmap = LEADRasterScr1.Bitmap
MsgBox "wait"


CaptureEXEDlg Example for Visual Basic

'display CaptureExe Dialog
LEADRasterScr1.CaptureEXEDlg hWnd, 0, "c:\windows\calc.exe", SCR_CAP_ALL, SCR_CAP_EXEDLG_TREEVIEW

'copy the captured image to a Main Control
LEADRasterView1.Raster .Bitmap = LEADRasterScr1.Bitmap

'display results
Text1.Text = CStr(LEADRasterScr1.CaptureInfoResType)
Text2.Text = CStr(LEADRasterScr1.CaptureInfoResIndex)
Text3.Text = CStr(LEADRasterScr1.CaptureInfoResourceId)
Text4.Text = LEADRasterScr1.CaptureInfoExeName


CaptureFullScreen Example for Visual Basic

'set a 3 sec delay
LEADRasterScr1.CaptureDelay = 3000
'capture the entire screen
LEADRasterScr1.CaptureFullScreen
'copy the captured image to a Main Control
LEADRasterView1.Raster .Bitmap = LEADRasterScr1.Bitmap


CaptureGetResourceCount Example for Visual Basic

Dim nCount As Integer

nCount = 0

'are there any icons in the file?
LEADRasterScr1.CaptureGetResourceCount "c:\win98\calc.exe", SCR_CAP_ICON
nCount = LEADRasterScr1.CaptureResourceCount
If (nCount < 1) Then
MsgBox "No Icons!"
End If


CaptureHotKey Example for Visual Basic

LEADRasterScr1.CaptureCount = 1
'set hotkey to Ctrl + F12
LEADRasterScr1.CaptureHotKey = vbKeyF12
LEADRasterScr1.CaptureHotKeyModifiers = SCR_MOD_CONTROL
LEADRasterScr1.CaptureArea SCR_CAP_AREA_RECT


CaptureHotKeyPressed Example for Visual Basic

Private Sub LEADRasterScr1_OnCaptureHotKeyPressed()
Dim ret As Integer
Dim bRet As Boolean
ret = MsgBox("Do you want to capture?", vbYesNo, "HotKey Pressed")
If ret = vbNo Then
'cancel capture
bRet = LEADRasterScr1.IsCaptureActive
If (bRet) Then
LEADRasterScr1.StopCapture
End If
End If
End Sub


CaptureImage Example for Visual Basic

Private Sub LEADRasterScr1_OnCaptureImage(ByVal CaptureNumber As Long)
'copy the captured image to a Main Control and save it
LEADRasterView1.Raster .Bitmap = LEADScr1.Bitmap
LRasterIO1.Save "d:\temp\test.tif", FILE_TIF, 0, 2, SAVE_APPEND
End Sub


CaptureMenuUnderCursor Example for Visual Basic

'set a 5 sec delay
LEADRasterScr1.CaptureDelay = 5000
'capture a menu
LEADRasterScr1.CaptureMenuUnderCursor
'copy the captured image to a Main Control
LEADRasterView1.Raster Bitmap = LEADRasterScr1.Bitmap


CaptureMouseCursor Example for Visual Basic

'capture current mouse cursor
LEADRasterScr1.CaptureMouseCursor
'copy the captured image to a Main Control
LEADRasterView1.Raster .Bitmap = LEADRasterScr1.Bitmap


CaptureObjectOptionDlg Example for Visual Basic

'display the capture selected object dialog
LEADRasterScr1.CaptureObjectOptionDlg hWnd, 0


CaptureOptionDlg Example for Visual Basic

Private Sub Command1_Click()
Dim nRet As Integer
'disable errors to check for cancel
LEADRasterScr1.EnableMethodErrors = False
LEADRasterScr1.ShowHelpButton = True
'display capture option dialog
nRet = LEADRasterScr1.CaptureOptionDlg(hWnd, 0)
If (nRet <> 0) Then
If (nRet <> ERROR_USER_ABORT) Then
MsgBox "Error setting options!"
End If
End If
End Sub

Private Sub LEADRasterScr1_ScreenDlgHelp(ByVal DlgFrom As Long, ByVal CtlID As Long)
'...
' set your code here
'...
'...
End Sub


CaptureSelectedObject Example for Visual Basic

'set custom cursor
LEADRasterScr1.CaptureObjectSelectCursor = LoadPicture("d:\temp\test.cur")
LEADRasterScr1.CaptureObjectSelectCursorIndex = 99

'disable invert colors
LEADRasterScr1.CaptureObjectInvert = False

'disable keyboard
LEADRasterScr1.CaptureObjectEnableKeyboard = False

'set object border width
LEADRasterScr1.CaptureObjectBorderWidth = 3

'do the capture
LEADRasterScr1.CaptureSelectedObject

'copy the captured image to a Main Control
LEADRasterView1.Raster .Bitmap = LEADRasterScr1.Bitmap

'reset options
LEADRasterScr1.ResetObjectOptions


CaptureWallPaper Example for Visual Basic

'capture the wallpaper
LEADRasterScr1.CaptureWallPaper
'copy the captured image to a Main Control
LEADRasterView1.Raster .Bitmap = LEADRasterScr1.Bitmap


CaptureWindowUnderCursor Example for Visual Basic

'set 3 sec delay
LEADRasterScr1.CaptureDelay = 3000

'capture window under cursor
LEADRasterScr1.CaptureWindowUnderCursor

'copy the captured image to a Main Control
LEADRasterView1.Raster .Bitmap = LEADRasterScr1.Bitmap


OptimizedHotkey Example for Visual Basic

Private WithEvents LEADScrCap1 As LEADRasterScr

Private Sub Form_Load()
Set LEADScrCap1 = New LEADRasterScr
End Sub

Private Sub Command1_Click()
'set cancel key to ESC
LEADScrCap1.CaptureCancelKey = vbKeyEscape

'set hotkey
LEADScrCap1.CaptureHotKey = vbKeyF11

'enable optimized hotkey
LEADScrCap1.OptimizedHotkey = True

'start the captures
LEADScrCap1.CaptureActiveWindow
End Sub

Private Sub LEADScrCap1_OnCaptureImage(ByVal CaptureNumber As Long)
'get the captured image here
LEADRasterView1.Raster.Bitmap = LEADScrCap1.Bitmap
End Sub


Tutorial for Visual C++ 5.0 Programmers

The following topics provide brief and simple examples to help you learn how to use the LEADTOOLS Screen Capture properties, methods, and events.

LEADTOOLS Screen Capture COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

Note:

These tutorial examples are not intended to demonstrate good Visual C++ program design. Instead, they are intended to be easy to understand and easy to test. The example programs in the EXAMPLES subdirectory are more representative of good design.

Capturing an Active Window

Capturing an Area

Capturing an Icon from an EXE

Capturing a Selected Object

Capturing Multiple Images

Displaying the Captured Images

Miscellaneous Examples


Capturing an Active Window (Visual C++ 5.0 and later)

Capturing an Active Window (Visual C++ 5 and later)

Take the following steps to start a project and to add some code that will let you capture an active window.

1. | Start a new project as follows:
 | Run Microsoft Visual C++ 5.0, select the File >New menu option, and do the following:
 | a. | Click the Projects tab.
 | b. | Select MFC AppWizard (exe) as the project type
 | c. | In the Project name text box, specify ScrCap.
 | d. | In the Location text box, specify the path of the project.
 | e. | Click the OK button.
2. | In the Step 1 dialog box, do the following:
 | a. | Select Dialog based.
 | b. | Click the Next button.
3. | In the Step 2 of 4 dialog box, do the following:
 | a. | Ensure that 3D controls is selected.
 | b. | Select ActiveX controls.
 | c. | Click the Next button.
4. | In the Step 3 of 4 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select As a shared DLL.
 | c. | Click the Next button.
5. | In the Step 4 of 4 dialog box, just click Finish. Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
6. | Add #import and #include statements to your program so you can access the LEAD COM constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file near //{{AFX_INSERT_LOCATION}} (keep in mind, you may have to change the path to where the dll's reside):

#import "c:\win98\system\ltrvr14n.dll" no_namespace, named_guids
#import "c:\win98\system\ltr14n.dll" no_namespace, named_guids
#import "c:\win98\system\ltrvw14n.ocx" no_namespace, named_guids
#import "c:\win98\system\ltrio14n.dll" no_namespace, named_guids
#import "c:\win98\system\ltrsc14n.dll" no_namespace, named_guids

7.

Edit the ScrCapDlg.cpp file and insert at the top of the file after the #include statement:

#include "leadraster.h"

8. | Add the LEAD Raster View Control (14) to your project:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the ScrCap resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_SCRCAP_DIALOG to design the dialog box.
 | e. | Select the TODO... text control; then press the Delete key to delete it.
 | f. | From the main menu, select Project > Add To Project > Components and controls.
 | g. | Select Registered ActiveX controls.
 | h. | Double-click the LEAD Raster View Control (14) icon. (The Confirm Classes dialog box appears.)
 | i. | Ensure that CLEADRasterView, CLEADRaster and CPicture are checked.
 | j. | Click OK to complete the selection. Click OK to insert the component.
 | k. | Click the LEAD RasterView Control icon; then size and position the control as you want it to appear at run time.
 | l. | Use the right mouse button to edit the properties of the new LEAD RasterView Control.
 | m. | Change the ID to IDC_LEADRASTERVIEW1.
9. | Add a command button and set the ID and Caption properties as follows:

 | ID | Caption
 | IDC_CAPWIN | Capture Window
10. | Edit the ScrCapDlg.h file and change the definition of CScrCapDlg : CDialog by inserting the following lines after DECLARE_MESSAGE_MAP():

public:
ILEADRasterScr *m_pLEADRasterScr;

11. | Do the following to add m_LEADRasterView1 to the ScrCapDlg class and link the variable to the LEAD RasterView control using dynamic data exchange:
 | a. | Press Ctrl-W. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CScrCapDlg.
 | d. | In the Control IDs list, select IDC_LEADRASTERVIEW1.
 | e. | Click the Add Variable... button.
 | f. | Specify m_LEADRasterView1 as the variable name, and Control as the category.
 | g. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
12. | Edit the ScrCapDlg.cpp file and add the following code to the end of the OnInitDialog function (just before return TRUE):

//Create the RasterScr object
CoCreateInstance(CLSID_LEADRasterScr, NULL, CLSCTX_ALL, IID_ILEADRasterScr, (void**)&m_pLEADRasterScr);

13. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CScrCapDlg.
 | b. | In the Object IDs list box, select CScrCapDlg.
 | c. | In the Messages list box, select WM_DESTROY.
 | d. | Click the Add function button. Choose OK for the default function name (OnDestroy).
 | e. | Click the Edit Code button to start entering the code.
 | f. | Enter new code as follows (just before the CDialog::OnDestroy call):

m_pLEADRasterScr->StopCapture ();
m_pLEADRasterScr->Release();

14. | Back in MFC Class Wizard, do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CScrCapDlg.
 | c. | In the Object IDs list box, select IDC_CAPWIN.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnCapwin).
 | f. | Click the Edit Code button and code the OnCapwin procedure as follows:

void CScrCapDlg::OnCapwin()
{
/* set the hot key to be F10 */
m_pLEADRasterScr->PutCaptureHotKey (121);
m_pLEADRasterScr->PutCaptureDelay (3000);
m_pLEADRasterScr->CaptureActiveWindow ();
m_LEADRasterView1.GetRaster
 ().SetBitmap
 (m_pLEADRasterScr->GetBitmap ());
}

15. | On the main menu, select Build> Build ScrCap.exe to build the project.
16. | On the main menu, select Build> Execute ScrCap.exe to run the project. Click the Capture Window command button, select the window to capture, press F10 and wait for 3 seconds.


Capturing an Area (Visual C++ 5.0 and later)

Capturing an Area (Visual C++ 5 and later)

Take the following steps to add some code that will let you capture a triangular area.

1. | Start with the project you created in Capturing an Active Window.
2. | Add a command button and set the ID and Caption properties as follows:
 | ID | Caption
 | IDC_CAPAREA | Capture Area

3. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CScrCapDlg.
 | c. | In the Object IDs list box, select IDC_CAPAREA.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnCaparea).
 | f. | Click the Edit Code button and code the OnCaparea procedure as follows:

void CScrCapDlg::OnCaparea()
{
m_pLEADRasterScr->PutScaleMode (SCALEMODE_PIXEL);

//set up the info window
m_pLEADRasterScr->PutCaptureAreaShowInfoWindow (TRUE);
m_pLEADRasterScr->PutCaptureAreaInfoTop (0.0f);
m_pLEADRasterScr->PutCaptureAreaInfoLeft (0.0f);
m_pLEADRasterScr->PutCaptureAreaInfoHeight (300.0f);
m_pLEADRasterScr->PutCaptureAreaInfoWidth (300.0f);

//show area size and cursor information on an opaque background
m_pLEADRasterScr->PutCaptureAreaShowAreaSize (TRUE);
m_pLEADRasterScr->PutCaptureAreaShowCursorPosition (TRUE);
m_pLEADRasterScr->PutCaptureAreaShowOpaqueText (TRUE);

//set text colors, fill colors, fill pattern, and line style
m_pLEADRasterScr->PutCaptureAreaDrawLineColor (RGB(0, 0, 0));
m_pLEADRasterScr->PutCaptureAreaTextBackColor (RGB(0, 0, 255));
m_pLEADRasterScr->PutCaptureAreaTextForeColor (RGB(255, 255, 255));
m_pLEADRasterScr->PutCaptureAreaFillBackColor (RGB(255, 0, 0));
m_pLEADRasterScr->PutCaptureAreaFillForeColor (RGB(0, 0, 255));
m_pLEADRasterScr->PutCaptureAreaFillPattern (CAPTURE_AREA_PATTERN_CROSS);
m_pLEADRasterScr->PutCaptureAreaDrawLineStyle (CAPTURE_AREA_LINE_DASH);|

//do not include the cursor in the image
m_pLEADRasterScr->PutCaptureAreaIncludeCursor (FALSE);

//do not enable the keyboard
m_pLEADRasterScr->PutCaptureAreaEnableKeyboard (FALSE);

//save a bitmap with a region
m_pLEADRasterScr->PutCaptureAreaBitmapWithRegion (TRUE);

//make the info window sensitive to the position of the cursor
m_pLEADRasterScr->PutCaptureAreaSensitiveInfoWindow (TRUE);

//zoom the image in the info window
m_pLEADRasterScr->PutCaptureAreaZoomFactor (CAPTURE_AREA_ZOOM_BY2X);

//use the cross lines cursor instead of the CaptureAreaDrawCursorIndex
m_pLEADRasterScr->PutCaptureAreaUseCrossLinesCursor(TRUE);
m_pLEADRasterScr->PutCaptureAreaShowDrawCursor (TRUE);

//capture a triangular area
m_pLEADRasterScr->CaptureArea (SCR_CAP_AREA_TRIANGLE);

//assign the Screen Capture Control bitmap to the Main Control bitmap
m_LEADRasterView1.GetRaster
 ().SetBitmap
 (m_pLEADRasterScr->GetBitmap ());
}

4. | On the main menu, select Build> Build ScrCap.exe to build the project.
5. | On the main menu, select Build> Execute ScrCap.exe to run the project. Click on Capture Area, press F11, and click and drag to select the area to capture.


Capturing an Icon from an EXE (Visual C++ 5.0 and later)

Capturing an Icon from an EXE (Visual C++ 5 and later)

Take the following steps to add some code that will let you capture icons from EXEs.

1. | Start with the project you created in Capturing an Active Window.
2. | Add a command button and set the ID and Caption properties as follows:
 | ID | Caption
 | IDC_CAPEXE | Capture EXE

3. | Back in MFC Class Wizard, do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CScrCapDlg.
 | c. | In the Object IDs list box, select IDC_CAPEXE.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnCapexe).
 | f. | Click the Edit Code button and code the OnCapexe procedure as follows:

void CScrCapDlg::OnCapexe()
{
short nCount = 0;

m_pLEADRasterScr->CaptureGetResourceCount ("c:\\win98\\calc.exe", SCR_CAP_ICON);
nCount = m_pLEADRasterScr->GetCaptureResourceCount ();
if (nCount < 1)
AfxMessageBox(TEXT("No Icons."));
else
{
m_pLEADRasterScr->PutTransparentColor (RGB(255,255, 255));
/*capture by string resource id */
/*Please note that the exe and id may not be the same on your system.*/
/*Be sure to replace this with a valid exe name and id for your system. */
m_pLEADRasterScr->CaptureEXE ("c:\\win98\\calc.exe", SCR_CAP_ICON, "sc", FALSE, FALSE);
m_LEADRasterView1.GetRaster().SetBitmap (m_pLEADRasterScr->GetBitmap ());

m_LEADRasterView1.GetRaster().SetBitmapTransparentColor (RGB(255, 255, 255));
m_LEADRasterView1.GetRaster().SetBitmapEnableTransparency (TRUE);
AfxMessageBox(TEXT("Wait"));
}

nCount = 0;

m_pLEADRasterScr->CaptureGetResourceCount ("c:\\win98\\defrag.exe", SCR_CAP_ICON);
nCount = m_pLEADRasterScr->GetCaptureResourceCount ();
if (nCount < 1)
AfxMessageBox(TEXT("No Icons."));
else
{
m_pLEADRasterScr->PutTransparentColor (RGB(255,255, 255));
/* now, capture by numeric resource id */
/*Please note that the exe and id may not be the same on your system.*/
/*Be sure to replace this with a valid exe name and id for your system. */
m_pLEADRasterScr->CaptureEXE ("c:\\win98\\defrag.exe", SCR_CAP_ICON, "113", TRUE, FALSE);
m_LEADRasterView1.GetRaster().SetBitmap (m_pLEADRasterScr->GetBitmap ());
m_LEADRasterView1.GetRaster().SetBitmapTransparentColor (RGB(255, 255, 255));
m_LEADRasterView1.GetRaster().SetBitmapEnableTransparency (TRUE);
AfxMessageBox(TEXT("Wait"));
}

nCount = 0;

m_pLEADRasterScr->CaptureGetResourceCount ("c:\\win98\\Explorer.exe", SCR_CAP_ICON);
nCount = m_pLEADRasterScr->GetCaptureResourceCount ();
if (nCount < 1)
AfxMessageBox(TEXT("No Icons."));

   else
{
m_pLEADRasterScr->PutTransparentColor (RGB(255,255, 255));
/* finally, capture by resource index */
/*Please note that the exe and id may not be the same on your system.*/
/*Be sure to replace this with a valid exe name and id for your system. */
m_pLEADRasterScr->CaptureEXE ("c:\\win98\\Explorer.exe", SCR_CAP_ICON, "0", TRUE, TRUE);
m_LEADRasterView1.GetRaster
 ().SetBitmap
 (m_pLEADRasterScr->GetBitmap ());
m_LEADRasterView1.GetRaster
 ().SetBitmapTransparentColor
  (RGB(255,255, 255));
m_LEADRasterView1.GetRaster
 ().SetBitmapEnableTransparency
  (TRUE);
AfxMessageBox(TEXT("Wait"));
}
}

4. | On the main menu, select Build> Build ScrCap.exe to build the project.
5. | On the main menu, select Build> Execute ScrCap.exe to run the project.


Capturing a Selected Object (Visual C++ 5.0 and later)

Capturing a Selected Object (Visual C++ 5 and later)

Take the following steps to add some code that will let you capture a selected object.

1. | Start with the project you created in Capturing an Active Window.
2. | Add a command button and set the ID and Caption properties as follows:
 | ID | Caption
 | IDC_CAPOBJ | Capture Object

3. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CScrCapDlg.
 | c. | In the Object IDs list box, select IDC_CAPOBJ.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnCapobj).
 | f. | Click the Edit Code button and code the OnCapobj procedure as follows:

void CScrCapDlg::OnCapobj()
{
/*display the capture selected object dialog*/
m_pLEADRasterScr->CaptureObjectOptionDlg ((long)this->m_hWnd);
/* capture the selected object */
m_pLEADRasterScr->CaptureSelectedObject ();
/* assign the screen control bitmap to the Main control bitmap */
m_LEADRasterView1.GetRaster
 ().SetBitmap
 (m_pLEADRasterScr->GetBitmap ());
/* reset the object options */
m_pLEADRasterScr->ResetObjectOptions ();
}

4. | On the main menu, select Build> Build ScrCap.exe to build the project.
5. | On the main menu, select Build> Execute ScrCap.exe to run the project. Click the Capture Select command button. Set the options. Click OK. Select the window containing the object you want to capture. Press F11. Move the cursor over the object you want to capture and click the left mouse button.


Capturing Multiple Images (Visual C++ 5.0 and later)

Capturing Multiple Images (Visual C++ 5 and later)

Take the following steps to add some code that will let you capture multiple images.

1. | Start with the project you created in Capturing an Icon from an EXE.
2. | Add two command buttons and set the ID and Caption properties as follows:
 | Name | Caption
 | IDC_CAPMULTI | Capture Multi
 | IDC_DISPLAY | Display Multi

3. | A sink interface must be added to receive CaptureImage events from the LEADRasterScr COM object. Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Add Class button.
 | b. | Click New....
 | c. | Type CRasterScrSink for the name of the class
 | d. | Select CCmdTarget for the base class of the new class.
 | e. | Under Automation, click the Automation radio button.
 | f. | Click OK to create the class.
 | g. | In the RasterScrSink.h file, move the destructor so that it is public:

// Implementation
virtual ~CRasterScrSink();
protected:

4. | Add code to handle the CaptureImage Event.
 | a. | Add the following code to RasterScrSink.cpp immediately before the END_DISPATCH_MAP() macro. The VT_EMPTY argument indicates that the CaptureImage Event has no return value. The VTS_I4 argument indicates the type of the CaptureImage Event argument:

DISP_FUNCTION_ID(CRasterScrSink, "CaptureImage", 1, OnCaptureImage, VT_EMPTY, VTS_I4)

b. | In RasterScrSink.cpp, modify the second parameter of the INTERFACE_PART macro to become as follows:
c. | INTERFACE_PART(CRasterScrSink, DIID__LTSCREvents, Dispatch)
d. | Click on the Class View tab in the project workspace.
e. | Right-click the "CRasterScrSink" branch, and choose Add Member Function.
f. | For Function Type enter void.
g. | For Function Declaration enter the following and click the OK button:

OnCaptureImage(long CaptureNumber)

h.

In the RasterScrSink.cpp file, add the following to the top of the file (after #include "RasterScrSink.h")

#include "ScrCapDlg.h"
#include "leadraster.h"

i.

In the RasterScrSink.h file, add the following to the top of the file:

class CScrCapDlg;

j.

In the RasterScrSink.h file, add the following to the CRasterScrSink class in the //Attributes public section:

CScrCapDlg *m_pDlg;

k.

Code the OnCaptureImage() method as follows:

void CRasterScrSink::OnCaptureImage (long CaptureNumber)
{
m_pDlg->m_LEADRasterView1.GetRaster
 ().SetBitmap
 (m_pDlg->m_pLEADRasterScr->GetBitmap ());
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->Save (m_pDlg->m_LEADRasterView1.GetRaster(), "D:\\Temp\\Multi.tif",FILE_TIF, 0, (QFactorConstants)2, SAVE_APPEND);
pRasterIO->Release();
}

5.

Add the following lines near the top of ScrCapDlg.cpp (just after #include "ScrCapDlg.h")

#include <afxctl.h>
#include "RasterScrSink.h"

6. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CScrCapDlg.
 | c. | In the Object IDs list box, select IDC_CAPMULTI.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnCapmulti).
 | f. | Click the Edit Code button and code the OnCapmulti procedure as follows:

void CScrCapDlg::OnCapmulti()
{
CRasterScrSink *pRasterScrSink;
DWORD dwCookie;

//Instantiate the sink class and hold a pointer to it.
pRasterScrSink = new CRasterScrSink;
pRasterScrSink->m_pDlg = this;
//Establish a connection between source and sink.
LPUNKNOWN pUnkSink = pRasterScrSink->GetIDispatch(FALSE);
AfxConnectionAdvise(m_pLEADRasterScr, DIID__LTSCREvents, pUnkSink, FALSE, &dwCookie);

//set the cancel key
m_pLEADRasterScr->PutCaptureCancelKey (VK_ESCAPE);
//set the delay, interval, and number of captures to perform
m_pLEADRasterScr->PutCaptureDelay (2000);
m_pLEADRasterScr->PutCaptureInterval(2000);
m_pLEADRasterScr->PutCaptureCount (3);

//capture
m_pLEADRasterScr->CaptureActiveClient ();

//Terminate connection between source and sink.
pUnkSink = pRasterScrSink->GetIDispatch(FALSE);
AfxConnectionUnadvise(m_pLEADRasterScr, DIID__LTSCREvents, pUnkSink, FALSE, dwCookie);
delete pRasterScrSink;
}

7. | Back in MFC Class Wizard, do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CScrCapDlg.
 | c. | In the Object IDs list box, select IDC_DISPLAY.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnDisplay).
 | f. | Click the Edit Code button and code the OnDisplay procedure as follows:

void CScrCapDlg::OnDisplay()
{
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->Load (m_LEADRasterView1.GetRaster(), "D:\\Temp\\Multi.tif", 0, 1, 1);
AfxMessageBox(TEXT("Loaded page 1"));
pRasterIO->Load(m_LEADRasterView1.GetRaster(), "D:\\Temp\\Multi.tif", 0, 2, 1);
AfxMessageBox(TEXT("Loaded page 2"));
pRasterIO->Load(m_LEADRasterView1.GetRaster(), "D:\\Temp\\Multi.tif", 0, 3, 1);
AfxMessageBox(TEXT("Loaded page 3"));
pRasterIO->Release();

DeleteFile (TEXT("D:\\Temp\\Multi.tif"));
}

8. | On the main menu, select Build> Build ScrCap.exe to build the project.
9. | On the main menu, select Build> Execute ScrCap.exe to run the project. Click on Capture Multi, press F11, and then select the window(s) you wish to capture, at the proper times. You may want to decrease the capture interval in the code. To view the images you captured, click on the Display command button after capturing has ended.


Displaying The Captured Images (Visual C++ 5.0 and later)

1. | Start with the project you created in Capturing Multiple Images
2. | Add code to handle the CaptureHotKeyPressed Event.
 | a. | Add the following code to RasterScrSink.cpp immediately before the END_DISPATCH_MAP() macro. The VT_EMPTY argument indicates that the CaptureImage Event has no return value. The VTS_NONE argument indicates that the CaptureHotKeyPressed Event has no argument:

DISP_FUNCTION_ID(CRasterScrSink, "CaptureHotKeyPressed", 2, OnCaptureHotKeyPressed, VT_EMPTY, VTS_NONE)

b. | Click on the Class View tab in the project workspace.
c. | Right-click the "CRasterScrSink" branch, and choose Add Member Function.
d. | For Function Type enter void.
e. | For Function Declaration enter the following and click the OK button:

OnCaptureHotKeyPressed()

f.

Code the OnCaptureHotKeyPressed() method as follows:

void CRasterScrSink::OnCaptureHotKeyPressed ()
{
int ret;

ret = ::MessageBox(NULL, TEXT("Do you want to capture?"), TEXT("Capture Key Pressed"), MB_YESNO);
if (ret == IDNO)
if(m_pDlg->m_pLEADRasterScr->IsCaptureActive ())
/*cancel the capture*/
m_pDlg->m_pLEADRasterScr->StopCapture ();
}

3 | On the main menu, select Build> Build ScrCap.exe to build the project
4 | On the main menu, select Build> Execute ScrCap.exe to run the project. Click on "Capture Multi", press F11, and then select the window(s) you wish to capture, at the proper times. To view the images you captured, click on the Display command button after capturing has ended.


Miscellaneous Examples (Visual C++ 5.0)

Miscellaneous Examples (C++ 5.0 and later)

LEADTOOLS Screen Capture COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

You can test the following examples by either adding a command button to one of the previous lessons in the tutorial and pasting the sample code in the Click procedure, or by cutting and pasting event code into the appropriate event in a lesson.

CaptureActiveClient Example for C++ 5.0 and later

CaptureActiveWindow Example for C++ 5.0 and later

CaptureArea Example for C++ 5.0 and later

CaptureAreaOptionDlg Example for C++ 5.0 and later

CaptureEXE Example for C++ 5.0 and later

CaptureEXEDlg Example for C++ 5.0 and later

CaptureFullScreen Example for C++ 5.0 and later

CaptureGetResourceCount Example for C++ 5.0 and later

CaptureHotKey Example for C++ 5.0 and later

CaptureMenuUnderCursor Example for C++ 5.0 and later

CaptureMouseCursor Example for C++ 5.0 and later

CaptureObjectOptionDlg Example for C++ 5.0 and later

CaptureOptionDlg Example for C++ 5.0 and later

CaptureSelectedObject Example for C++ 5.0 and later

CaptureWallPaper Example for C++ 5.0 and later

CaptureWindowUnderCursor Example for C++ 5.0 and later

OptimizedHotkey Example for C++ 5.0 and later


CaptureActiveClient Example for C++ 5.0 and later

    /*set Capture cursor*/
/*and include it in captured image*/
m_pRasterScr1.PutCaptureDelay(3000);
m_pRasterScr1.PutCaptureCursorIndex(1);
m_pRasterScr1.PutCaptureAreaIncludeCursor(TRUE);

/*capture the client area of the active window*/
m_pRasterScr1.CaptureActiveClient ();

/*copy the captured image to a Main Control*/
m_LEADRasterView1.GetRaster
 ().SetBitmap
  (m_pRasterScr1.GetBitmap ());


CaptureActiveWindow Example for C++ 5.0 and later

/*set status cursor*/
m_pRasterScr1.PutCaptureStatusCursorIndex(11);

/*set cancel key to ESC*/
m_pRasterScr1.PutCaptureCancelKey(VK_ESCAPE);

m_pRasterScr1.PutCaptureDelay(1000); /*wait 5 secs before starting*/
m_pRasterScr1.PutCaptureInterval(1000); /*capture every second*/
m_pRasterScr1.PutCaptureCount(25); /*capture 25 images*/

/*start the captures*/
m_pRasterScr1.CaptureActiveWindow();

/*display the results*/
CString csRes;

csRes.Format(TEXT("Window Handle:%d\n"), m_pRasterScr1.GetCaptureInfohWnd());
AfxMessageBox(csRes);


CaptureArea Example for C++ 5.0 and later

m_pRasterScr1.PutScaleMode(SCALEMODE_PIXEL);

//show area info window
m_pRasterScr1.PutCaptureAreaShowInfoWindow(TRUE);
//show area size during capture
m_pRasterScr1.PutCaptureAreaShowAreaSize(TRUE);
//enable sensitive area info window
m_pRasterScr1.PutCaptureAreaSensitiveInfoWindow(TRUE);

//set zoom factor
m_pRasterScr1.PutCaptureAreaZoomFactor(CAPTURE_AREA_ZOOM_BY3X);

//position capture area info window
m_pRasterScr1.PutCaptureAreaInfoTop(100.0f);
m_pRasterScr1.PutCaptureAreaInfoLeft(100.0f);
//size the capture area info window
m_pRasterScr1.PutCaptureAreaInfoWidth(100.0f);
m_pRasterScr1.PutCaptureAreaInfoHeight(200.0f);

//set colors
m_pRasterScr1.PutCaptureAreaDrawLineColor(RGB(0,0,0));
m_pRasterScr1.PutCaptureAreaTextForeColor(RGB(0,0,255));
m_pRasterScr1.PutCaptureAreaTextBackColor(RGB(0,0,0));

//capture with a region
m_pRasterScr1.PutCaptureAreaBitmapWithRegion(TRUE);

//show cursor position with opaque background
m_pRasterScr1.PutCaptureAreaShowCursorPosition(TRUE);
m_pRasterScr1.PutCaptureAreaShowOpaqueText(TRUE);

//disable keyboard
m_pRasterScr1.PutCaptureAreaEnableKeyboard(FALSE);

//do not include cursor in captured image
m_pRasterScr1.PutCaptureAreaIncludeCursor(FALSE);

//setup the background
m_pRasterScr1.PutCaptureAreaFillBackColor(RGB(255,0,0));
m_pRasterScr1.PutCaptureAreaFillForeColor(RGB(0,0,255));
m_pRasterScr1.PutCaptureAreaFillPattern(CAPTURE_AREA_PATTERN_DIAGCROSS);

//capture a round rect
m_pRasterScr1.PutCaptureAreaDrawLineStyle(CAPTURE_AREA_LINE_DASHDOT);
m_pRasterScr1.PutCaptureAreaDrawEllipseHeight(5.0f);
m_pRasterScr1.PutCaptureAreaDrawEllipseWidth(5.0f);

//show cursor while drawing
m_pRasterScr1.PutCaptureAreaUseCrossLinesCursor(FALSE);
m_pRasterScr1.PutCaptureAreaDrawCursorIndex(1);
m_pRasterScr1.PutCaptureAreaShowDrawCursor(TRUE);

//do the capture
m_pRasterScr1.CaptureArea(SCR_CAP_AREA_ROUNDRECT);

//copy the image to a Main Control
m_LEADRasterView1.GetRaster
 ().SetBitmap
 (m_pRasterScr1.GetBitmap ());


CaptureAreaOptionDlg Example for C++ 5.0 and later

    /*set options*/
m_pRasterScr1.CaptureAreaOptionDlg((long)this->m_hWnd, 0);
/*do a capture using these options*/
m_pRasterScr1.CaptureArea(m_pRasterScr1.GetCaptureAreaType ());

/*copy the captured image to a Main Control*/
m_LEADRasterView1.GetRaster
 ().SetBitmap
 (m_pRasterScr1.GetBitmap ());

/*display the capture result info*/
CString csRes;
csRes.Format(TEXT("Top: %f\nLeft: %f\nWidth: %f\nHeight: %f\n"),
m_pRasterScr1.GetCaptureInfoTop(),
m_pRasterScr1.GetCaptureInfoLeft(),
m_pRasterScr1.GetCaptureInfoWidth(),
m_pRasterScr1.GetCaptureInfoHeight());

AfxMessageBox(csRes);

/*reset area options*/
m_pRasterScr1.ResetAreaOptions();


CaptureEXE Example for C++ 5.0 and later

    m_pRasterScr1.PutTransparentColor(RGB(255,255,255));
/*capture by string resource id*/
m_pRasterScr1.CaptureEXE("c:\\windows\\calc.exe", SCR_CAP_ICON, "sc", FALSE, FALSE);
m_LEADRasterView1.GetRaster().SetBitmap
 (m_pRasterScr1.GetBitmap ());
AfxMessageBox(TEXT("Wait"));

/*now, capture by numeric resource id*/
m_pRasterScr1.CaptureEXE("c:\\windows\\defrag.exe", SCR_CAP_ICON, "111", TRUE, FALSE);
m_LEADRasterView1.GetRaster().SetBitmap(m_pRasterScr1.GetBitmap());
AfxMessageBox(TEXT("Wait"));

/*finally, capture by resource index*/
m_pRasterScr1.CaptureEXE("c:\\windows\\calc.exe", SCR_CAP_ICON, "0", -1, -1);
m_LEADRasterView1.GetRaster
 ().SetBitmap
 (m_pRasterScr1.GetBitmap ());
AfxMessageBox(TEXT("Wait"));


CaptureEXEDlg Example for C++ 5.0 and later

    /*display CaptureExe Dialog*/
m_pRasterScr1.CaptureEXEDlg((long)this->m_hWnd, 0, "c:\\windows\\calc.exe", SCR_CAP_ALL, SCR_CAP_EXEDLG_TREEVIEW);

/*copy the captured image to a Main Control*/
m_LEADRasterView1.GetRaster().SetBitmap
 (m_pRasterScr1.GetBitmap ());

/*display results*/
CString csRes;

csRes.Format(TEXT("ResType: %d\nResIndex: %d\nResID: %s\nExeName: %s\n"),
m_pRasterScr1.GetCaptureInfoResType(),
m_pRasterScr1.GetCaptureInfoResIndex(),
m_pRasterScr1.GetCaptureInfoResourceId(),
m_pRasterScr1.GetCaptureInfoExeName());
AfxMessageBox(csRes);


CaptureFullScreen Example for C++ 5.0 and later

    /*set a 3 sec delay*/
m_pRasterScr1.PutCaptureDelay(3000);
/*capture the entire screen*/
m_pRasterScr1.CaptureFullScreen();
/*copy the captured image to a Main Control*/
m_LEADRasterView1.GetRaster
 ().SetBitmap
 (m_pRasterScr1.GetBitmap ());


CaptureGetResourceCount Example for C++ 5.0 and later

short nCount;
nCount = 0;
/*are there any icons in the file?*/
m_pRasterScr1.CaptureGetResourceCount("c:\\windows\\calc.exe", SCR_CAP_ICON);
nCount = m_pRasterScr1.GetCaptureResourceCount();
if (nCount < 1)
AfxMessageBox(TEXT("No Icons!"));


CaptureHotKey Example for C++ 5.0 and later

m_pRasterScr1.PutCaptureCount(1);
/*set hotkey to Ctrl + F12*/
m_pRasterScr1.PutCaptureHotKey(123); /*F12*/
m_pRasterScr1.PutCaptureHotKeyModifiers(SCR_MOD_CONTROL);
m_pRasterScr1.CaptureArea(SCR_CAP_AREA_RECT);


CaptureMenuUnderCursor Example for C++ 5.0 and later

    /*set a 5 sec delay*/
m_pRasterScr1.PutCaptureDelay(5000);
/*capture a menu*/
m_pRasterScr1.CaptureMenuUnderCursor();
/*copy the captured image to a Main Control*/
m_LEADRasterView1.GetRaster
 ().SetBitmap(m_pRasterScr1.GetBitmap ());


CaptureMouseCursor Example for C++ 5.0 and later

    /*capture current mouse cursor*/
m_pRasterScr1.CaptureMouseCursor();
/*copy the captured image to a Main Control*/
m_LEADRasterView1.GetRaster
 ().SetBitmap
 (m_pRasterScr1.GetBitmap ());


CaptureObjectOptionDlg Example for C++ 5.0 and later

/*display the capture selected object dialog*/
m_pRasterScr1.CaptureObjectOptionDlg((long)this->m_hWnd, 0);


CaptureOptionDlg Example for C++ 5.0 and later

void CScrCapDlg::TestCapture()
{
short nRet;

m_pRasterScr->PutShowHelpButton(TRUE);
/*disable errors to check for cancel*/
m_pRasterScr->PutEnableMethodErrors(FALSE);
/*display capture option dialog*/
nRet = m_pRasterScr->CaptureOptionDlg((long)m_pMainWnd->m_hWnd, 0);
if (nRet != 0)
{
if (nRet != ERROR_USER_ABORT)
AfxMessageBox(TEXT("Error setting options!"));
}
}

void CRasterScrSink::OnScreenDlgHelp(long DlgFrom, long CtlID)
{
//...
// set your code ...
//...
}


CaptureSelectedObject Example for C++ 5.0 and later

    /*set cursor*/
m_pRasterScr1.PutCaptureObjectSelectCursorIndex(1);

/*disable invert colors*/
m_pRasterScr1.PutCaptureObjectInvert(FALSE);

/*disable keyboard*/
m_pRasterScr1.PutCaptureObjectEnableKeyboard(FALSE);

/*set object border width*/
m_pRasterScr1.PutCaptureObjectBorderWidth(3);

/*do the capture*/
m_pRasterScr1.CaptureSelectedObject();

/*copy the captured image to a Main Control*/
m_LEADRasterView1.GetRaster().SetBitmap
 (m_pRasterScr1.GetBitmap ());

/*reset options*/
m_pRasterScr1.ResetObjectOptions();


CaptureWallPaper Example for C++ 5.0 and later

    /*capture the wallpaper*/
m_pRasterScr1.CaptureWallPaper();
/*copy the captured image to a Main Control*/
m_LEADRasterView1.GetRaster
 ().SetBitmap
 (m_pRasterScr1.GetBitmap ());


CaptureWindowUnderCursor Example for C++ 5.0 and later

    /*set 3 sec delay*/
m_pRasterScr1.PutCaptureDelay(3000);

/*capture window under cursor*/
m_pRasterScr1.CaptureWindowUnderCursor();

/*copy the captured image to a Main Control*/
m_LEADRasterView1.GetRaster
 ().SetBitmap
 (m_pRasterScr1.GetBitmap ());


OptimizedHotkey Example for C++ 5.0 and later

//Create the RasterScr object
CoCreateInstance(CLSID_LEADRasterScr, NULL, CLSCTX_ALL, IID_ILEADRasterScr, (void**)&m_pLEADRasterScr);

void CMFCDlg::OnButton1()
{
//Instantiate the sink class and hold a pointer to it.
m_pRasterScrSink = new CRasterScrSink;
m_pRasterScrSink->m_pDlg = this;
//Establish a connection between source and sink.
LPUNKNOWN pUnkSink = m_pRasterScrSink->GetIDispatch(FALSE);
AfxConnectionAdvise(m_pLEADRasterScr, DIID__LTSCREvents, pUnkSink, FALSE, &m_dwCookie);

//set cancel key to ESC
m_pLEADRasterScr->CaptureCancelKey = VK_ESCAPE;

//set hotkey
m_pLEADRasterScr->CaptureHotKey = 123;/*F12*/

//enable optimized hotkey
m_pLEADRasterScr->OptimizedHotkey = TRUE;

//start the captures
m_pLEADRasterScr->CaptureActiveWindow();
}

void CMFCDlg::OnDestroy()
{
//Terminate connection between source and sink
LPUNKNOWN pUnkSink = m_pRasterScrSink->GetIDispatch(FALSE);
AfxConnectionUnadvise(m_pLEADRasterScr, DIID__LTSCREvents, pUnkSink, FALSE, m_dwCookie);
delete m_pRasterScrSink;

m_pLEADRasterScr->StopCapture ();
m_pLEADRasterScr->Release();
CDialog::OnDestroy();
}

void CRasterScrSink::OnCaptureImage(long CaptureNumber)
{
// get the captured image here
m_pDlg->m_LEADRasterView1.GetRaster().SetBitmap(m_pDlg->m_pLEADRasterScr->GetBitmap());
}


Bitmap property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | long Bitmap
Overview | Refer to Implementing Screen Capture

Remarks

A general property used by a number of methods, it is the handle to a LEAD bitmap. If the user assign from this property to the ILEADRaster Bitmap property, a copy of the image will be made in the target object.

See Also

Elements: | CaptureActiveClient method, CaptureActiveWindow method, CaptureArea method, CaptureFullScreen method, CaptureMenuUnderCursor method, CaptureWindowUnderCursor method, CaptureWallPaper, CaptureSelectedObject method, CaptureMouseCursor method, CaptureEXE method, CaptureEXEDlg method
Topics: | Screen Capture: Miscellaneous properties


CaptureActiveClient method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureActiveClient ();
Overview | Refer to Implementing Screen Capture

Remarks

Captures the currently active window's client area to the control's bitmap. Capture is performed using the hot key. By default, the hot key is F11.

Note:

The user must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before the user allows the main window/application to terminate.

See Also

Elements: | CaptureActiveWindow method, CaptureArea method, CaptureFullScreen method, CaptureMenuUnderCursor method, CaptureWindowUnderCursor method, CaptureWallPaper, CaptureSelectedObject method, CaptureMouseCursor method, CaptureOptionDlg method, CaptureAreaOptionDlg method, CaptureObjectOptionDlg method, CaptureEXE method, CaptureEXEDlg method, Bitmap, CaptureImage event
Topics: | Screen Capture: Capturing images


CaptureActiveWindow method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureActiveWindow ();
Overview | Refer to Implementing Screen Capture.

Remarks

Captures the currently active window to the control's bitmap. Capture is performed using the hot key. By default, the hot key is F11.

Note:

The user must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before the user allows the main window/application to terminate.

See Also

Elements: | CaptureActiveClient method, CaptureArea method, CaptureFullScreen method, CaptureMenuUnderCursor method, CaptureWindowUnderCursor method, CaptureWallPaper, CaptureSelectedObject method, CaptureMouseCursor method, CaptureOptionDlg method, CaptureAreaOptionDlg method, CaptureObjectOptionDlg method, CaptureEXE method, CaptureEXEDlg method, Bitmap, CaptureImage event
Topics: | Screen Capture: Capturing images


CaptureArea method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureArea (short iAreaType);
Overview | Refer to Implementing Screen Capture.

Remarks

Captures the specified type of area from the full screen. Any area outside the region will be filled according to the values set in the CaptureAreaFillPattern, CaptureAreaFillForeColor, and CaptureAreaFillBackColor properties.

If the CaptureAreaBitmapWithRegion property property is TRUE, the captured bitmap will contain a region of the specified shape.

Capture is performed using the hot key. By default, the hot key is F11.

Note:

The user must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before the user allows the main window/application to terminate.

See Also

Elements: | CaptureActiveClient method, CaptureActiveWindow method, CaptureFullScreen method, CaptureMenuUnderCursor method, CaptureWindowUnderCursor method, CaptureWallPaper, CaptureSelectedObject method, CaptureMouseCursor method, CaptureOptionDlg method, CaptureAreaOptionDlg method, CaptureObjectOptionDlg method, CaptureEXE method, CaptureEXEDlg method, CaptureAreaShowAreaSize property, CaptureAreaShowInfoWindow property, CaptureAreaSensitiveInfoWindow property, CaptureAreaInfoLeft property, CaptureAreaInfoTop property, CaptureAreaInfoWidth property, CaptureAreaIncludeCursor property, CaptureAreaDrawCursor property, CaptureAreaDrawCursorIndex property, CaptureAreaZoomFactor property, Bitmap, CaptureImage event
Topics: | Screen Capture: Capturing images


CaptureAreaBitmapWithRegion property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL CaptureAreaBitmapWithRegion
Overview | Refer to Implementing Screen Capture.

Remarks

Specifies whether the captured bitmap will contain a region selected by the user. Possible values are:

Setting | Description
TRUE | Bitmap will contain a region.
FALSE | Bitmap will not contain a region.

See Also

Elements: | CaptureArea method
Topics: | Screen Capture: Capture Area properties


CaptureAreaDrawCursor property (ILEADRasterScr)

Visual Basic example

Other systems

Syntax | lPictureDisp * CaptureAreaDrawCursor
Overview | Refer to Implementing Screen Capture.

Remarks

Sets a custom cursor used when drawing during CaptureArea.

The user can set this property to a cursor or icon file. Then, the user can set the CaptureAreaDrawCursorIndex property property to 99 to implement the custom mouse icon.

See Also

Elements: | CaptureAreaDrawCursorIndex property
Topics: | Screen Capture: Capture Area properties


CaptureAreaDrawCursorIndex property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureAreaDrawCursorIndex
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the value that indicates the type of mouse pointer used when drawing during CaptureArea method.

Setting | Description
0 | (Default) Shape determined by the object
1 | Arrow
2 | Cross-hair
3 | I-Beam
4 | Small square within a square
5 | Four-pointed arrow pointing north, south, east, and west
6 | Double arrow pointing northeast and southwest
7 | Double arrow pointing north and south
8 | Double arrow pointing northwest and southeast
9 | Double arrow pointing west and east
10 | Up Arrow
11 | Hourglass (wait)
12 | No Drop
13 | Arrow and hourglass
14 | Arrow and question mark
15 | Size all
99 | Custom icon specified by the CaptureAreaDrawCursor property

See Also

Elements: | CaptureAreaDrawCursor property
Topics: | Screen Capture: Capture Area properties


CaptureAreaDrawEllipseHeight property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | long CaptureAreaDrawEllipseHeight
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the height of the ellipse used to draw a rounded rectangle during CaptureArea.

See Also

Elements: | CaptureAreaDrawEllipseWidth property, CaptureArea method
Topics: | Screen Capture: Capture Area properties


CaptureAreaDrawEllipseWidth property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | long CaptureAreaDrawEllipseWidth
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the width of the ellipse used to draw a rounded rectangle during CaptureArea.

See Also

Elements: | CaptureAreaDrawEllipseHeight property, CaptureArea method
Topics: | Screen Capture: Capture Area properties


CaptureAreaDrawLineColor property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR CaptureAreaDrawLineColor
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the color of the line used for drawing during CaptureArea.

See Also

Elements: | CaptureAreaDrawLineStyle property, CaptureArea method
Topics: | Screen Capture: Capture Area properties


CaptureAreaDrawLineStyle property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | ScreenCaptureAreaLineConstants CaptureAreaDrawLineStyle
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the style of the line used for drawing during CaptureArea. Possible values are:

Setting | Description
CAPTURE_AREA_LINE_SOLID | [0x00] PS_SOLID /*________*/
CAPTURE_AREA_LINE_DASH | [0x01] PS_DASH /*----------*/
CAPTURE_AREA_LINE_DOT | [0x02] PS_DOT /*..........*/
CAPTURE_AREA_LINE_DASHDOT | [0x03] PS_DASHDOT /*-.-.-.-.-.*/
CAPTURE_AREA_LINE_DASHDOTDOT | [0x04] PS_DASHDOTDOT /*-..-..-*/

See Also

Elements: | CaptureAreaDrawLineColor property, CaptureArea method
Topics: | Screen Capture: Capture Area properties


CaptureAreaEnableKeyboard property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL CaptureAreaEnableKeyboard
Overview | Refer to Implementing Screen Capture.

Remarks

Specifies whether the keyboard is enabled during capture, allowing the use of the Shift, Control, +, and - keys. If this property is set to TRUE, these keys perform the following functions:

Key | Use
(+/-) | Zooming In/Out in the info window
(Ctrl) | If Area is Rect, RoundRect, or Ellipse, pressing CTRL will center the drawing
(Shift) | If Area is Rect, RoundRect, or Ellipse, pressing SHIFT will draw regular shapes (that is Ellipse becomes a circle, Rectangle becomes a Square, etc.)

Possible values for this property are:

Setting | Description
TRUE | Enable keyboard during capture.
FALSE | Disable keyboard during capture.

See Also

Topics:

Screen Capture: Capture Area properties


CaptureAreaFillBackColor property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR CaptureAreaFillBackColor
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the background’s color for the CaptureAreaFillPattern.

See Also

Elements: | CaptureAreaFillForeColor property, CaptureAreaFillPattern property, CaptureArea method
Topics: | Screen Capture: Capture Area properties


CaptureAreaFillForeColor property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | long CaptureAreaFillForeColor
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the foreground’s color for the CaptureAreaFillPattern.

See Also

Elements: | CaptureAreaFillBackColor property, CaptureAreaFillPattern property, CaptureArea method
Topics: | Screen Capture: Capture Area properties


CaptureAreaFillPattern property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | ScreenCaptureAreaPatternConstants CaptureAreaFillPattern
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the pattern used to fill the outside of the captured area. Possible values are:

Setting | Description
CAPTURE_AREA_PATTERN_HORIZONTAL | [0x00] HS_HORIZONTAL /* ----- */
CAPTURE_AREA_PATTERN_VERTICAL | [0x01] HS_VERTICAL /* ||||| */
CAPTURE_AREA_PATTERN_FDIAGONAL | [0x02] HS_FDIAGONAL /* \\\\\ */
CAPTURE_AREA_PATTERN_BDIAGONAL | [0x03] HS_BDIAGONAL /* ///// */
CAPTURE_AREA_PATTERN_CROSS | [0x04] HS_CROSS /* +++++ */
CAPTURE_AREA_PATTERN_DIAGCROSS | [0x05] HS_DIAGCROSS /* xxxxx */
CAPTURE_AREA_PATTERN_SOLID | [0x06] HS_DIAGCROSS+1 /*Solid Fill*/

See Also

Elements: | CaptureAreaFillBackColor property, CaptureAreaFillForeColor property, CaptureArea method
Topics: | Screen Capture: Capture Area properties


CaptureAreaIncludeCursor property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL CaptureAreaIncludeCursor
Overview | Refer to Implementing Screen Capture.

Remarks

Specifies whether to place the cursor on the captured image. The cursor is set using the CaptureCursor property. Possible values are:

Setting | Description
TRUE | Place the cursor on the captured image.
FALSE | Do not place the cursor on the captured image.

See Also

Elements: | CaptureCursor property
Topics: | Screen Capture: Capture Area properties


CaptureAreaInfoHeight property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | float CaptureAreaInfoHeight
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the height of the information window.

See Also

Elements: | CaptureAreaInfoTop property, CaptureAreaInfoLeft property, CaptureAreaInfoWidth property, CaptureArea method, CaptureAreaShowInfoWindow property
Topics: | Screen Capture: Capture Area properties


CaptureAreaInfoLeft property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | float CaptureAreaInfoLeft
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the left position of the information window.

See Also

Elements: | CaptureAreaInfoTop property, CaptureAreaInfoHeight property, CaptureAreaInfoWidth property
Topics: | Screen Capture: Capture Area properties


CaptureAreaInfoTop property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | float CaptureAreaInfoTop
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the top position of the information window.

See Also

Elements: | CaptureAreaInfoLeft property, CaptureAreaInfoHeight property, CaptureAreaInfoWidth property
Topics: | Screen Capture: Capture Area properties


CaptureAreaInfoWidth property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | float CaptureAreaInfoWidth
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the width of the information window.

See Also

Elements: | CaptureAreaInfoTop property, CaptureAreaInfoHeight property, CaptureAreaInfoLeft property
Topics: | Screen Capture: Capture Area properties


CaptureAreaOptionDlg method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureAreaOptionDlg (long hWndParent, long lFlags);
Overview | Refer to Implementing Screen Capture.

Remarks

Brings up the Capture Area Option dialog box for setting the capture area options. The capture area option properties are:

CaptureAreaFillPattern | CaptureAreaFillForeColor
CaptureAreaFillBackColor | CaptureAreaDrawLineStyle
CaptureAreaDrawLineColor | CaptureAreaDrawEllipseWidth
CaptureAreaDrawEllipseHeight | CaptureAreaDrawCursorIndex
CaptureAreaDrawCursor | CaptureAreaTextForeColor
CaptureAreaTextBackColor | CaptureAreaInfoLeft
CaptureAreaInfoTop | CaptureAreaInfoWidth
CaptureAreaInfoHeight | CaptureAreaShowDrawCursor
CaptureAreaIncludeCursor | CaptureAreaEnableKeyboard
CaptureAreaShowOpaqueText | CaptureAreaShowCursorPosition
CaptureAreaShowAreaSize | CaptureAreaShowInfoWindow
CaptureAreaSensitiveInfoWindow | CaptureAreaBitmapWithRegion

CaptureAreaZoomFactor

See Also

Elements: | CaptureActiveClient method, CaptureActiveWindow method, CaptureFullScreen method, CaptureMenuUnderCursor method, CaptureWindowUnderCursor method, CaptureWallPaper, CaptureSelectedObject method, CaptureMouseCursor method, CaptureOptionDlg method, CaptureAreaOptionDlg method, CaptureObjectOptionDlg method, CaptureEXE method, CaptureEXEDlg method, Bitmap, CaptureImage event
Topics: | Screen Capture: Capture Area properties


CaptureAreaSensitiveInfoWindow property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL CaptureAreaSensitiveInfoWindow
Overview | Refer to Implementing Screen Capture.

Remarks

Specifies whether sensitive detection for the information window is enabled. If the information window is sensitive, it will jump to a new location when the cursor approaches it. Possible values for this property are:

Setting | Description
TRUE | Sensitive detection is enabled.
FALSE | Sensitive detection is disabled.

See Also

Elements: | CaptureArea method, CaptureAreaShowInfoWindow property
Topics: | Screen Capture: Capture Area properties


CaptureAreaShowAreaSize property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL CaptureAreaShowAreaSize
Overview | Refer to Implementing Screen Capture.

Remarks

Specifies whether to display the captured area size. Possible values are:

Setting | Description
TRUE | Display the captured area size.
FALSE | Do not display the captured area size.

See Also

Elements: | CaptureAreaShowCursorPosition property, CaptureAreaShowInfoWindow property, CaptureAreaShowOpaqueText property, CaptureAreaTextBackColor property, CaptureAreaTextForeColor property, CaptureArea method
Topics: | Screen Capture: Capture Area properties


CaptureAreaShowCursorPosition property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL CaptureAreaShowCursorPosition
Overview | Refer to Implementing Screen Capture.

Remarks

Specifies whether to display the cursor position. Possible values are:

Setting | Description
TRUE | Display the cursor position.
FALSE | Do not display the cursor position.

See Also

Elements: | CaptureAreaShowAreaSize property, CaptureAreaShowInfoWindow property, CaptureAreaShowOpaqueText property, CaptureAreaTextBackColor property, CaptureAreaTextForeColor property, CaptureArea method
Topics: | Screen Capture: Capture Area properties


CaptureAreaShowDrawCursor property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL CaptureAreaShowDrawCursor
Overview | Refer to Implementing Screen Capture.

Remarks

Specifies whether to display the cursor during drawing. Set the desired cursor using the CaptureCursor property. Possible values are:

Setting | Description
TRUE | Display the cursor during capture.
FALSE | Do not display the cursor during capture.

See Also

Elements: | CaptureCursor property, CaptureArea method
Topics: | Screen Capture: Capture Area properties


CaptureAreaShowInfoWindow property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL CaptureAreaShowInfoWindow
Overview | Refer to Implementing Screen Capture.

Remarks

Specifies whether to display the information window. Possible values are:

Setting | Description
TRUE | Display the information window.
FALSE | Do not display the information window.

See Also

Elements: | CaptureArea method, CaptureInfoHeight property, CaptureInfohWnd property, CaptureInfoLeft property, CaptureInfoTop property, CaptureInfoWidth property, CaptureInfoResIndex property, CaptureInfoResourceId property, CaptureInfoResType property, CaptureInfoExeName property
Topics: | Screen Capture: Capture Area properties


CaptureAreaShowOpaqueText property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL CaptureAreaShowOpaqueText
Overview | Refer to Implementing Screen Capture.

Remarks

Specifies whether to display the cursor position and area size on an opaque background. Possible values are:

Setting | Description
TRUE | Use an opaque background when displaying the cursor position and area size.
FALSE | Use a transparent background when displaying the cursor position and area size.

See Also

Elements: | CaptureAreaTextBackColor property, CaptureAreaShowAreaSize property, CaptureAreaShowCursorPosition property, CaptureAreaTextForeColor property, CaptureArea method
Topics: | Screen Capture: Capture Area properties


CaptureAreaTextBackColor property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR CaptureAreaTextBackColor
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the background’s color to use when displaying the cursor position and area size.

See Also

Elements: | CaptureAreaShowAreaSize property, CaptureAreaShowCursorPosition property, CaptureAreaShowOpaqueText property, CaptureAreaTextForeColor property, CaptureArea method
Topics: | Screen Capture: Capture Area properties


CaptureAreaTextForeColor property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR CaptureAreaTextForeColor
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the foreground’s color to use when displaying the cursor position and area size.

See Also

Elements: | CaptureAreaShowAreaSize property, CaptureAreaShowCursorPosition property, CaptureAreaShowOpaqueText property, CaptureAreaTextBackColor property, CaptureArea method
Topics: | Screen Capture: Capture Area properties


CaptureAreaType property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | ScreenCaptureAreaTypes CaptureAreaType
Overview | Refer to Implementing Screen Capture.

Remarks

(Read only) Indicates the user's choice for type of Area to capture from the dialog displayed by the CaptureAreaOptionDlg method. Possible values are:

Setting | Description
SCR_CAP_AREA_TRIANGLE | [0x01] Triangle type
SCR_CAP_AREA_RECT | [0x02] Rectangle type
SCR_CAP_AREA_ROUNDRECT | [0x03] Rounded rectangle type
SCR_CAP_AREA_ELLIPSE | [0x04] Ellipse type
SCR_CAP_AREA_POLYGON | [0x05] Polygon type
SCR_CAP_AREA_FREEHAND | [0x06] Freehand type

See Also

Elements: | CaptureArea method
Topics: | Screen Capture: Getting and Setting Options


CaptureAreaUseCrossLinesCursor property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL CaptureAreaUseCrossLinesCursor
Overview | Refer to Implementing Screen Capture.

Remarks

Specifies whether the CaptureArea method will use cross lines instead of the cursor specified in CaptureAreaDrawCursorIndex. If is TRUE, the cross lines will be used instead of a cursor. If FALSE, the cursor specified by CaptureAreaDrawCursorIndex will be used.

See Also

Elements: | CaptureArea method
Topics: | Screen Capture: Capture Area properties


CaptureAreaZoomFactor property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureAreaZoomFactor
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the zoom factor for the information window. Possible values are:

Setting | Meaning
CAPTURE_AREA_ZOOM_NORM | [1] the image is not zoomed
CAPTURE_AREA_ZOOM_BY2X | [2] the images is zoomed 2X
CAPTURE_AREA_ZOOM_BY3X | [3] the images is zoomed 3X
CAPTURE_AREA_ZOOM_BY4X | [4] the images is zoomed 4X
CAPTURE_AREA_ZOOM_BY5X | [5] the images is zoomed 5X
CAPTURE_AREA_ZOOM_BY6X | [6] the images is zoomed 6X
CAPTURE_AREA_ZOOM_BY7X | [7] the images is zoomed 7X
CAPTURE_AREA_ZOOM_BY8X | [8] the images is zoomed 8X
CAPTURE_AREA_ZOOM_BY9X | [9] the images is zoomed 9X
CAPTURE_AREA_ZOOM_BY10X | [10] the images is zoomed 10X
CAPTURE_AREA_ZOOM_BY11X | [11] the images is zoomed 11X
CAPTURE_AREA_ZOOM_BY12X | [12] the images is zoomed 12X
CAPTURE_AREA_ZOOM_BY13X | [13] the images is zoomed 13X
CAPTURE_AREA_ZOOM_BY14X | [14] the images is zoomed 14X
CAPTURE_AREA_ZOOM_BY15X | [15] the images is zoomed 15X

See Also

Elements: | CaptureArea method
Topics: | Screen Capture: Capture Area properties


CaptureCancelKey property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureCancelKey
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the key used to cancel the capture operation.

The user cannot set this to 'ALT' (VbKeyMenu). If the user does, it will be ignored, and set to 'ESC' (VbKeyEsc).

See Also

Elements: | StopCapture method, IsCaptureActive method
Topics: | Screen Capture: Miscellaneous properties


CaptureCount property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureCount
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the number of times to perform capture.

See Also

Elements: | CaptureImage event, CaptureInterval property
Topics: | Screen Capture: Multi-capture properties


CaptureCursor property (ILEADRasterScr)

Visual Basic example

Other systems

Syntax | IPictureDisp * CaptureCursor
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the cursor to use during capture. This cursor will be placed on the image if the CaptureAreaIncludeCursor property is set to TRUE.

See Also

Elements: | CaptureCursorIndex property, CaptureAreaIncludeCursor property
Topics: | Screen Capture: Miscellaneous properties


CaptureCursorIndex property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureCursorIndex
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the value that indicates the type of mouse pointer used when capturing.

Setting | Meaning
0 | (Default) Shape determined by the object
1 | Arrow
2 | Cross-hair
3 | I-Beam
4 | Small square within a square
5 | Four-pointed arrow pointing north, south, east, and west
6 | Double arrow pointing northeast and southwest
7 | Double arrow pointing north and south
8 | Double arrow pointing northwest and southeast
9 | Double arrow pointing west and east
10 | Up Arrow
11 | Hourglass (wait)
12 | No Drop
13 | Arrow and hourglass
14 | Arrow and question mark
15 | Size all
99 | Custom icon specified by the CaptureCursor property

See Also

Elements | CaptureCursor property
Topics: | Screen Capture: Miscellaneous properties


CaptureDelay property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | long CaptureDelay
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the number of milliseconds to wait before capturing.

See Also

Elements: | CaptureInterval property, CaptureCount property, CaptureImage event
Topics: | Screen Capture: Miscellaneous properties


CaptureEXE method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureEXE (BSTR pszFileName, ScreenCaptureResourceTypes ResourceType, BSTR pszResourceID, int bIsNumberResourceID, int bCaptureByIndex);
Overview | Refer to Implementing Screen Capture.

Remarks

Captures the resource identified by pszResourceID and iResType from the specified executable file.

If the user wants to pass a string ID in pszResourceID, then set bIsNumberResourceID to FALSE and set bCaptureByIndex to FALSE.

If the user wants pass a numeric ID in pszResourceID, then set bIsNumberResourceID to TRUE and set bCaptureByIndex to FALSE.

If the user wants pass an index in pszResourceID, then set bIsNumberResourceID to TRUE and set bCaptureByIndex to TRUE.

This method does not require the use of the hot key for capture.

See Also

Elements: | CaptureEXEDlg method, Bitmap property, CaptureActiveClient method, CaptureActiveWindow method, CaptureFullScreen method, CaptureMenuUnderCursor method, CaptureWindowUnderCursor method, CaptureWallPaper, CaptureSelectedObject method, CaptureMouseCursor method, CaptureOptionDlg method, CaptureAreaOptionDlg method, CaptureObjectOptionDlg method CaptureImage event
Topics: | Screen Capture: Capturing images


CaptureEXEDlg method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureEXEDlg (long hWndParent, long lFlags, BSTR pszFileName, ScreenCaptureResourceTypes ResourceType, ScreenCaptureExeDlgTypes DialogType);
Overview | Refer to Implementing Screen Capture.

Remarks

Brings up a dialog box for getting resource information and then captures the specified resource from an EXE or DLL.

This method does not require the use of the hot key for capture.

See Also

Elements: | CaptureEXE method, Bitmap property, CaptureActiveClient method, CaptureActiveWindow method, CaptureFullScreen method, CaptureMenuUnderCursor method, CaptureWindowUnderCursor method, CaptureWallPaper, CaptureSelectedObject method, CaptureMouseCursor method, CaptureOptionDlg method, CaptureAreaOptionDlg method, CaptureObjectOptionDlg method, CaptureImage event
Topics: | Screen Capture: Capturing images


CaptureFullScreen method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureFullScreen ();
Overview | Refer to Implementing Screen Capture.

Remarks

Captures the full screen to the control's bitmap. Capture is performed using the hot key. By default, the hot key is F11.

Note:

The user must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before the user allows the main window/application to terminate.

See Also

Elements: | CaptureEXEDlg method, Bitmap property, CaptureActiveClient method, CaptureActiveWindow method, CaptureEXE method, CaptureMenuUnderCursor method, CaptureWindowUnderCursor method, CaptureWallPaper, CaptureSelectedObject method, CaptureMouseCursor method, CaptureOptionDlg method, CaptureAreaOptionDlg method, CaptureObjectOptionDlg method, CaptureImage event
Topics: | Screen Capture: Capturing images


CaptureGetResourceCount method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureGetResourceCount (BSTR pszFileName, ScreenCaptureResourceTypes ResourceType);
Overview | Refer to Implementing Screen Capture.

Remarks

Fills the CaptureResourceCount property with the number of resources of the specified type in the specified file.

Read the CaptureResourceCount property after calling this method to get the number of resources of the specified type in the specified file.

See Also

Elements: | CaptureEXE method, CaptureEXEDlg method, Bitmap property, CaptureImage event, CaptureResourceCount property
Topics: | Screen Capture: Getting and Setting Options


CaptureHotKey property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureHotKey
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the key code for the hot key. The default hot key is F11.

Note:

The user must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before the user allows the main window/application to terminate.

See Also

Elements: | CaptureHotKeyModifiers property
Topics: | Screen Capture: Hot Key properties


CaptureHotKeyModifiers property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureHotKeyModifiers
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the modifier keys used with the CaptureHotKey. Possible values are listed below. These values may be combined.

Note:

The user must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before the user allows the main window/application to terminate.

Setting | Description
SCR_MOD_ALT | [0x0001] Alt key
SCR_MOD_CONTROL | [0x0002] Control key
SCR_MOD_SHIFT | [0x0004] Shift key

See Also

Elements: | CaptureHotKey property, CaptureHotKeyPressed event
Topics: | Screen Capture: Hot Key properties


CaptureHotKeyPressed event (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | void CaptureHotKeyPressed ();
Overview | Refer to Implementing Screen Capture.

Remarks

Occurs when the CaptureHotKey property is pressed.

The user can use this event to initialize any variables or properties before beginning capture.

The user can stop a multi capture operation by calling the StopCapture method.

See Also

Elements: | CaptureHotKey property, CaptureHotKeyModifiers property
Topics: | Screen Capture: Hot Key properties


CaptureImage event (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | void CaptureImage (long CaptureNumber);
Overview | Refer to Implementing Screen Capture.

Remarks

Occurs for each image is captured, using any of the capture methods.

The user can use this event to copy, display, save, or otherwise handle the images that are captured during a multi capture operation.

The user can stop a multi capture operation by calling the StopCapture method.

See Also

Elements: | CaptureEXEDlg method, Bitmap property, CaptureActiveClient method, CaptureActiveWindow method, CaptureEXE method, CaptureMenuUnderCursor method, CaptureWindowUnderCursor method, CaptureWallPaper, CaptureSelectedObject method, CaptureMouseCursor method, CaptureOptionDlg method, CaptureAreaOptionDlg method, CaptureObjectOptionDlg method, CaptureFullScreen method
Topics: | Screen Capture: Capturing images


CaptureInfoExeName property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR CaptureInfoExeName
Overview | Refer to Implementing Screen Capture.

Remarks

(Read only) Gets the name of the EXE or DLL from which a resource was captured.

See Also

Elements: | CaptureEXE method, CaptureEXEDlg method
Topics: | Screen Capture: Capture information properties


CaptureInfoHeight property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | float CaptureInfoHeight
Overview | Refer to Implementing Screen Capture.

Remarks

(Read only) Gets the height of the capture. The unit of measure is determined by the ScaleMode.

See Also

Elements: | CaptureInfoLeft property, CaptureInfoTop property, CaptureInfoWidth property
Topics: | Screen Capture: Capture information properties


CaptureInfohWnd property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | long CaptureInfohWnd
Overview | Refer to Implementing Screen Capture.

Remarks

(Read only) Gets the handle to the window that was captured. This property is set after a successful image capture.

See Also

Elements: | CaptureActiveWindow method, CaptureActiveClient method
Topics: | Screen Capture: Capture information properties


CaptureInfoLeft property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | float CaptureInfoLeft
Overview | Refer to Implementing Screen Capture.

Remarks

(Read only) Gets the X coordinate of the origin of the capture. The coordinate is relative to the full screen. The unit of measure is determined by the ScaleMode property.

See Also

Elements: | CaptureInfoHeight property, CaptureInfoTop property, CaptureInfoWidth property
Topics: | Screen Capture: Capture information properties


CaptureInfoResIndex property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | long CaptureInfoResIndex
Overview | Refer to Implementing Screen Capture.

Remarks

(Read only) Gets the index of the resource captured from an EXE or a DLL. Resource indexes start at 0.

See Also

Elements: | CaptureEXE method, CaptureEXEDlg method, CaptureInfoResType property, CaptureInfoResourceID property, CaptureInfoExeName property, CaptureInfohWnd property, CaptureInfoTop property, CaptureInfoLeft property, CaptureInfoWidth property, CaptureInfoHeight property
Topics: | Screen Capture: Capture information properties


CaptureInfoResourceId property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR CaptureInfoResourceId
Overview | Refer to Implementing Screen Capture.

Remarks

(Read only) Gets the ID of the resource captured from an EXE or a DLL.

See Also

Elements: | CaptureEXE method, CaptureEXEDlg method, CaptureInfoResType property, CaptureInfoResIndex property, CaptureInfoExeName property, CaptureInfohWnd property, CaptureInfoTop property, CaptureInfoLeft property, CaptureInfoWidth property, CaptureInfoHeight property
Topics: | Screen Capture: Capture information properties


CaptureInfoResType property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | ScreenCaptureResourceTypes CaptureInfoResType
Overview | Refer to Implementing Screen Capture.

Remarks

Gets the type of resource captured from an EXE or a DLL. Possible values are:

Setting | Description
SCR_CAP_ALL | [0x00] All resource types
SCR_CAP_BITMAP | [0x01] Bitmap resource type
SCR_CAP_ICON | [0x02] Icon resource type
SCR_CAP_CURSOR | [0x04] Cursor resource type

See Also

Elements: | CaptureEXE method, CaptureEXEDlg method, CaptureInfoResIndex property, CaptureInfoResourceID property, CaptureInfoExeName property, CaptureInfohWnd property, CaptureInfoTop property, CaptureInfoLeft property, CaptureInfoWidth property, CaptureInfoHeight property
Topics: | Screen Capture: Capture information properties


CaptureInfoTop property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | float CaptureInfoTop
Overview | Refer to Implementing Screen Capture.

Remarks

(Read only) Gets the Y coordinate of the origin of the capture. The coordinate is relative to the full screen. The unit of measure is determined by the ScaleMode.

See Also

Elements: | CaptureInfoHeight property, CaptureInfoLeft property, CaptureInfoWidth property
Topics: | Screen Capture: Capture information properties


CaptureInfoWidth property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | float CaptureInfoWidth
Overview | Refer to Implementing Screen Capture.

Remarks

(Read only) Gets the width of the capture. The unit of measure is determined by the ScaleMode.

See Also

Elements: | CaptureInfoHeight property, CaptureInfoLeft property, CaptureInfoTop property
Topics: | Screen Capture: Capture information properties


CaptureInterval property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | long CaptureInterval
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the number of milliseconds between captures in a multi-capture operation.

See Also

Elements: | CaptureDelay property, CaptureCount property, CaptureImage event
Topics: | Screen Capture: Multi-capture properties


CaptureMenuUnderCursor method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureMenuUnderCursor ();
Overview | Refer to Implementing Screen Capture.

Remarks

Captures the menu under the cursor to the control's bitmap. Capture is performed using the hot key. By default, the hot key is F11.

Note:

The user must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before the user allows the main window/application to terminate.

See Also

Elements: | CaptureEXEDlg method, Bitmap property, CaptureActiveClient method, CaptureActiveWindow method, CaptureFullScreen method, CaptureEXE method, CaptureWindowUnderCursor method, CaptureWallPaper, CaptureSelectedObject method, CaptureMouseCursor method, CaptureOptionDlg method, CaptureAreaOptionDlg method, CaptureObjectOptionDlg method, CaptureImage event
Topics: | Screen Capture: Capturing images


CaptureMouseCursor method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureMouseCursor ();
Overview | Refer to Implementing Screen Capture.

Remarks

Captures the mouse cursor to the control's bitmap. Capture is performed using the hot key. By default, the hot key is F11.

Note:

The user must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before the user allows the main window/application to terminate.

See Also

Elements: | CaptureEXEDlg method, Bitmap property, CaptureActiveClient method, CaptureActiveWindow method, CaptureFullScreen method, CaptureMenuUnderCursor method, CaptureWindowUnderCursor method, CaptureWallPaper, CaptureSelectedObject method, CaptureEXE method, CaptureOptionDlg method, CaptureAreaOptionDlg method, CaptureObjectOptionDlg method, CaptureImage event
Topics: | Screen Capture: Capturing images


CaptureObjectBorderWidth property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureObjectBorderWidth
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the width of the border drawn around the selected object. This property is used only if the CaptureObjectInvert property is set to FALSE.

This property is always measured in pixels.

See Also

Elements: | CaptureObjectInvert property, CaptureObjectEnableKeyboard property, CaptureObjectSelectCursorIndex property, CaptureObjectSelectCursor property
Topics: | Screen Capture: Capture Object properties


CaptureObjectEnableKeyboard property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL CaptureObjectEnableKeyboard
Overview | Refer to Implementing Screen Capture.

Remarks

Specifies whether to enable the keyboard during selection. If this property is set to TRUE, then pressing the Shift key will select the client area of the object. Possible values are:

Setting | Description
TRUE | Enable the keyboard.
FALSE | Disable the keyboard.

See Also

Elements: | CaptureObjectInvert property, CaptureObjectBorderWidth property, CaptureObjectSelectCursorIndex property, CaptureObjectSelectCursor property
Topics: | Screen Capture: Capture Object properties


CaptureObjectInvert property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL CaptureObjectInvert
Overview | Refer to Implementing Screen Capture.

Remarks

Specifies whether to invert colors for the current selected objects. If this property is set to TRUE, the colors will be inverted when selected. If this property is set to FALSE, the colors are not inverted and the value of CaptureObjectBorderWidth property will be used to draw a border will be drawn around the selected objects.

See Also

Elements: | CaptureObjectEnableKeyboard property, CaptureObjectBorderWidth property, CaptureObjectSelectCursorIndex property, CaptureObjectSelectCursor property
Topics: | Screen Capture: Capture Object properties


CaptureObjectOptionDlg method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureObjectOptionDlg (long hWndParent, long lFlags);
Overview | Refer to Implementing Screen Capture.

Remarks

Brings up the Capture Object Options dialog box for setting the capture object options. The capture object option properties are: CaptureObjectInvert, CaptureObjectEnableKeyboard, CaptureObjectBorderWidth, CaptureObjectSelectCursorIndex, and CaptureObjectSelectCursor.

See Also

Elements: | CaptureSelectedObject method, CaptureImage event
Topics: | Screen Capture: Getting and Setting Options


CaptureObjectSelectCursor property (ILEADRasterScr)

Visual Basic example

Other systems

Syntax | lPictureDisp * CaptureObjectSelectCursor
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the cursor to use during the selection of objects.

See Also

Elements: | CaptureObjectSelectCursorIndex property
Topics: | Screen Capture: Capture Object properties


CaptureObjectSelectCursorIndex property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureObjectSelectCursorIndex
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the value that indicates the type of mouse pointer used when selecting objects.

Setting | Description
0 | (Default) Shape determined by the object
1 | Arrow
2 | Cross-hair
3 | I-Beam
4 | Small square within a square
5 | Four-pointed arrow pointing north, south, east, and west
6 | Double arrow pointing northeast and southwest
7 | Double arrow pointing north and south
8 | Double arrow pointing northwest and southeast
9 | Double arrow pointing west and east
10 | Up Arrow
11 | Hourglass (wait)
12 | No Drop
13 | Arrow and hourglass
14 | Arrow and question mark
15 | Size all
99 | Custom icon specified by the CaptureObjectSelectCursor property.

See Also

Elements: | CaptureObjectSelectCursor property
Topics: | Screen Capture: Capture Object properties


CaptureOptionDlg method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureOptionDlg (long hWndParent, long lFlags);
Overview | Refer to Implementing Screen Capture.

Remarks

Brings up the Capture Option dialog box for setting capture options. The Capture Option properties are:

CaptureCursorIndex | CaptureCursor
CaptureStatusCursor | CaptureStatusCursorIndex
CaptureHotKey | CaptureHotKeyModifiers
CaptureCancelKey | CaptureDelay
CaptureCount | CaptureInterval

Note:

The user must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before the user allows the main window/application to terminate.

See Also

Elements: | CaptureEXEDlg method, Bitmap property, CaptureActiveClient method, CaptureActiveWindow method, CaptureFullScreen method, CaptureMenuUnderCursor method, CaptureWindowUnderCursor method, CaptureWallPaper, CaptureSelectedObject method, CaptureMouseCursor method, CaptureEXE method, CaptureAreaOptionDlg method, CaptureObjectOptionDlg method, CaptureImage event
Topics: | Screen Capture: Getting and Setting Options


CaptureResourceCount property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureResourceCount
Overview | Refer to Implementing Screen Capture.

Remarks

(Read Only) Gets the number of resources available in the EXE. This property is filled by calling CaptureGetResourceCount.

See Also

Elements: | CaptureEXE method, CaptureEXEDlg method, Bitmap property, CaptureImage event, CaptureGetResCount method
Topics: | Screen Capture: Miscellaneous properties


CaptureSelectedObject method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureSelectedObject ();
Overview | Refer to Implementing Screen Capture.

Remarks

Captures the currently selected window's object to the control's bitmap. Objects can be buttons, client areas, toolbars, controls, scrollbars, etc. Capture is performed using the hot key. By default, the hot key is F11. The object is then selected by clicking the left mouse button.

Note:

The user must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before the user allows the main window/application to terminate.

See Also

Elements: | CaptureEXEDlg method, Bitmap property, CaptureActiveClient method, CaptureActiveWindow method, CaptureFullScreen method, CaptureMenuUnderCursor method, CaptureWindowUnderCursor method, CaptureWallPaper, CaptureEXE method, CaptureMouseCursor method, CaptureOptionDlg method, CaptureAreaOptionDlg method, CaptureObjectOptionDlg method, CaptureImage event
Topics: | Screen Capture: Capturing images


CaptureStatusCursor property (ILEADRasterScr)

Visual Basic example

Other systems

Syntax | lPictureDisp * CaptureStatusCursor
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the cursor to use between multiple captures.

See Also

Elements: | CaptureStatusCursorIndex property
Topics: | Screen Capture: Miscellaneous properties


CaptureStatusCursorIndex property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureStatusCursorIndex
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the value that indicates the type of mouse pointer used between multiple captures.

Setting | Description
0 | (Default) Shape determined by the object
1 | Arrow
2 | Cross-hair
3 | I-Beam
4 | Small square within a square
5 | Four-pointed arrow pointing north, south, east, and west
6 | Double arrow pointing northeast and southwest
7 | Double arrow pointing north and south
8 | Double arrow pointing northwest and southeast
9 | Double arrow pointing west and east
10 | Up Arrow
11 | Hourglass (wait)
12 | No Drop
13 | Arrow and hourglass
14 | Arrow and question mark
15 | Size all
99 | Custom icon specified by the CaptureStatusCursor property

See Also

Elements: | CaptureStatusCursor property
Topics: | Screen Capture: Miscellaneous properties


CaptureWallPaper method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureWallPaper ();
Overview | Refer to Implementing Screen Capture.

Remarks

Captures the current wallpaper image to the control's bitmap. Capture is performed using the hot key. By default, the hot key is F11.

Note:

The user must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before the user allows the main window/application to terminate.

See Also

Elements: | CaptureEXEDlg method, Bitmap property, CaptureActiveClient method, CaptureActiveWindow method, CaptureFullScreen method, CaptureMenuUnderCursor method, CaptureWindowUnderCursor method, CaptureEXE, CaptureSelectedObject method, CaptureMouseCursor method, CaptureOptionDlg method, CaptureAreaOptionDlg method, CaptureObjectOptionDlg method, CaptureImage event
Topics: | Screen Capture: Capturing images


CaptureWindowUnderCursor method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | short CaptureWindowUnderCursor ();
Overview | Refer to Implementing Screen Capture.

Remarks

Captures the window under the cursor to the control's bitmap. Capture is performed using the hot key. By default, the hot key is F11.

Note:

The user must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before the user allows the main window/application to terminate.

See Also

Elements: | CaptureEXEDlg method, Bitmap property, CaptureActiveClient method, CaptureActiveWindow method, CaptureFullScreen method, CaptureMenuUnderCursor method, CaptureEXE method, CaptureWallPaper, CaptureSelectedObject method, CaptureMouseCursor method, CaptureOptionDlg method, CaptureAreaOptionDlg method, CaptureObjectOptionDlg method, CaptureImage event
Topics: | Screen Capture: Capturing images


EnableMethodErrors property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableMethodErrors
Overview | Refer to Implementing Screen Capture.

Remarks

Specifies whether LEADTOOLS generates runtime exceptions (in addition to method return values). If EnableMethodErrors is TRUE, the runtime exceptions will be generated. If FALSE, they will not be generated.

See Also

Topics:

Screen Capture: Miscellaneous properties


IsCaptureActive method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL IsCaptureActive ();
Overview | Refer to Implementing Screen Capture.

Remarks

Indicates whether a capture operation has been started or not.

Note:

The user must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before the user allows the main window/application to terminate.

See Also

Elements: | CaptureHotKey property, CaptureHotKeyPressed event
Topics: | Screen Capture: Capturing images


OptimizedHotkey property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL OptimizedHotkey
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets a value that indicates whether to optimize hotkey processing. Possible values are:

Setting | Description
TRUE | Optimize hotkey processing.
FALSE | Use normal hotkey processing.

Normally, when a capture method is called, the method enters a loop, and waits for the hot key specified in the CaptureHotKey property to be pressed, before capturing. This loop can cause the CPU usage indicator to appear maxed out. Setting this property to TRUE will cause the capture function to return immediately, if a hotkey has been specified in the CaptureHotKey property. In this case, a global system hotkey hook is established and used to wait for the hotkey to be pressed. When the hotkey is pressed, the capture is performed and the CaptureImage is fired. Use this option only if the normal behavior is causing your application problems. This option is ignored in Win95/98/Me.

See Also

Elements: | CaptureHotKey property, CaptureHotKeyModifiers property, CaptureHotKeyPressed property, CaptureActiveClient method, CaptureActiveWindow method, CaptureArea, CaptureEXE method, CaptureFullScreen method, CaptureMenuUnderCursor method, CaptureMouseCursor method, CaptureSelectedObject method, CaptureWallPaper method, CaptureWindowUnderCursor method
Topics: | Screen Capture: Hot Key Properties


ResetAreaOptions method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | void ResetAreaOptions ();
Overview | Refer to Implementing Screen Capture.

Remarks

Resets the area option properties to their default values. These properties are:

CaptureAreaFillPattern | CaptureAreaFillForeColor
CaptureAreaFillBackColor | CaptureAreaDrawLineStyle
CaptureAreaDrawLineColor | CaptureAreaDrawEllipseWidth
CaptureAreaDrawEllipseHeight | CaptureAreaDrawCursorIndex
CaptureAreaDrawCursor | CaptureAreaTextForeColor
CaptureAreaTextBackColor | CaptureAreaInfoLeft
CaptureAreaInfoTop | CaptureAreaInfoWidth
CaptureAreaInfoHeight | CaptureAreaShowDrawCursor
CaptureAreaIncludeCursor | CaptureAreaEnableKeyboard
CaptureAreaShowOpaqueText | CaptureAreaShowCursorPosition
CaptureAreaShowAreaSize | CaptureAreaShowInfoWindow
CaptureAreaSensitiveInfoWindow | CaptureAreaBitmapWithRegion

CaptureAreaZoomFactor

See Also

Topics:

Screen Capture: Getting and Setting Options


ResetObjectOptions method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | void ResetObjectOptions ();
Overview | Refer to Implementing Screen Capture.

Remarks

Resets the object option properties to their defaults. These properties are:

CaptureObjectInvert | CaptureObjectEnableKeyboard
CaptureObjectBorderWidth | CaptureObjectSelectCursorIndex

CaptureObjectSelectCursor

See Also

Topics:

Screen Capture: Getting and Setting Options


ScaleMode property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | RasterScaleModeConstants ScaleMode
Overview | Refer to Implementing Screen Capture.

Remarks

Specifies the unit of measure for the Screen Control.

The user can change the unit of measure at any time without affecting measurements that the control maintains. The control accepts values and converts them to pixels internally. This means, for example, that if the user set a property value in twips, the value that the user gets back may be slightly different, since it is rounded to the nearest pixel. Possible values are:

Setting | Description
1 | Twips (1440 twips per logical inch; 567 twips per logical centimeter).
2 | Points (72 points per logical inch).
3 | Pixels (smallest unit of monitor or printer resolution).
4 | Characters (horizontal = 120 twips per unit; vertical = 240 twips per unit).
5 | Inches.
6 | Millimeters.
7 | Centimeters.

See Also

Topics:

Screen Capture: Miscellaneous properties


ScreenDlgHelp event (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | void ScreenDlgHelp(long DlgFrom, long CtlID);
Overview | Refer to Implementing Screen Capture.

Remarks

Occurs when the user clicks on the Help button on any dialog.

To enable a help button in a dialog, ShowHelpButton property must be set to TRUE.

See Also

Elements | CaptureOptionDlg method, CaptureAreaOptionDlg method, CaptureObjectOptionDlg method, CaptureEXEDlg method, ShowHelpButton property
Topics: | Screen Capture: Providing Help


ShowHelpButton property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | BOOL ShowHelpButton
Overview | Refer to Implementing Screen Capture.

Remarks

Specifies whether to display the Help button in the dialogs. Possible values are:

Setting | Description
TRUE | Display the Help button in the dialogs.
FALSE | Do not display the Help button in the dialogs, and the ScreenDlgHelpevent will not be available for the dialogs.

Used by Screen Capture Dialog methods.

See Also

Elements: | CaptureOptionDlg method, CaptureAreaOptionDlg method, CaptureObjectOptionDlg method, CaptureEXEDlg method, ScreenDlgHelp event
Topics: | Screen Capture: Providing Help


StopCapture method (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | void StopCapture ();
Overview | Refer to Implementing Screen Capture.

Remarks

Stops the capture process.

Note:

The user must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before the user allows the main window/application to terminate.

See Also

Elements: | CaptureHotKey property, CaptureHotKeyPressed event, IsCaptureActive method
Topics: | Screen Capture: Capturing images


TransparentColor property (ILEADRasterScr)

Visual Basic example

Visual C++ 5.0 example

Syntax | OLE_COLOR TransparentColor
Overview | Refer to Implementing Screen Capture.

Remarks

Gets or sets the color to use when filling the transparent area of a captured icon or cursor resource.

See Also

Elements: | CaptureEXE method, CaptureEXEDlg method
Topics: | Screen Capture: Miscellaneous properties


LEADTOOLS Documentation

LEADTOOLS Reference Manuals

LEADTOOLS provides reference manuals that contain the same information as the online help. You can print them from PDF files. Please note that due to the large size of the PDF files that contain the LEADTOOLS manuals, these files are no longer included in the setup. Instead, these PDF files can be downloaded from our website at http://support.leadtools.com/SupportPortal/DesktopDefault.aspx?tabindex=3&tabid=27.

To print the PDF files, you must use the Adobe Acrobat Reader 3.0 or higher. You can download a copy of the Acrobat Reader from the Adobe web site (http://www.adobe.com). Note that different versions of the Acrobat Reader are available for different operating systems, but they all can read the same PDF files.


Raster Pro/Document/Medical Features

Raster Pro:

LEADTOOLS Raster Imaging Pro provides some imaging capabilities that are not available in the LEADTOOLS Raster Imaging product. In order to access these features, you must unlock them by calling UnlockSupport (L_SUPPORT_LTPRO, L_KEY_LTPRO). L_KEY_LTPRO can be found in ltkey.h.

If you are a licensed user of LEADTOOLS Raster Imaging, and would like to access Raster Imaging Pro features, you must contact Tech Support for information on obtaining a license and the unlock key for calling LSettings::UnlockSupport.

Document/Medical:

LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite are the most comprehensive imaging toolkits on the market. No other toolkit provides as many imaging features for color, gray-scale and black & white images in one development package, and for one price. These toolkits comprise LEAD's best code and are designed for the programmer who is looking for the fastest performance, and/or the most extensive color, document, and medical imaging capabilities available.

These toolkits contain powerful annotation capabilities and optimized document image processing filters, and high performance compression, decompression and viewing of JPEG, LEAD CMP, MRC and CCITT G3/G4. The annotation capabilities enable the programmer to add text, highlights, sticky notes, audio, ellipses, buttons, lines, arrows, rectangles, polygons, redaction (blackout), hotspots, freehand scribble, pointers, bitmap and text stamps, to black & white and color images. Programmers working with document imaging will also find special processing filters such as despeckle, deskew, favor black, and scale to gray to enhance their black and white 1 bit images. Additionally, you can achieve faster rotation in 90-degree increments by applying a rotated view perspective to the bitmap. These LEADTOOLS toolkits offer the fastest software-only JPEG decoder available.

LEADTOOLS Document Imaging

The LEADTOOLS Document Imaging toolkit contains all the features available in the LEADTOOLS Raster Imaging Pro. In addition, it contains the following capabilities:

Special functions for Document (bitonal) images. The LEADTOOLS functions for bitonal images are especially useful for working with images from black-and-white scanners or FAX machines. These functions let you do things such as automatically straighten (deskew) an image, remove spots (despeckle), or clarify a scaled display (using scale-to-gray and favor-black features).

Annotation. LEADTOOLS supports annotation of images by letting you overlay images with text, lines, shapes, arrows, buttons, highlights, hot spots, sticky notes, stamps, buttons, and sounds.

Fast rotation. LEADTOOLS achieves fast rotation in 90-degree increments by applying a rotated view perspective to the bitmap.

ISIS support. LEADTOOLS supports ISIS interfaces for driving scanning devices.

Faster compression and decompression. The Document/Medical editions work faster when loading and saving LEAD CMP, JPEG, and CCITT Group 3 and Group 4 images. The LEADTOOLS functions for loading and saving are the same in all products. The only difference is in performance.

1-bit Image Clean-up. The Document toolkits include support for removing dots, blobs, holes, inverted text, lines, borders, bumps and nicks from 1-bit images.

Region Clean-up. [Document/Medical] Remove all the holes from a region.

Embedded Messages. The Document toolkits include support for embedding messages in lossless image formats like bmp, tiff, lossless jpeg, etc. The message is embedded without any visible changes to the image, and does not appreciably increase the size of the image. The message is password-protected.

Image Conversion. The Document toolkits include support for transforming a bitmap into a binary image using specified thresholds or a threshold calculated automatically based on statistical features of the bitmap.

12 and 16 bit grayscale images. [Document/Medical] Load, process, display, window level and save 12 and 16 bit grayscale images (including support for 16-bit grayscale TIFF).

48 and 64 bit color images. [Document/Medical] Load, process, display, and save 48 and 64 bit color images.

MRC Support. [Document/Medical] LEADTOOLS supports the Mixed Raster Content format for color documents containing mixed image and text components. For more information, refer to the .

Halftoning. [Document/Medical] Convert 1-, 4-, 8-, 16-, 24-, or 32-bit bitmaps to a halftoned bitmap, with a specified pattern rotation. A halftoned bitmap is a 1-bit bitmap that has been dithered for black and white printing or display.

LEADTOOLS Document Imaging Suite

The LEADTOOLS Document Imaging Suite toolkit contains all the capabilities of LEADTOOLS Document Imaging, and includes the features listed below. Please note that the OCR features are included in this toolkit, however they can also be purchased as a plug-in for the LEADTOOLS Document Imaging toolkit. Also, JBIG support is provided in this toolkit, however a JBIG Module may be added on to LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging or LEADTOOLS Medical Imaging Suite.

OCR features. [Document/Medical] LEAD offers OCR features that use Scansoft Textbridge technology. Support for these features is included in the LEADTOOLS Document Imaging Suite, and can be added, via plug-in to the LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite toolkits. The OCR features allow you to perform optical character recognition and turn images into documents. Features include preset confidence and accuracy levels for controlling how sensitive the engine is to unrecognized text, artificial intelligence for improving recognition on documents of the same type, and built-in and user-defined lexicons for limiting the type of text to recognize within a particular zone. LEADTOOLS provides the ability to verify or correct text during, and (using LEAD's unique OCR editor) after recognition. LEAD's OCR editor ties the text being edited directly to the image, providing a visual reference to the original bitmap data. The OCR engine can perform Automatic area segmentation creating multi-layered zones, recognizing areas such as tables, rules, images and text. Or, you can manually designate up to 250 such zones. The OCR features support different fonts, sizes (5 to 72 point) and styles. Fax, dot matrix and halftones can be preprocessed to improve recognition results. The OCR Engine supports major European and Scandinavian languages (Danish, Dutch, Finnish, French, German, Italian, Norwegian, Portuguese, Russian, Spanish, and Swedish) as well as English. Support for dialects such as US. English, French Canadian, Latin American Spanish, Swiss German, and Brazilian Portuguese is also provided.

Recognized text can be exported to more than 40 different formats, including MS Word, MS Excel, Dbase andWordPerfect. The LEADTOOLS OCR features contain superior OCR processing speeds, for use in form recognition and processing applications.

LEAD's JBIG filter. [Document/Medical] LEAD includes support for this filter in the LEADTOOLS Document Imaging Suite toolkit. Support for this filter can be added to LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging or LEADTOOLS Medical Imaging Suite by purchasing the JBIG Module. JBIG defines a method for lossless compression encoding of a bi-level image (two-color image). This method can also be used for coding grayscale and color images. LEADTOOLS completely supports all three types of images, giving you the ability to make full use of this powerful compression technology. LEADTOOLS also supports the progressive capability of JBIG, allowing you to store and send multiple representations of images at different resolutions without any extra storage overhead.

LEADTOOLS Medical Imaging

LEADTOOLS Medical Imaging contains all the capabilities of LEADTOOLS Document Imaging. It also includes general medical imaging technologies (1-16,24,32 bit color, 1-16 bit grayscale and window leveling of 12 and 16-bit grayscale images) and support for the DICOM file format.

DICOM file support. [Medical] LEADTOOLS Medical Imaging provides COMPLETE support for the DICOM 3.0 specification, including all standard IOD classes and modalities (CR, CT, MR, NM, US, RF, SC, VL, etc.) and complete DICOM Basic Directory support.

Window leveling. [Document/Medical] Detect and set LowBit and HighBit for image data, display images with automatic LUT intensity expansion, or set LUT entries and ranges with specific values and gradients. Display images through the LUT without changing the data, or process the image data using the LUT. Linearize the number of pixels locally in a bitmap, based on the specified color space in order to bring out the detail in dark areas of an image, and smooth the edges between blocks.

Medical Imaging Processing. [Medical] LEADTOOLS Medical Imaging provides image processing functionality designed specifically to allow you to examine and improve the quality of medical images.

LEADTOOLS Medical Imaging Suite

LEADTOOLS Medical Imaging Suite contains all the capabilities of LEADTOOLS Medical Imaging. In addition, it supports the following:

DICOM Communication support. [Medical Suite] LEADTOOLS provides COMPLETE support for DICOM Communications, including all Service Classes (Verification, Storage, Query/Retrieve, Patient Management, etc), and contains high-level communications functions simplifying the creation of DICOM client/server applications.

(Document/Medical) is used in the documentation to designate the features that are available in LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite. Those features that are available only in the Medical toolkits are indicated in the documentation by (Medical). Features available only in the LEADTOOLS Medical Imaging Suite toolkit are indicated in the documentation by (Medical Suite).

(Internet only) is used in the documentation to designate the features that are available only in the LEADTOOLS Internet toolkit.

For more information, refer to Document/Medical Edition Support and Licensing Requirements.


Document/Medical Support and Licensing Requirements

Document/Medical Licensing and Royalty Agreements:

Congratulations! You have licensed one of the LEADTOOLS Document/Medical software products, the most comprehensive imaging toolkits on the market, enabling you to create powerful imaging applications. The license terms for LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite require runtime licensing based on the number of copies of your application that you deploy (i.e., distribute or install and use internally).

By paying the initial box price for the applicable LEADTOOLS product, you have obtained a development license, which entitles you to develop your application and test it. Once completed, if you wish to distribute the application or deploy it internally on multiple machines, you are required to enter into a duplication and distribution agreement with LEAD. You have the ability to choose from several licensing options depending on your volume needs.

The product you are installing is a fully functional working version and includes support for all features in LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite. (Depending on which product you have licensed, some of the features may ultimately not be available to you. See the on-line help file for a product feature comparison.) Until you sign and return the correct licensing agreement, your application will display a "nag" message. Once LEAD receives the executed contract, we will provide you a password that will permit you to terminate the "nag" message for the product that you have licensed. In addition to providing the password, you must also use the no nag version of the LTKRN14n.dll, found in the REDIST\NONAGLTKRN directory. This is also the version you must redistribute.

Duplication and Distribution Agreements

Click this button to start the Licensing help file to review the License Agreements governing your use of the software.


Syntax

This is the internal syntax of the property, method, or event. The external syntax depends on the development system you are using. Refer to the code example for your system, or for general information, refer to the following:


Visual Basic Constants for Key Codes

Do the following to find the Visual Basic key codes:

1. | On the View pull-down menu, select Object Browser....
2. | Select VB - Visual Basic objects and procedures.
3. | Select VBKeyCodeConstants.
4. | Select one of the listed constants.

A description of the constant appears at the bottom of the form.


Visual C++ Key Codes

The following are the Visual C++ key codes:

VK_A through VK_Z are the same as their ASCII equivalents: 'A' thru 'Z'.
VK_0 through VK_9 are the same as their ASCII equivalents: '0' thru '9'.
VK_LBUTTON
VK_RBUTTON
VK_CANCEL
VK_MBUTTON
VK_BACK
VK_TAB
VK_CLEAR
VK_RETURN
VK_SHIFT
VK_CONTROL
VK_MENU
VK_PAUSE
VK_CAPITAL
VK_ESCAPE
VK_SPACE
VK_PRIOR
VK_NEXT
VK_END
VK_HOME
VK_LEFT
VK_UP
VK_RIGHT
VK_DOWN
VK_SELECT
VK_PRINT
VK_EXECUTE
VK_SNAPSHOT
VK_INSERT
VK_DELETE
VK_HELP

VK_NUMPAD0
VK_NUMPAD1
VK_NUMPAD2
VK_NUMPAD3
VK_NUMPAD4
VK_NUMPAD5
VK_NUMPAD6
VK_NUMPAD7
VK_NUMPAD8
VK_NUMPAD9
VK_MULTIPLY
VK_ADD
VK_SEPARATOR
VK_SUBTRACT
VK_DECIMAL
VK_DIVIDE
VK_F1
VK_F2
VK_F3
VK_F4
VK_F5
VK_F6
VK_F7
VK_F8
VK_F9
VK_F10
VK_F11
VK_F12
VK_F13
VK_F14
VK_F15
VK_F16
VK_F17
VK_F18
VK_F19
VK_F20
VK_F21
VK_F22
VK_F23
VK_F24
VK_NUMLOCK
VK_SCROLL


Topic Selection

LEAD Technologies, Inc.
Suite 400
1201 Greenwood Cliff
Charlotte, NC 28204

Sales@Leadtools.com
www.leadtools.com

(704) 332-5532
FAX: (704) 372-8161
Tech Support: (704) 372-9681

LEADTOOLS is ideal for developers involved in still frame, multimedia, document, medical, and vector imaging projects, including Internet/Intranet applications. Independent of the specific application requirement – scanning, file format support/conversion, compression, image processing, annotation, database support, multimedia, etc. – LEADTOOLS provides the most comprehensive, robust, flexible, and powerful imaging solution available.

Click this button to start the Licensing help file to review the License Agreements governing your use of the software.

Click this button to start the Products help file to review the full line of LEADTOOLS Products.

Click this button to start the Imaging help file to review the full line of LEADTOOLS Image Categories.


.topic 0x10000000
 Visual Basic Only
 LEADTOOLS methods that reference picture objects were developed for Visual Basic. Picture objects in other development systems have not worked in tests and do not appear to be compatible.


Return for CaptureActiveClient

Return Value

Value | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes.


Return for CaptureActiveWindow

Return Value

Value | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes.


iAreaType Parameter For CaptureArea

iAreaType

Type of area to capture. Possible values are:

Setting | Description
SCR_CAP_AREA_TRIANGLE | [0x01] Triangle type
SCR_CAP_AREA_RECT | [0x02] Rectangle type
SCR_CAP_AREA_ROUNDRECT | [0x03] Rounded rectangle type
SCR_CAP_AREA_ELLIPSE | [0x04] Ellipse type
SCR_CAP_AREA_POLYGON | [0x05] Polygon type
SCR_CAP_AREA_FREEHAND | [0x06] Freehand type


hWndParent Parameter For CaptureAreaOptionDlg

hWndParent

Window handle of the dialog's parent.


lFlags Parameter For CaptureAreaOptionDlg

lFlags

Flags that specify the function behavior. Possible values are:

Value | Meaning
0 | Ignore this flag. Pass this if you do not wish to use this flag.
SCRDLG_CAPTUREAREAOPTION_CONTEXTHELP | [0x0002] Show the context help button.


Return for CaptureAreaOptionDlg

Return Value

Value | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes.


Return for CaptureArea

Return Value

Value | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes.


bCaptureByIndex Parameter For CaptureEXE

bCaptureByIndex

Specifies whether to capture by index.


bIsNumberResourceID Parameter For CaptureEXE

bIsNumberResourceID

Specifies whether the number is a resource ID


DialogType Parameter For CaptureEXEDlg

DialogType

Type of dialog to display. Possible values are:

Setting | Description
SCR_CAP_DLG_TREEVIEW | [0] Display tree dialog
SCR_CAP_DLG_TABVIEW | [1] Display tab view


hWndParent Parameter For CaptureEXEDlg

hWndParent

Window handle of the dialog's parent.


lFlags Parameter For CaptureEXEDlg

lFlags

Flags that specify the function behavior. Possible values are:

Value | Meaning
0 | Ignore this flag. Pass this if you do not wish to use this flag.
SCRDLG_CAPTUREFROMEXE_CONTEXTHELP | [0x0008] Show the context help button.


pszFileName Parameter For CaptureEXEDlg

pszFileName

Character string containing the file name.


ResourceType Parameter For CaptureEXEDlg

ResourceType

Type of resource. Possible values are:

Setting | Description
SCR_CAP_ALL | [0] capture all types of resources
SCR_CAP_BITMAP | [1] capture a bitmap resource
SCR_CAP_ICON | [2] capture an icon resource
SCR_CAP_CURSOR | [4] capture a cursor resource


Return for CaptureEXEDlg

Return Value

Value | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes.


pszFileName Parameter For CaptureEXE

pszFileName

Character string containing the file name from which to capture.


pszResourceID Parameter For CaptureEXE

pszResourceID

This can be a string ID, a numeric resource ID, or an index.


ResourseType Parameter For CaptureEXE

ResourceType

Type of resource. Possible values are:

Setting | Description
SCR_CAP_ALL | [0] capture all types of resources
SCR_CAP_BITMAP | [1] capture a bitmap resource
SCR_CAP_ICON | [2] capture an icon resource
SCR_CAP_CURSOR | [4] capture a cursor resource


Return for CaptureEXE

Return Value

Value | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes.


Return for CaptureFullScreen

Return Value

Value | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes.


pszFileName Parameter For CaptureGetResourceCount

pszFileName

Character string containing the file name.


Return for CaptureGetResourceCount

Return Value

Value | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes.


ResourceType Parameter For CaptureGetResourceCount

ResourceType

Type of resource to count. Possible values are:

Setting | Description
SCR_CAP_ALL | [0x00] capture all resources
SCR_CAP_BITMAP | [0x01] capture all bitmap resources
SCR_CAP_ICON | [0x02] capture all icon resources
SCR_CAP_CURSOR | [0x04] capture cursor resources


nCurrentCaptureNo Parameter For CaptureImage

nCurrentCaptureNo

The current capture count.


Return for CaptureMenuUnderCursor

Return Value

Value | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes.


Return for CaptureMouseCursor

Return Value

Value | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes.


hWndParent Parameter For CaptureObjectOptionDlg

hWndParent

Window handle of the dialog's parent.


lFlags Parameter For CaptureObjectOptionDlg

lFlags

Flags that specify the function behavior. Possible values are:

Value | Meaning
0 | Ignore this flag. Pass this if you do not wish to use this flag.
SCRDLG_CAPTUREOBJECTOPTION_CONTEXTHELP | [0x0004] Show the context help button.


Return for CaptureObjectOptionDlg

Return Value

Value | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes.


hWndParent Parameter For CaptureOptionDlg

hWndParent

Window handle of the dialog's parent.


lFlags Parameter For CaptureOptionDlg

lFlags

Flags that specify the function behavior. Possible values are:

Value | Meaning
0 | Ignore this flag. Pass this if you do not wish to use this flag.
SCRDLG_SETCAPTUREOPTION_CONTEXTHELP | [0x0001] Show the context help button.


Return for CaptureOptionDlg

Return Value

Value | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes.


Return for CaptureSelectedObject

Return Value

Value | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes.


Return for CaptureWallPaper

Return Value

Value | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes.


Return for CaptureWindowUnderCursor

Return Value

Value | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes.


Return for IsCaptureActive

Return Value

Value | Meaning
TRUE | Capture is active.
FALSE | Capture is not active.


CtlID Parameter For ScreenDlgHelp

CtlID

ID of the control that received the context sensitive help click. A value of –1 refers to the help button itself. For a list of other possible values, refer to the LTSCRRes.H file for Visual C++ users and refer to LTSCRRes.BAS file for Visual Basic users in the LEAD\INCLUDE directory.


DlgFrom Parameter For ScreenDlgHelp

DlgFrom

Flag that identifies the origin of the help command message. Possible values are:

Value | Meaning
SCRDLG_HELP_SETCAPTUREOPTION | [1] Help command message coming from the CaptureOptionDlg method.
SCRDLG_HELP_CAPTUREAREAOPTION | [2] Help command message coming from the CaptureAreaOptionDlg method.
SCRDLG_HELP_CAPTUREOBJECTOPTION | [3] Help command message coming from the CaptureObjectOptionDlg method.
SCRDLG_HELP_CAPTUREFROMEXE | [4] Help command message coming from the CaptureEXEDlg method.