Version History

Current version:	14.5
Last update:	October 13, 2005
Changes from Version 14 to Version 14.5

Changes from Version 13 to Version 14

Changes from Version 12.1 to Version 13

Changes from Version 12 to Version 12.1

Changes from Version 11.5 to Version 12

Changes from Version 11 to Version 11.5

Changes from Version 10 to Version 11

Version 10


Changes from Version 14 to Version 14.5

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


Changes from Version 13 to Version 14

Version 14 of the LEADTOOLS Screen Capture ActiveX has not changed from Version 13.


Changes from Version 12.1 to Version 13

Version 13 of the LEADTOOLS Screen Capture ActiveX has not changed from Version 12.1.


Changes from Version 12 to Version 12.1

Version 12.1 of the LEADTOOLS Screen Capture ActiveX has not changed from Version 12.


Changes from Version 11.5 to Version 12

Version 12 of the LEADTOOLS Screen Capture ActiveX has not changed from version 11.5.


Changes from Version 11 to Version 11.5

Version 11.5 of the LEADTOOLS Screen Capture ActiveX has not changed from version 11.


Changes from Version 10 to Version 11

Version 11 of the LEADTOOLS Screen Capture ActiveX has not changed from version 10.


Version 10

Version 10 is the first version of LEADTOOLS Screen Capture ActiveX.

 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


Introduction To Image Processing with LEADTOOLS

The following topics provide general information about image processing, and where appropriate, they describe the related LEADTOOLS capabilities. These topics build up concepts and terminology; so if you are new to image processing, it is best to read them in order.

Bits Per Pixel and Related Ideas

Color Resolution and Dithering

Palette Handling

Image Manipulation and Analysis

Image Display

Bitmaps in Memory and in Files

DIBs, DDBs, and the Clipboard

Printing

TWAIN and ISIS Input

Database Interaction

Data Transfer

Animation


Introduction: Bits Per Pixel and Related Ideas

The terminology for image formats can be confusing because there are often several ways of describing the same format. This topic explains what the terms mean.

If an image is 24 bits per pixel, it is also called a 24-bit image, a true color image, or a 16M color image. Sixteen million is roughly the number of different colors that can be represented by 24 bits, where there are 8 bits for each of the red, green, and blue (RGB) values.

A 32-bit image is a specialized true-color format used in image files, where the extra byte carries information that is either converted or ignored when the file is loaded. The extra byte is used for an additional color plane in CMYK files, which are specialized files for color printing. In that case, LEADTOOLS, by default, converts the values to 24-bit RGB values when loading the image. The additional byte may also be used for an Alpha channel, which carries extra information such as a transparency indicator.

If an image is 16 bits per pixel, it is also called a 16-bit image, a high color image, or a 32K color image. Thirty-two thousand is roughly the number of different colors that can be represented by 16 bits, where there are 5 bits for each of the red, green, and blue values. (Devices that specify 64K color support are also referring to 16-bit images, but they are counting the left-over bit.)

If an image is 8 bits per pixel, it is also called an 8-bit image or a 256-color image. Two hundred fifty-six is the number of different colors that can be achieved by using the image data as 8-bit indexes to an array of colors called a palette.

If an image is 4 bits per pixel, it is also called a 4-bit image or a 16-color image. Sixteen is the number of different colors that can be achieved by using the image data as 4-bit indexes to a palette.

If an image is 1 bit per pixel, it is also called a 1-bit image, a black and white image, a 2-color image, or a bitonal image. Two is the number of different colors that can be achieved by using the image data as 1-bit indexes to a palette. The palette can contain colors other than black and white, although black and white are most common.

If an image is grayscale, its red, green, and blue values are all the same, and the values are incremented from the lowest to the highest. For example, an 8-bit grayscale image has 256 shades of gray, with values from 0 to 255. LEADTOOLS supports 4, 8, 12, and 16-bit grayscale.  Support for the 12 and 16-bit grayscale images is only available in the Document/Medical editions.

Most of this same terminology is applied to video cards. For example, an 8-bit card is one that is capable of displaying 256 colors.


Introduction: Color Resolution and Dithering

Color resolution (also called color depth) refers to the number of possible colors in an image, as determined by the bits-per-pixel. If an image in your computer is loaded from a FAX scanner or received as a FAX transmission, it is a black-and-white (1-bit) image. If it is loaded from a color scanner or a JPEG file, it can have 16 million colors. If it is loaded from a GIF file, it is likely to have 256 colors. There are many possibilities, ranging from two colors to 16 million.

LEADTOOLS lets you manipulate an image and display it on any Windows-compatible device, regardless of the image's color resolution. Therefore, in most cases you can load, display, modify, and save an image without ever changing its color resolution. Nevertheless, in some cases you may need to increase or decrease the color resolution. Here are some examples:

 Suppose you need to load a large 24-bit image on a computer that does not have much memory. You can conserve memory by loading it as an 8-bit image. Then, if you were using an 8-bit display device, you would not see any difference in the quality of the image. Of course, there would be some loss of quality on a 24-bit display device, and the loss would be permanent if you then saved the image in the same file.

 Suppose you want to save an image in a different file format. If the new file format does not support the original color resolution, you can specify a different color resolution when you save the image.

 Suppose you want to combine one 8-bit image with another one. To combine two images, they must have the same color resolution, and if they are less than 16 bits per pixel, they must use the same palette. The simplest solution is to convert both images to 24 bits per pixel before combining them. Then, if necessary, you can reduce the color resolution of the combined image.

Whenever you reduce an image's color resolution to 8 bits per pixel or less, a dithering method comes into play. One alternative is to use a nearest-color match (no dithering), which means that the color of each pixel is changed to the palette color that most closely matches it. If the original image contains subtle color details, the result of a nearest-color match may have large blotches of color that are not very pleasing.

Dithering methods create the appearance of more subtle shades by mixing in pixels of different colors. This is similar to the way newspaper pictures produce the appearance of shades of gray, even though the only actual colors are black and white.

Ordered dithering is the fastest method. It is the default dithering method when painting to a display device that is 256 colors or less. Ordered dithering takes advantage of the fact that the colors in most palettes are ordered so that similar shades are next to each other in the palette. This method avoids blotches of color by adding to or subtracting from the nearest-color value of each pixel to ensure that adjacent pixels do not have exactly the same color. (If the colors in the palette are not ordered, the results are not good.)

All of the other dithering methods in LEADTOOLS use error-diffusion algorithms. In error diffusion, the error is the difference between the original pixel color and the nearest match, and diffusion of this error is what the algorithm accomplishes. Floyd-Steinberg is a high-quality, fast error-diffusion method. It is the default method that LEADTOOLS uses if you reduce the color resolution when loading or saving an image, or if you specify error diffusion as the dithering method when painting to a display device that is 256 colors or less.

If you use a LEADTOOLS function to change the color resolution of a bitmap in memory, you can choose from a list of possible dithering methods. All of the alternative error-diffusion methods are slower than Floyd-Steinberg, and the quality may or may not be better, depending on the original image, and depending on whether the resulting image is to be displayed or printed. Choosing an alternative dithering method is a subjective, trial-and-error decision. Stevenson and Arce dithering, the slowest of the alternatives, is most likely to produce a higher quality result.


Introduction: Palette Handling

Any image that is 8 bits per pixel or less must have a palette. The palette is an array that contains the colors for displaying the image. The pixel values are indexes into the array. An image can have its own unique palette or it can share a common fixed palette. In either case, every bitmap in memory that is 8 bits per pixel or less has its own copy of a palette (even if it is a common fixed palette).

One way for a bitmap to have a unique palette is to load an image from a file that is 8 bits per pixel or less. In that case, the file contains a palette for the image, and you can assume that the palette is unique. By default, LEADTOOLS loads the palette that is stored in the file and associates it with the bitmap in memory.

Another way for a bitmap to get a unique palette is to create the palette. For example, if you reduce a 24-bit image to 8 bits per pixel, you can let LEADTOOLS create an optimized palette for the image.

By using a unique, optimized palette, you get the best possible image quality, but there is a drawback. When a display device uses a palette (for example, when it is in 256-color mode), it can only use one palette at a time to display colors. Therefore, if you are displaying more than one image at the same time, the current image may look perfect, while all of the others look bad, because they are mapped to the wrong palette. This is called palette shift.

Using a fixed palette solves these palette-shift problems. The best approach is to specify the fixed palette as a display option. Then, LEADTOOLS remaps each image to the fixed palette when it is displayed, without disturbing the individual image's palette. (When displaying 16-, 24-, or 32-bit images on a device with 256 colors or less, LEADTOOLS always uses the fixed palette.)

Alternatively, you can use a color resolution function to specify a fixed palette for each individual image. But then, when you save the image to a file, the fixed palette is saved in the file, and any unique palette information is lost.


Introduction: Image Manipulation and Analysis

Most LEADTOOLS functions for image manipulation and analysis act on the bitmap in memory. It is important to keep this in mind, because the changes become permanent when you save the bitmap in a file. Sometimes you want the changes to be permanent, and sometimes you do not. It all depends on the reason for making the changes.

Sometimes, you start with an image that has some undesirable qualities. For example, if the original image is too flat, you may want to use one of the contrast enhancement functions to make permanent improvements.

At other times, you may need to make temporary changes for use on a particular monitor or printer. Using the ActiveX control or DLL functions, you can set the brightness, contrast, and gamma correction for the display of all images, without affecting the bitmaps. But for other changes, such as creating a halftone for printing, a good strategy is to modify a copy of the image, and give the user the ability to undo changes. The undo strategy also makes sense with a manipulation, such as a mosaic effect, that intentionally distorts an image.

Some image manipulations, such as edge-detection filters, are commonly used to analyze an image, rather than to improve it. For example, in an industrial quality-assurance application, defects in a machine part may be easier to detect if an image of the part is processed with an edge-detection filter. Similarly, the creation of a histogram (an array that charts the frequency of color usage in an image) can be of value in an analytical situation.

Edge detection and histogram creation can also be used as steps in improving an image. For example, creating a histogram is a necessary step, internally, in some of the contrast-improvement functions. Also, an image created with an edge detection filter can be combined with the original image to harden or soften the original's edges.


Introduction: Image Display

When you display an image, the following things come into play:

 Sizing and positioning the display.

 Adapting the image to the color resolution of the display device.

 Making other refinements that affect the display but not the bitmap in memory.

The LEADTOOLS paint functions let you specify which part of an image to display, how big to make the display, and where to position the origin (for scrolling and zooming). In the ActiveX, the origin defaults to 0,0 and the size defaults to the bitmap size. This is arbitrary, and even with automatic scroll bars, it is unlikely to be what a user wants to see. Instead, the typical user either wants to see the whole image or wants to select a portion of the image to view.

Fortunately, LEADTOOLS makes it easy to show the user exactly what he wants to see. LEADTOOLS lets you control the size and position of the display without resizing or trimming the bitmap. In fact, it usually is best to think of the bitmap size as a measure of resolution, rather than a measure of size. The larger the bitmap, the more you can zoom in without losing detail.

As for adapting to the color resolution of the display device, if the color resolution of your device is greater than 256 colors, no adaptation is necessary.  If the color resolution is higher than 256 colors, images are displayed using their own color values. Of course, if a 24-bit image is displayed on a 16-bit device, there is some loss, but there are still no programming issues, since the only remedy is to change the display mode.

If the color resolution of your display device is 256 colors or less, you have to make some programming decisions regarding dithering and palette selection. When displaying 16-, 24-, or 32-bit images, you can determine whether LEADTOOLS uses ordered dithering or error diffusion to handle the color reduction. (LEADTOOLS uses a fixed palette for these images.) When displaying 8-, 4-, or 1-bit images, you must decide whether to use a fixed palette or the individual image's palette. Using the fixed palette avoids palette shifting when more than one image is displayed at the same time. Using the image's original palette produces the best possible display of the image's colors.

Other LEADTOOLS functions let you determine how the new display interacts with whatever is already on the display device. For example, you can use Windows ROP codes to combine the displayed images. Also, when displaying 1-bit images, you can set scale-to-gray or favor-black options that can improve the readability of scaled images (images that are zoomed in or out to fit the available space).

For displaying 12 to 16-bit grayscale images, LEADTOOLS provides functions for window leveling. Window leveling is only available in the Medical editions.


Introduction: Bitmaps in Memory and in Files

Generally, the size of a bitmap in memory is determined by its dimensions and its color resolution. For example, to calculate the number of bytes for a 500-by-500 pixel, 24-bit image, you multiply 500 * 500 * 3. (Multiply by 3 because there are 3 bytes in 24 bits.) For an 8-bit image, it would be 500 * 500, plus the size of its palette, which is about 1K. There is an exception for 1-bit files, which can be loaded in a compressed format using the LEADTOOLS Document/Medical toolkit.

For any color image, whether the color values are in a palette or in the image data, the color of each pixel in the bitmap consists of red, green, and blue values. They always use the RGB color-space model, which means that red, green, and blue values are combined to represent a color.

The size of the same color image when it is stored in a file is often much smaller, and the color-space model is not always RGB. For example, JPEG and LEAD CMP files both use a YUV color-space model, where Y is a luminance value, and the U and V values are chrominance values. In this color-space model, brightness information is stored in the luminance value, and color information is stored in the chrominance values. JPEG and LEAD CMP achieve data compression through sampling techniques that can affect the accuracy of the YUV values. This kind of compression is sometimes referred to as lossy compression, because you can manipulate the compression parameters to choose between greater compression or greater accuracy. (YCbCr, used in TIFF images, is the same color-space model as YUV.)

Another color-space model used in image files is CMYK (designed for color printing using cyan, magenta, yellow, and blackness). Other compression techniques include RLE (run-length encoding) and LZW (Lempel-Ziv and Welch). Both of these techniques preserve the accuracy of the image data, and they achieve compression solely by identifying repetitions of data. Some grayscale and 1-bit image file formats also use RLE and LZW compression techniques.

The image file formats are not only used for storage in the computer's file system, but are also used for database storage and for transmission of images. Furthermore, some applications keep frequently-used images in memory in a compressed file format. Thus, they can take advantage of memory speed when loading bitmaps from these files.


Introduction: DIBs, DDBs, and the Clipboard

A DIB (device independent bitmap) is a standard Windows representation of a bitmap. It is similar to the LEADTOOLS representation of a bitmap in that it includes palette information. A DDB (device dependent bitmap) is a hardware-specific representation that does not include palette information. Sometimes, you may need to manipulate a bitmap using Windows functions that work with DIBs or DDBs. For example, you may need to interact with an existing application that uses those functions. For that purpose, LEADTOOLS functions let you convert or copy to and from DIBs or DDBs. Of course, when converting to and from a DDB, you must preserve the palette information separately.

The clipboard is a standard Windows object for copying data from one application to another. LEADTOOLS lets you copy images to the clipboard and paste images from the clipboard. When copying to the clipboard, most LEADTOOLS functions clear the existing data from the clipboard, and copy image data to it in the form of a DIB, a DDB, and a palette (if one is needed). If that is not what you want, you can use a LEADTOOLS DLL function to specify exactly which actions to take.


Introduction: Printing

LEADTOOLS printing functions are designed to work with Windows printing functions. Normally, you use Windows to select a device context (DC) and start the print job. LEADTOOLS functions let you scale and position one or more images in the printer DC. You use Windows functions to get the available page dimensions. You also use Windows functions to eject each page and to end the print job.

In most cases, you can scale and position an image on a printer DC with the same flexibility as when you display an image on a computer screen. You can let the printer handle any dithering or halftoning. However, if you halftone a bitmap, yourself, before sending it to a printer, you should resize the bitmap to the desired height and width, then use the halftone function, then send the image to the printer without scaling it. (You get bad results if you scale a halftoned image.)

In C, C++, Visual Basic, and Delphi, you can use the actual Windows printing functions, or their equivalents in the development system. However, printing with Microsoft FoxPro and older versions of Access is more limited, because they do not give you direct access to the printer DC. The LEADTOOLS ActiveX handles this problem by providing methods to start and stop the print job.

With Access 7.0, you can also add code to a report's Print event to include ActiveX images. Or, more simply, you can embed the LEAD OLE Server, which is provided as a separate toolkit component.


Introduction: TWAIN and ISIS Input
Introduction: TWAIN and ISIS® Input

TWAIN:

TWAIN is a standard for image input devices, such as scanners and digital cameras. Getting an image from a TWAIN device can be very simple. First, there is a standard facility for selecting the input device. It is similar to selecting a default printer, and you can skip this step if you know that the default is right. Then, each TWAIN device has its own user interface, which you invoke to acquire an image.

Some complexity is introduced only when acquiring multiple images or when bypassing the user interface. If you acquire multiple images, you must code a callback function or event procedure to handle each image. If you bypass the user interface, you must set some standard TWAIN parameters to provide the information that the TWAIN driver would normally get from the user interface. The tricky part is that some TWAIN drivers implement the standard more fully than others. If you do not know in advance how the TWAIN device will behave, it is a good idea to add logic to your program to test the success of setting the TWAIN parameters. LEADTOOLS provides functions for all of this.

Please note that TWAIN support requires TWAIN.DLL for 16-bit or TWAIN_32.DLL for 32-bit.  These files must be obtained from the TWAIN device manufacturer.

ISIS [Document/Medical]:

The Image and Scanner Interface Specification (ISIS) is a standard for scanner control and provides a complete framework for image processing.  LEADTOOLS supports image acquisition from ISIS scanner drivers.  The ISIS interface is message based, using tags to get and set scanner information and operating parameters.

LEADTOOLS provides ISIS Scanner support which allows you to determine if ISIS is available, load and unload ISIS Scanner Drivers, select and/or add an ISIS Scanner Driver through a dialog, scan one or more pages and save the images to files, and get or set Scanner Driver tags.  These tags provide information about the scanner and let you set parameters pertaining to scanning, such as contrast, brightness, resolution, compression method, etc.  With multipage scanning, you can code a callback function to provide a status report or cancel the operation.

Please note that ISIS support requires PIXDFLTN.DLL, which is not included with this package.  This file must be obtained from the ISIS device manufacturer.  Also note that you must obtain an ISIS driver from the scanner manufacturer or from Pixel Translations.  The .chn or .chw file must be in your path for ISIS scanning to work. LEAD does not grant any license to the ISIS driver or to ISIS development capabilities.  It is your responsibility to obtain the appropriate license to your development project, either from Pixel Translations, or one of their licensees.


Introduction: Database Interaction

With LEADTOOLS, you can use a variety of strategies to maintain images in a database. This variety is necessary because of the uneven support for storing images using different development and database systems.

The simplest database support is with Visual Basic, where you can bind a LEAD control (ActiveX) to a data control. You can associate the LEAD control with a long binary field in the database, and let the data control handle all of the database maintenance and navigation.

For other systems with ActiveX support, you may be able to use ODBC (Open Database Connectivity). ODBC is a standard interface for accessing local and remote databases. To use it, you define a data source that is implemented with an ODBC driver; then you access the data source in the same way you would a local database. LEADTOOLS provides ActiveX methods and properties that let you directly access image data through an ODBC data source. There are a couple of limitations in this approach. First, since the ActiveX accesses the image data directly and does not access any other data in the record, you must deal with the problem of identifying the image. To solve this problem, you can use another means of selecting records; then synchronize the ActiveX's view, so that it is always accessing the same record. (The ActiveX tutorials describe how to do this.) The second limitation is with ODBC drivers. Most of the available ODBC drivers do not properly support access to long binary fields. (The ACCESS 7.0 and FoxPro 2.x drivers have been tested successfully and are described in the ActiveX tutorials.)

Also, for systems with ActiveX support, you can use OLE DB and ADO to access data.  You can bind the LEADTOOLS OLE DB Control to an OLE DB data source, such as the Microsoft ADO Data Control.  You can associate the LEADTOOLS OLE DB Control with a long binary field in the database, and let the data control handle all of the database maintenance and navigation.

A more flexible approach on lower-level development systems, such as C, C++, and Delphi, is to use the ability of LEADTOOLS to save a file in memory. Once the image is available in memory in a compressed file format, you can use your choice of database engines to store and retrieve the data.

Finally, you may want to consider using your computer's or network's file system to store the images, use a database to store the file paths as strings, and write your own code to do the synchronization. In some cases, this could be a better solution than storing the images directly in the database.


Introduction: Data Transfer

When receiving transferred data, as in an Internet application or a FAX modem transmission, you often want to display the image as it is received.

To meet that need, LEADTOOLS provides simple functions that let you load image data into a bitmap as it is received. You can also use the LEADTOOLS paint-while-load feature to display the bitmap as it is received.

For Internet support, LEADTOOLS provides a plug-in DLL that can be used on WIN32 systems to view compressed images with Netscape Navigator or Microsoft Internet Explorer.


Introduction: Animation

GIF files are commonly used for small animated images in applications. These are multipage files, and animation is achieved by processing the list of images. (This is not the same as AVI or other full-motion video formats.)

LEADTOOLS lets you load a multipage file into a list of bitmaps; then create and play an animation sequence using the list. With the paint-while-load feature, you can also play the animation while the list is being loaded.

LEADTOOLS takes advantage of the special animation features in GIF files, such as using one palette for the whole list of bitmaps. But you can create, play, and save animations in any multipage format, including GIF, TIFF, and PCX. You can also create a list of bitmaps from an AVI file, but this is a read-only feature.


Copyright notice
Copyright Notices

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

Portions of the PCDLIB32.DLL, PCDLIB.DLL, LFFPX7.DLL and LFKODAK.DLL files contain material that is ©Copyright Eastman Kodak Company, 1996.

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

Portions of the OCR Features and the help file for the OCR Features are ©Copyright Scansoft, Inc. 1995-2000. 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.

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


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 LEADTOOLS Licensing help file.
	Click this button to start the LEADTOOLS Products help file.
	Click this button to start the LEADTOOLS Image Categories help file.


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
Online Support / FAQs	http://www.leadtools.com (click on Customers Only)
Home page:	http://www.leadtools.com
FTP:	ftp.leadtools.com
You can also contact LEAD by mail at:

LEAD Technologies, Inc.
Attn: Technical Support
Suite 400
1201 Greenwood Cliff
Charlotte, NC 28204

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


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 support for L_SUPPORT_LTPRO, using UnlockSupport.  To unlock these features, call 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 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, 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.

 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 Main COM help file (Ltcomn.chm) in the Help directory.

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

	Click this button to start the LEADTOOLS Products help file.


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.


Introduction

The LEADTOOLS Screen Capture properties, methods, and events are available with the LEADTOOLS 32-bit ActiveX as the LEAD Screen Capture Control Module.  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.

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++ 4.0 and later (32-bit)
	Visual Basic 4.0 and later (32-bit)
	Delphi 2.0 and later (32-bit)
Summary of All Supported Image File Formats

Advisories

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.


Advisories

Limitations with Visual Basic 4.0


Limitations with Visual Basic 4.0

The Screen Capture ActiveX controls are created using Microsoft's ATL library for ActiveX controls.  OLE_COLOR, IPictureDisp*, and IFontDisp* properties do not persist properly in Visual Basic 4.0 using the ATL implementation of property persistence.  You will not be able to save settings for these properties at design-time.  When you save your form in VB 4.0, the values for these properties will be empty.  When you reload that form, you will get errors indicating failure to load these property values.  You can ignore these errors.  You should initialize these properties to the desired values in your code at run-time.  The properties involved are:

TransparentColor property

CaptureAreaFillForeColor property

CaptureAreaFillBackColor property

CaptureAreaDrawLineColor property

CaptureAreaTextForeColor property

CaptureAreaTextBackColor property

CaptureCursor property

CaptureAreaDrawCursor property

CaptureObjectSelectCursor property

CaptureStatusCursor property

Note:	This limitation does not apply to VB 5.0.


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.


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 Syntax

Visual C++ 4.0 Syntax

Delphi 2.0 Syntax


Screen Capture 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 LTKRN, LTDIS, LTEFX, LTIMG, and LTFIL are required for ALL OCX applications. For more information on LTKRN, LTDIS, LTEFX, LTIMG, LTFIL and other files for the Main Control Module, refer to Files To Be Included With Your Application .

Redistributables:	Explanation:	If you are using a standard release, the files to use are:	If you are using an evaluation release, the files to use are:
LTSCR	Screen Capture Support. LEAD Screen Capture Control LEADTOOLS Screen Capture Support DLL. Also requires the LEAD file format DLLs.  All other necessary files come with the 32-bit Windows Operating Systems.	DLL: LTSCR14N.DLL OCX: LTSCR14N.OCX	DLL: LTSCR14E.DLL OCX: LTSCR14E.OCX


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++ 4.0

 EXAMPLES\OCX\MFC40\SCRDEMO contains a sample application that demonstrates most of the Screen Capture capabilities in the Visual C++ 4.0 environment. You can open the project in Visual C++; then compile and run it.

Visual Basic

 EXAMPLES\OCX\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.


Visual Basic Syntax

The syntax for the LEAD control's properties, methods, and events is the same as for other controls in Visual Basic.

Whenever you declare a variable as a data type, you need to know how the ActiveX data type is expressed in Visual Basic. Refer to the following table for the appropriate data type:

ActiveX Data Type	Visual Basic Data Type
boolean	Boolean
BSTR	String
IPictureDisp	Picture
long	Long
OLE_HANDLE	Integer on a 16-bit system; Long on a 32-bit system
OLE_COLOR	Long color value (such as the RGB return value)
OLE_XPOS_PIXELS	Long
OLE_YPOS_PIXELS	Long
short	Integer
float	Single


Visual C++ 4.0 Syntax

In Version 4.0 of Visual C++, the MicroSoft Foundation Class (MFC) library provides an ActiveX interface. This topic describes how to use the interface with the LEADTOOLS ActiveX.

Alternatively, to create an instance of the LEAD control at run time, use the Create function, which has the following prototype:

BOOL Create	(LPCTSTR lpszWindowName, DWORD dwStyle,
	const RECT&rect, CWnd* pParentWnd, UINT nID,
	CFile* pPersist = NULL, BOOL bStorage = FALSE,
	BSTR bstrLicKey = NULL);
Provide parameters as follows:

lpszWindowName	Use "", because the control window does not need a name.
dwStyle	Use 0 for the default style.
&rect	Use the CRect function. For example: CRect(0,0,50,50).
pParentWnd	Use this to refer to the current window.
nID	Use 0 for the default ID.
pPersist	Use NULL.
bStorage	Use FALSE.
bstrLicKey	Use the LEADTOOLS license string, which is always the first line in the LTOCX14.LIC file. For example: "LEADTOOLS OCX Copyright (c) 2001 LEAD Technologies, Inc." If you do not specify this string correctly, the ActiveX will not work when you distribute your application.
For example, the following code comes from the EXAMPLES\OCX\MFC40\DEMO\MAINDEMO.CPP file:

static const WCHAR BASED_CODE _szLicString[] =
   L"LEADTOOLS OCX Copyright (c) 2001 LEAD Technologies, Inc.";
     o
     o
     o
m_pLead = new CLead;
// pass the license string to the CLead::Create function.
// The CLead::Create expects a BSTR parameter and SysAllocString converts the
// WCHAR[] to a BSTR
BSTR lpLic = SysAllocString(_szLicString);
m_pLead->Create("", 0,CRect(0,0,50,50),this,0,NULL,FALSE,lpLic);
m_pLead->ShowWindow(SW_HIDE);
SysFreeString(lpLic);

When getting or setting a property value, you must use a function that is created by adding a prefix to the property name.

To set a property value, the syntax is as follows:

m_controlname.Setpropertyname(value);

For example:

m_Lead1.SetRubberBandVisible(FALSE);

To get a property value, the syntax is as follows:

value = m_controlname.Getpropertyname();

For example:

HeightFactor = m_Lead1.GetBitmapHeight();

To set a property array value, the syntax is as follows:

m_controlname.Setpropertyname(index, value);

For example:

m_Lead1.SetRemapTable(MyIndex, (255 * Offset) / CurrentRange);

To get a property array value, the syntax is as follows:

value = m_controlname.Getpropertyname(index);

For example:

m_Lead1.SetBitmap(m_Lead1.GetColorPlanes(3)); // Copy the K plane


Delphi 2.0 Syntax

The syntax for the LEAD control's properties, methods, and events is the same as for other OLE controls in Delphi 2.0.

In Delphi 2.0, to use the constants that are defined for the LEADTOOLS ActiveX, you must import the LEADDEF.PAS fil.

Whenever you declare a variable as a data type, you need to know how the ActiveX data type is expressed in Object Pascal. Refer to the following table for the appropriate data type:

ActiveX Data Type	Object Pascal Data Type
boolean	Boolean
BSTR	String
long	Longint
OLE_HANDLE	THandle
OLE_COLOR	Longint (such as the RGB return value)
OLE_XPOS_PIXELS	Integer
OLE_YPOS_PIXELS	Integer
short	Smallint
float	Single


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


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.

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 ActiveWindow

Capturing an Area

Capturing an Icon from an EXE

Capturing a Selected Object

Capturing Multiple Images

Miscellaneous Examples


Capturing an Active Window (Visual Basic)

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 Main Control to your project.
	For VB4: On the Tools pull-down menu, use the Custom Controls option, and select the LEAD Main Control(14).
	For VB5: On the Project pull-down menu, use the Components option, and select the LEAD Main Control(14).
3.	Add the LEAD Screen Capture Control to your project.
	For VB4: On the Tools pull-down menu, use the Custom Controls option, and select the LEAD Screen Capture Control(14).
	For VB5: On the Project pull-down menu, use the Components option, and select the LEAD Screen Capture Control(14).
4.	Select the LEAD Main Control; then add the control to your main form. Size and position the control as you want it to appear at run time.
5.	Select the LEAD Screen Capture Control; then add the control to your main form.
6.	Add a command button and name it as follows:
	Name	Caption
	CapWin	Capture Window
7.	Code the CapWin_Click() procedure as follows:
Private Sub CapWin_Click()
'set the hot key to F10
LEADScr1.CaptureHotKey = 121
LEADScr1.CaptureDelay = 3000
LEADScr1.CaptureActiveWindow
LEAD1.Bitmap = LEADScr1.Bitmap
End Sub

8.	Code the Form_Unload procedure as follows:
Private Sub Form_Unload(Cancel As Integer)
LEADScr1.StopCapture
End Sub

9.	Run your program to test it. Click the control button, select the window you wish to capture, and press F10.
10.	Save the project to use as a starting point for other tasks in this tutorial.
11.	To set the hot key to Alt + F10, substitute the following two lines for LEADScr1.CaptureHotKey = 121:
LEADScr1.CaptureHotKey = vbKeyF10
LEADScr1.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)

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
LEADScr1.ScaleMode = 3

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

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

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

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

'do not enable the keyboard
LEADScr1.CaptureAreaEnableKeyboard = False

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

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

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

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

'capture a triangular area
LEADScr1.CaptureArea SCR_CAP_AREA_TRIANGLE

'assign the Screen Capture Control bitmap to the Main Control bitmap
LEAD1.Bitmap = LEADScr1.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)

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.	Select the LEAD Main Control; then add the control to your main form. Size and position the control as you want it to appear at run time. This will be LEAD2.
3.	Select the LEAD Main Control; then add the control to your main form. Size and position the control as you want it to appear at run time. This will be LEAD3.
4.	Add a command button and name it as follows:
	Name	Caption
	CapEXE	Capture EXE
5.	Code the CapEXE_Click() procedure as follows:
Private Sub CapEXE_Click()
Dim nCount As Integer

nCount = 0

LEADScr1.CaptureGetResourceCount "c:\windows\calc.exe", SCR_CAP_ICON, nCount
If (nCount < 1) Then
   MsgBox "No Icons."
End If
If (nCount >= 1) Then
    LEADScr1.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.
    LEADScr1.CaptureEXE "c:\windows\calc.exe", SCR_CAP_ICON, "sc", False, False
    LEAD1.AutoRepaint = False
    LEAD1.Bitmap = LEADScr1.Bitmap
    LEAD1.BitmapTransparentColor = vbWhite
    LEAD1.BitmapEnableTransparency = True
    LEAD1.AutoRepaint = True
    MsgBox "wait"
End If

nCount = 0
LEADScr1.CaptureGetResourceCount "c:\windows\defrag.exe", SCR_CAP_ICON, nCount
If (nCount < 1) Then
   MsgBox "No Icons."
End If
If (nCount >= 1) Then
   LEADScr1.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.
   LEADScr1.CaptureEXE "c:\windows\defrag.exe", SCR_CAP_ICON, "111", True, False
   LEAD2.Bitmap = LEADScr1.Bitmap
   LEAD2.AutoRepaint = False
   LEAD2.Bitmap = LEADScr1.Bitmap
   LEAD2.BitmapTransparentColor = vbWhite
   LEAD2.BitmapEnableTransparency = True
   LEAD2.AutoRepaint = True
   MsgBox "wait"
End If
nCount = 0
LEADScr1.CaptureGetResourceCount "c:\windows\Explorer.exe", SCR_CAP_ICON, nCount
If (nCount < 1) Then
   MsgBox "No Icons."
End If
If (nCount >= 1) Then
   LEADScr1.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.
   LEADScr1.CaptureEXE "c:\windows\Explorer.exe", SCR_CAP_ICON, "0", True, True
   LEAD3.Bitmap = LEADScr1.Bitmap
   LEAD3.AutoRepaint = False
   LEAD3.Bitmap = LEADScr1.Bitmap
   LEAD3.BitmapTransparentColor = vbWhite
   LEAD3.BitmapEnableTransparency = True
   LEAD3.AutoRepaint = True
   MsgBox "wait"
End If

End Sub

6.	Run your program to test it.


Capturing a Selected Object (Visual Basic)

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
	CapSelect	Capture Select
3.	Code the CapSelect_Click() procedure as follows:
Private Sub CapSelect_Click()
    'display the capture selected object dialog
    LEADScr1.CaptureObjectOptionDlg hWnd
    'capture the selected object
    LEADScr1.CaptureSelectedObject
    'assign the screen control bitmap to the Main control bitmap
    LEAD1.Bitmap = LEADScr1.Bitmap
    'reset the object options
    LEADScr1.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)

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.	Code the CapMulti_Click() procedure as follows:
Private Sub CapMulti_Click()
'set the cancel key
LEADScr1.CaptureCancelKey = vbKeyEscape
'set the delay, the interval and the number of captures to perform
LEADScr1.CaptureDelay = 2000
LEADScr1.CaptureInterval = 2000
LEADScr1.CaptureCount = 3
'capture
LEADScr1.CaptureActiveClient
End Sub

4.	Code the Display_Click() procedure as follows:
Private Sub Display_Click()
LEAD1.Load "D:\Temp\Multi.tif", 0, 1, 1
LEAD2.Load "D:\Temp\Multi.tif", 0, 2, 1
LEAD3.Load "D:\Temp\Multi.tif", 0, 3, 1
'remove the tif file so you can capture and display again without restarting the program
Kill "D:\Temp\Multi.tif"
End Sub

5.	Code the OnCaptureImage procedure as follows:
Private Sub LEADScr1_OnCaptureImage(ByVal CaptureNumber As Long)
'copy the captured image to the Main control and save it
LEAD1.Bitmap = LEADScr1.Bitmap
LEAD1.Save "D:\Temp\Multi.tif", FILE_TIF, 0, 2, SAVE_APPEND
End Sub

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

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

This is also the example for the CaptureCursorIndex and CaptureCursor properties.

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

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

    'copy the captured image to a Main Control
    LEAD1.Bitmap = LEADScr1.Bitmap


CaptureActiveWindow Example for Visual Basic

This is also the example for the CaptureCancelKey property, CaptureDelay property, CaptureCount property, CaptureInterval property, CaptureInfohWnd property, .

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

    'set cancel key to ESC
    LEADScr1.CaptureCancelKey = vbKeyEscape

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

    'start the captures
    LEADScr1.CaptureActiveWindow

    'display the results
    Text1.Text = LEADScr1.CaptureInfohWnd


CaptureArea Example for Visual Basic

This is also the example for the ScaleMode property, CaptureAreaDrawCursorIndex property, CaptureAreaFillPattern property, CaptureAreaDrawLineStyle property, CaptureAreaDrawEllipseWidth property, CaptureAreaDrawEllipseHeight property, CaptureAreaInfoLeft property, CaptureAreaInfoTop property, CaptureAreaInfoHeight property, CaptureAreaInfoWidth property, CaptureAreaShowDrawCursor property, CaptureAreaIncludeCursor property, CaptureAreaEnableKeyboard property, CaptureAreaShowOpaqueText property, CaptureAreaShowCursorPosition property, CaptureAreaShowAreaSize property, CaptureAreaShowInfoWindow property, CaptureAreaSensitiveInfoWindow property, CaptureAreaBitmapWithRegion property, CaptureAreaZoomFactor property, CaptureAreaFillForeColor property, CaptureAreaFillPattern property, CaptureAreaFillBackColor property, CaptureAreaDrawLineColor property, CaptureAreaTextForeColor property, and CaptureAreaTextBackColor property.

LEADScr1.ScaleMode = 1 'set to twips

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

    'set zoom factor
    LEADScr1.CaptureAreaZoomFactor = CAPTURE_AREA_ZOOM_BY3X

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

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

    'capture with a region
    LEADScr1.CaptureAreaBitmapWithRegion = True

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

    'disable keyboard
    LEADScr1.CaptureAreaEnableKeyboard = False

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

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

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

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

    'do the capture
    LEADScr1.CaptureArea SCR_CAP_AREA_ROUNDRECT

    'copy the image to a Main Control
    LEAD1.Bitmap = LEADScr1.Bitmap


CaptureAreaOptionDlg Example for Visual Basic

This is also the example for the CaptureInfoTop, CaptureInfoLeft, CaptureInfoWidth, and CaptureInfoHeight properties.

'set options
    LEADScr1.CaptureAreaOptionDlg hWnd
    'do a capture using these options
    LEADScr1.CaptureArea LEADScr1.CaptureAreaType

    'copy the captured image to a Main Control
    LEAD1.Bitmap = LEADScr1.Bitmap

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

    'reset area options
    LEADScr1.ResetAreaOptions


CaptureEXE Example for Visual Basic

Private Sub CapArea_Click()
    LEADScr1.TransparentColor = vbWhite

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

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

    'finally, capture by resource index
    LEADScr1.CaptureEXE "c:\windows\calc.exe", SCR_CAP_ICON, "0", True, True
    LEAD1.Bitmap = LEADScr1.Bitmap
    MsgBox "wait"
End Sub
Private Sub Form_Unload(Cancel As Integer)
    LEADScr1.StopCapture
End Sub


CaptureEXEDlg Example for Visual Basic

This is also the example for the CaptureInfoResType, CaptureInfoResIndex, CaptureInfoResID, and CaptureInfoExeName properties.

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

    'copy the captured image to a Main Control
    LEAD1.Bitmap = LEADScr1.Bitmap

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


CaptureFullScreen Example for Visual Basic

This is the example for the Bitmap property.

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


CaptureGetResourceCount Example for Visual Basic

Dim nCount As Integer

        nCount = 0

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


CaptureHotKey Example for Visual Basic

This is also the example for the CaptureHotKeyModifiers property.

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


CaptureHotKeyPressed Example for Visual Basic

Private Sub LEADScr1_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 = LEADScr1.IsCaptureActive
        If (bRet) Then
            LEADScr1.StopCapture
        End If
    End If
 End Sub


CaptureImage Example for Visual Basic

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


CaptureMenuUnderCursor Example for Visual Basic

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


CaptureMouseCursor Example for Visual Basic

    'capture current mouse cursor
    LEADScr1.CaptureMouseCursor
    'copy the captured image to a Main Control
    LEAD1.Bitmap = LEADScr1.Bitmap


CaptureObjectOptionDlg Example for Visual Basic

    'display the capture selected object dialog
    LEADScr1.CaptureObjectOptionDlg hWnd


CaptureOptionDlg Example for Visual Basic

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


CaptureSelectedObject Example for Visual Basic

This is also the example for the CaptureObjectSelectCursorIndex, CaptureObjectInvert, CaptureObjectEnableKeyboard, CaptureObjectBorderWidth properties.

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

    'disable invert colors
    LEADScr1.CaptureObjectInvert = False

    'disable keyboard
    LEADScr1.CaptureObjectEnableKeyboard = False

    'set object border width
    LEADScr1.CaptureObjectBorderWidth = 3

    'do the capture
    LEADScr1.CaptureSelectedObject

    'copy the captured image to a Main Control
    LEAD1.Bitmap = LEADScr1.Bitmap

    'reset options
    LEADScr1.ResetObjectOptions


CaptureWallPaper Example for Visual Basic

    'capture the wallpaper
    LEADScr1.CaptureWallPaper
    'copy the captured image to a Main Control
    LEAD1.Bitmap = LEADScr1.Bitmap


CaptureWindowUnderCursor Example for Visual Basic

    'set 3 sec delay
    LEADScr1.CaptureDelay = 3000

    'capture window under cursor
    LEADScr1.CaptureWindowUnderCursor

    'copy the captured image to a Main Control
    LEAD1.Bitmap = LEADScr1.Bitmap


OptimizedHotkey Example for Visual Basic

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

    'set hotkey
    LEADScr1.CaptureHotKey = vbKeyF11

    'enable optimized hotkey
    LEADScr1.OptimizedHotkey = True

    'start the captures
    LEADScr1.CaptureActiveWindow
End Sub

Private Sub LEADScr1_OnCaptureImage(ByVal CaptureNumber As Long)
    'get the captured image here
    LEAD1.Bitmap = LEADScr1.Bitmap
End Sub


Tutorial for Visual C++ 4.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.

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

Miscellaneous Examples


Capturing an Active Window (Visual C++ 4.0 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:
	For C++ 4.x, run Microsoft Developer Studio for Visual C++, select the File >New menu option, select Project Workspace, and click the OK button. In the New Project Workspace dialog box, do the following:
	a.	In the Type list box, select MFC AppWizard (exe).
	b.	In the Name text box, specify ScrCap.
	c.	In the Location text box, specify the path of the project.
	d.	In the Platforms list box, check Win32.
	e.	Click the Create button.
	For C++ 5.0, 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 About Box is selected.
	b.	Ensure that 3D controls is selected.
	c.	Select OLE controls (ActiveX controls in 5.0).
	d.	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.
6.	Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
7.	Add the L_OCX40.H, Ltscrocx.h, and L_OcxErr.h files, to your project as follows:
	a.	Copy the L_ocx40.h, Ltscrocx.h, and L_OcxErr.h files to your project directory, from the \lead\include\ directory.
	b.	In the Project Workspace, click the FileView tab.
	c.	Double-click the ScrCap files folder to open it.
	d.	Double-click the Dependencies folder (the Header Files folder in 5.0) to open it.
	e.	Double-click the StdAfx.h file to edit it.
	f.	Add the following lines to the end of the file:
		#include "L_OCX40.H"
		#include "Ltscrocx.h"
8.	Add a LEAD control and a LEAD Screen Capture Control to the main window as follows:
	For C++ 4.x:
		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 Insert > Component. (The Component Gallery appears.)
		g.	Click the OLE controls tab.
		h.	Double-click the LEAD Main Control (14) icon. (The Confirm Classes dialog box appears.)
		i.	Ensure that CLead, CPicture, and COleFont are checked.
		j.	Click OK to complete the selection.
		k.	Double-click the LEAD Screen Capture Control (14) icon. (The Confirm Classes dialog box appears.)
		l.	Ensure that CLeadScr and CPicture are checked.
		m.	Click OK to complete the selection; then click Close to close the Component Gallery. (The LEAD Controls appear in the controls toolbar.)
		n.	Click the LEAD Main Control icon on the toolbar; then size and position the control as you want it to appear at run time.
		o.	Double-click the new LEAD Main Control to edit its properties.
		p.	Change the ID to IDC_LEAD1.
		q.	Click the LEAD Screen Capture Control icon on the toolbar and position the control on the main window.
		r.	Double click the new LEAD Screen Capture Control to edit its properties.
		s.	Change the ID to IDC_LEADScr1.
	For C++ 5.0:
		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 Main Control (14) icon. (The Confirm Classes dialog box appears.)
		i.	Ensure that CLead, CPicture, and COleFont are checked.
		j.	Click OK to complete the selection. Click OK to insert the component.
		k.	Double-click the LEAD Screen Capture Control (14) icon. (The Confirm Classes dialog box appears.)
		l.	Ensure that CLeadScr and CPicture are checked.
		m.	Click OK to complete the selection; click OK to insert the component; then click Close to close the Component Gallery. (The LEAD Controls appears in the controls toolbar.)
		n.	Click the LEAD Control icon; then size and position the control as you want it to appear at run time.
		o.	Use the right mouse button to edit the properties of the new LEAD Control.
		p.	Change the ID to IDC_LEAD1.
		q.	Click the LEAD Screen Capture Control icon on the toolbar and position the control on the main window.
		r.	Use the right mouse button to edit the properties of the new LEAD Screen Capture control.
		s.	Change the ID to IDC_LEADScr1.
9.	Add a command button and set the ID and Caption properties as follows:
	ID	Caption
	IDC_CAPWIN	Capture Window
10.	Do the following to add m_LEADScr1 and m_LEAD1 to the CScrCapDlg class and link the variables to the controls 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_LEADScr1.
	e.	Click the Add Variable... button.
	f.	Specify m_LEADScr1 as the variable name, and control as the category.
	g.	Click OK to close the dialog box.
	h.	In the Control IDs list, select IDC_LEAD1.
	i.	Click the Add Variable... button.
	j.	Specify m_LEAD1 as the variable name, and control as the category.
	k.	Click OK to close the dialog box.
11.	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:
/* set the hot key to be F10 */
m_LEADScr1.SetCaptureHotKey(121);
m_LEADScr1.SetCaptureDelay(3000);
m_LEADScr1.CaptureActiveWindow();
m_LEAD1.SetBitmap (m_LEADScr1.GetBitmap());

12.	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 IDCANCEL.
	d.	In the Messages list box, select BN_CLICKED.
	e.	Click the Add function button. Choose OK for the default function name (OnCancel).
	f.	Click the Edit Code button and code the OnCancel procedure as follows:
m_LEADScr1.StopCapture();
CDialog::OnCancel();

13.	On the main menu, select Build> Build ScrCap.exe to build the project.
14.	On the main menu, select Build> Execute ScrCap.exe to run the project. Click the Capture Window command button, select the window to capture, and press F11.


Capturing an Area (Visual C++ 4.0 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:
m_LEADScr1.SetScaleMode(3);

//set up the info window
m_LEADScr1.SetCaptureAreaShowInfoWindow(TRUE);
m_LEADScr1.SetCaptureAreaInfoTop(0.0f);
m_LEADScr1.SetCaptureAreaInfoLeft(0.0f);
m_LEADScr1.SetCaptureAreaInfoHeight(300.0f);
m_LEADScr1.SetCaptureAreaInfoWidth(300.0f);

//show area size and cursor information on an opaque background
m_LEADScr1.SetCaptureAreaShowAreaSize(TRUE);
m_LEADScr1.SetCaptureAreaShowCursorPosition(TRUE);
m_LEADScr1.SetCaptureAreaShowOpaqueText(TRUE);

//set text colors, fill colors, fill pattern, and line style
m_LEADScr1.SetCaptureAreaDrawLineColor(RGB(0, 0, 0));
m_LEADScr1.SetCaptureAreaTextBackColor(RGB(0, 0, 255));
m_LEADScr1.SetCaptureAreaTextForeColor(RGB(255, 255, 255));
m_LEADScr1.SetCaptureAreaFillBackColor(RGB(255, 0, 0));
m_LEADScr1.SetCaptureAreaFillForeColor(RGB(0, 0, 255));
m_LEADScr1.SetCaptureAreaFillPattern(CAPTURE_AREA_PATTERN_CROSS);
m_LEADScr1.SetCaptureAreaDrawLineStyle(CAPTURE_AREA_LINE_DASH);

//do not include the cursor in the image
m_LEADScr1.SetCaptureAreaIncludeCursor(FALSE);

//do not enable the keyboard
m_LEADScr1.SetCaptureAreaEnableKeyboard(FALSE);

//save a bitmap with a region
m_LEADScr1.SetCaptureAreaBitmapWithRegion(TRUE);

//make the info window sensitive to the position of the cursor
m_LEADScr1.SetCaptureAreaSensitiveInfoWindow(TRUE);

//zoom the image in the info window
m_LEADScr1.SetCaptureAreaZoomFactor(CAPTURE_AREA_ZOOM_BY2X);

//use the cross lines cursor instead of the CaptureAreaDrawCursorIndex
m_LEADScr1.SetCaptureAreaUseCrossLinesCursor(TRUE);
m_LEADScr1.SetCaptureAreaShowDrawCursor(TRUE);

//capture a triangular area
m_LEADScr1.CaptureArea(SCR_CAP_AREA_TRIANGLE);

//assign the Screen Capture Control bitmap to the Main Control bitmap
m_LEAD1.SetBitmap (m_LEADScr1.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++ 4.0 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 second LEAD Main Control to the main dialog as follows:
	a.	Click the LEAD Control icon; then size and position the control as you want it to appear at run time.
	b.	Use the right mouse button to edit the properties of the new LEAD Control.
	c.	Change the ID to IDC_LEAD2.
3.	Add a third LEAD Main Control to the main dialog as follows:
	a.	Click the LEAD Control icon; then size and position the control as you want it to appear at run time.
	b.	Use the right mouse button to edit the properties of the new LEAD Control.
	c.	Change the ID to IDC_LEAD3.
4.	Add a command button and set the ID and Caption properties as follows:
	ID	Caption
	IDC_CAPEXE	Capture EXE
5.	Do the following to add m_LEAD2 and m_LEAD3 to the CScrCapDlg class and link the variables to the controls 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_LEAD2.
	e.	Click the Add Variable... button.
	f.	Specify m_LEAD2 as the variable name, and control as the category.
	g.	Click OK to close the dialog box.
	h.	In the Control IDs list, select IDC_LEAD3.
	i.	Click the Add Variable... button.
	j.	Specify m_LEAD3 as the variable name, and control as the category.
	k.	Click OK to close the dialog box.
6.	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:
short nCount = 0;

m_LEADScr1.CaptureGetResourceCount("c:\\windows\\calc.exe", SCR_CAP_ICON, &nCount);
if (nCount < 1)
AfxMessageBox("No Icons.");
else
{
m_LEADScr1.SetTransparentColor(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_LEADScr1.CaptureEXE("c:\\windows\\calc.exe", SCR_CAP_ICON, "sc", FALSE, FALSE);
m_LEAD1.SetBitmap (m_LEADScr1.GetBitmap());
m_LEAD1.SetBitmapTransparentColor (RGB(255, 255, 255));
m_LEAD1.SetBitmapEnableTransparency (TRUE);
AfxMessageBox("Wait");
}

nCount = 0;

m_LEADScr1.CaptureGetResourceCount("c:\\windows\\defrag.exe", SCR_CAP_ICON, &nCount);
if (nCount < 1)
AfxMessageBox("No Icons.");
else
{
m_LEADScr1.SetTransparentColor(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_LEADScr1.CaptureEXE("c:\\windows\\defrag.exe", SCR_CAP_ICON, "111", TRUE, FALSE);
m_LEAD2.SetBitmap (m_LEADScr1.GetBitmap());
m_LEAD2.SetBitmapTransparentColor (RGB(255, 255, 255));
m_LEAD2.SetBitmapEnableTransparency (TRUE);
AfxMessageBox("Wait");
}

nCount = 0;

m_LEADScr1.CaptureGetResourceCount("c:\\windows\\Explorer.exe", SCR_CAP_ICON, &nCount);
if (nCount < 1)
AfxMessageBox("No Icons.");
else
{
m_LEADScr1.SetTransparentColor(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_LEADScr1.CaptureEXE("c:\\windows\\Explorer.exe", SCR_CAP_ICON, "0", TRUE, TRUE);
m_LEAD3.SetBitmap (m_LEADScr1.GetBitmap());
m_LEAD3.SetBitmapTransparentColor (RGB(255,255, 255));
m_LEAD3.SetBitmapEnableTransparency ;(TRUE);
AfxMessageBox("Wait");
}

7.	On the main menu, select Build> Build ScrCap.exe to build the project.
8.	On the main menu, select Build> Execute ScrCap.exe to run the project.


Capturing a Selected Object (Visual C++ 4.0 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_CAPSELECT	Capture Selected
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_CAPSELECT.
	d.	In the Messages list box, select BN_CLICKED.
	e.	Click the Add function button. Choose OK for the default function name (OnCapselect).
	f.	Click the Edit Code button and code the OnCapselect procedure as follows:
    /*display the capture selected object dialog*/
    m_LEADScr1.CaptureObjectOptionDlg((long)this->m_hWnd);
    /* capture the selected object */
    m_LEADScr1.CaptureSelectedObject();
    /* assign the screen control bitmap to the Main control bitmap */
    m_LEAD1.SetBitmap (m_LEADScr1.GetBitmap());
    /* reset the object options */
    m_LEADScr1.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++ 4.0 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.	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:
//set the cancel key
m_LEADScr1.SetCaptureCancelKey(VK_ESCAPE);
//set the delay, interval, and number of captures to perform
m_LEADScr1.SetCaptureDelay(2000);
m_LEADScr1.SetCaptureInterval(2000);
m_LEADScr1.SetCaptureCount(3);

//capture
m_LEADScr1.CaptureActiveClient();

4.	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:
m_LEAD1.Load ("D:\\Temp\\Multi.tif", 0, 1, 1);
m_LEAD2.Load("D:\\Temp\\Multi.tif", 0, 2, 1);
m_LEAD3.Load("D:\\Temp\\Multi.tif", 0, 3, 1);
remove("D:\\Temp\\Multi.tif");

5.	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_LEADScr1.
	d.	In the Messages list box, select OnCaptureImage.
	e.	Click the Add function button. Choose OK for the default function name (OnCaptureImageLeadScr1).
	f.	Click the Edit Code button and code the OnCaptureImageLeadscr1 procedure as follows:
m_LEAD1.SetBitmap (m_LEADScr1.GetBitmap());
m_LEAD1.Save ("D:\\Temp\\Multi.tif",FILE_TIF, 0, 2, SAVE_APPEND);

6.	On the main menu, select Build> Build ScrCap.exe to build the project.
7.	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.


Miscellaneous Examples (Visual C++ 4.0)
Miscellaneous Examples (C++ 4.0 and later)

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++ 4.0 and later

CaptureActiveWindow Example for C++ 4.0 and later

CaptureArea Example for C++ 4.0 and later

CaptureAreaOptionDlg Example for C++ 4.0 and later

CaptureEXE Example for C++ 4.0 and later

CaptureEXEDlg Example for C++ 4.0 and later

CaptureFullScreen Example for C++ 4.0 and later

CaptureGetResourceCount Example for C++ 4.0 and later

CaptureHotKey Example for C++ 4.0 and later

CaptureHotKeyPressed Example for C++ 4.0 and later

CaptureImage Example for C++ 4.0 and later

CaptureMenuUnderCursor Example for C++ 4.0 and later

CaptureMouseCursor Example for C++ 4.0 and later

CaptureObjectOptionDlg Example for C++ 4.0 and later

CaptureOptionDlg Example for C++ 4.0 and later

CaptureSelectedObject Example for C++ 4.0 and later

CaptureWallPaper Example for C++ 4.0 and later

CaptureWindowUnderCursor Example for C++ 4.0 and later

OptimizedHotkey Example for C++ 4.0 and later


CaptureActiveClient Example for C++ 4.0 and later

This is also the example for the CaptureCursorIndex property.

    /*set Capture cursor*/
    /*and include it in captured image*/
    m_LEADScr1.SetCaptureDelay(3000);
    m_LEADScr1.SetCaptureCursorIndex(1);
    m_LEADScr1.SetCaptureAreaIncludeCursor(TRUE);

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

    /*copy the captured image to a Main Control*/
    m_LEAD1.SetBitmap(m_LEADScr1.GetBitmap());


CaptureActiveWindow Example for C++ 4.0 and later

This is also the example for the CaptureCancelKey property, CaptureDelay property, CaptureCount property, CaptureInterval property, CaptureInfohWnd property, .

    /*set status cursor*/
    m_LEADScr1.SetCaptureStatusCursorIndex(11);

    /*set cancel key to ESC*/
    m_LEADScr1.SetCaptureCancelKey(VK_ESCAPE);

    m_LEADScr1.SetCaptureDelay(1000);    /*wait 5 secs before starting*/
    m_LEADScr1.SetCaptureInterval(1000); /*capture every second*/
    m_LEADScr1.SetCaptureCount(25);      /*capture 25 images*/

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

    /*display the results*/
    CString csRes;

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


CaptureArea Example for C++ 4.0 and later

This is also the example for the ScaleMode property, CaptureAreaDrawCursorIndex property, CaptureAreaFillPattern property, CaptureAreaDrawLineStyle property, CaptureAreaDrawEllipseWidth property, CaptureAreaDrawEllipseHeight property, CaptureAreaInfoLeft property, CaptureAreaInfoTop property, CaptureAreaInfoHeight property, CaptureAreaInfoWidth property, CaptureAreaShowDrawCursor property, CaptureAreaIncludeCursor property, CaptureAreaEnableKeyboard property, CaptureAreaShowOpaqueText property, CaptureAreaShowCursorPosition property, CaptureAreaShowAreaSize property, CaptureAreaShowInfoWindow property, CaptureAreaSensitiveInfoWindow property, CaptureAreaBitmapWithRegion property, CaptureAreaZoomFactor property, CaptureAreaFillForeColor property, CaptureAreaFillPattern property, CaptureAreaFillBackColor property, CaptureAreaDrawLineColor property, CaptureAreaTextForeColor property, and CaptureAreaTextBackColor property.

    m_LEADScr1.SetScaleMode(3); //set to pixels

    //show area info window
    m_LEADScr1.SetCaptureAreaShowInfoWindow(TRUE);
    //show area size during capture
    m_LEADScr1.SetCaptureAreaShowAreaSize(TRUE);
    //enable sensitive  area info window
    m_LEADScr1.SetCaptureAreaSensitiveInfoWindow(TRUE);

    //set zoom factor
    m_LEADScr1.SetCaptureAreaZoomFactor(CAPTURE_AREA_ZOOM_BY3X);

    //position capture area info window
    m_LEADScr1.SetCaptureAreaInfoTop(100.0f);
    m_LEADScr1.SetCaptureAreaInfoLeft(100.0f);
    //size the capture area info window
    m_LEADScr1.SetCaptureAreaInfoWidth(100.0f);
    m_LEADScr1.SetCaptureAreaInfoHeight(200.0f);

    //set colors
    m_LEADScr1.SetCaptureAreaDrawLineColor(RGB(0,0,0));
    m_LEADScr1.SetCaptureAreaTextForeColor(RGB(0,0,255));
    m_LEADScr1.SetCaptureAreaTextBackColor(RGB(0,0,0));

    //capture with a region
    m_LEADScr1.SetCaptureAreaBitmapWithRegion(TRUE);

    //show cursor position with opaque background
    m_LEADScr1.SetCaptureAreaShowCursorPosition(TRUE);
    m_LEADScr1.SetCaptureAreaShowOpaqueText(TRUE);

    //disable keyboard
    m_LEADScr1.SetCaptureAreaEnableKeyboard(FALSE);

    //do not include cursor in captured image
    m_LEADScr1.SetCaptureAreaIncludeCursor(FALSE);

    //setup the background
    m_LEADScr1.SetCaptureAreaFillBackColor(RGB(255,0,0));
    m_LEADScr1.SetCaptureAreaFillForeColor(RGB(0,0,255));
    m_LEADScr1.SetCaptureAreaFillPattern(CAPTURE_AREA_PATTERN_DIAGCROSS);

    //capture a round rect
    m_LEADScr1.SetCaptureAreaDrawLineStyle(CAPTURE_AREA_LINE_DASHDOT);
    m_LEADScr1.SetCaptureAreaDrawEllipseHeight(5.0f);
    m_LEADScr1.SetCaptureAreaDrawEllipseWidth(5.0f);

    //show cursor while drawing
    m_LEADScr1.SetCaptureAreaUseCrossLinesCursor(FALSE);
    m_LEADScr1.SetCaptureAreaDrawCursorIndex(1);
    m_LEADScr1.SetCaptureAreaShowDrawCursor(TRUE);

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

    //copy the image to a Main Control
    m_LEAD1.SetBitmap(m_LEADScr1.GetBitmap());


CaptureAreaOptionDlg Example for C++ 4.0 and later

This is also the example for the CaptureInfoTop, CaptureInfoLeft, CaptureInfoWidth, and CaptureInfoHeight properties.

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

    /*copy the captured image to a Main Control*/
    m_LEAD1.SetBitmap(m_LEADScr1.GetBitmap());

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

    AfxMessageBox(csRes);

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


CaptureEXE Example for C++ 4.0 and later

    m_LEADScr1.SetTransparentColor(RGB(255,255,255));
    m_LEAD1.SetTransparentColor (RGB(255,255,255));
    m_LEAD1.SetUseTransparentColor(TRUE);

    /*capture by string resource id*/
    m_LEADScr1.CaptureEXE("c:\\windows\\calc.exe", SCR_CAP_ICON, "sc", FALSE, FALSE);
    m_LEAD1.SetBitmap(m_LEADScr1.GetBitmap());
    AfxMessageBox("Wait");

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

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


CaptureEXEDlg Example for C++ 4.0 and later

This is also the example for the CaptureInfoResType, CaptureInfoResIndex, CaptureInfoResID, and CaptureInfoExeName properties.

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

    /*copy the captured image to a Main Control*/
    m_LEAD1.SetBitmap(m_LEADScr1.GetBitmap());

    /*display results*/
    CString csRes;

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


CaptureFullScreen Example for C++ 4.0 and later

This is the example for the Bitmap property.

    /*set a 3 sec delay*/
    m_LEADScr1.SetCaptureDelay(3000);
    /*capture the entire screen*/
    m_LEADScr1.CaptureFullScreen();
    /*copy the captured image to a Main Control*/
    m_LEAD1.SetBitmap(m_LEADScr1.GetBitmap());


CaptureGetResourceCount Example for C++ 4.0 and later

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


CaptureHotKey Example for C++ 4.0 and later

This is also the example for the CaptureHotKeyModifiers property.

   m_LEADScr1.SetCaptureCount(1);
    /*set hotkey to Ctrl + F12*/
    m_LEADScr1.SetCaptureHotKey(123); /*F12*/
    m_LEADScr1.SetCaptureHotKeyModifiers(SCR_MOD_CONTROL);
    m_LEADScr1.CaptureArea(SCR_CAP_AREA_RECT);


CaptureHotKeyPressed Example for C++ 4.0 and later

void CScrcapDlg::OnOnCaptureHotKeyPressedLeadscrctrl1()
{
   int ret;

   ret = AfxMessageBox("Do you want to capture?", MB_YESNO);
   if (ret == IDNO)
      if(m_LEADScr1.IsCaptureActive())
         /*cancel the capture*/
         m_LEADScr1.StopCapture();
}


CaptureImage Example for C++ 4.0 and later

void CScrcapDlg::OnOnCaptureImageLeadscrctrl1(long CaptureNumber)
{
    /*copy the captured image to a Main Control and save it*/
    m_LEAD1.SetBitmap(m_LEADScr1.GetBitmap());
    m_LEAD1.Save("d:\\temp\\test.tif", FILE_TIF, 0, 2, SAVE_APPEND);
}


CaptureMenuUnderCursor Example for C++ 4.0 and later

    /*set a 5 sec delay*/
    m_LEADScr1.SetCaptureDelay(5000);
    /*capture a menu*/
    m_LEADScr1.CaptureMenuUnderCursor();
    /*copy the captured image to a Main Control*/
    m_LEAD1.SetBitmap(m_LEADScr1.GetBitmap());


CaptureMouseCursor Example for C++ 4.0 and later

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


CaptureObjectOptionDlg Example for C++ 4.0 and later

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


CaptureOptionDlg Example for C++ 4.0 and later

   short nRet;

   /*disable errors to check for cancel*/
   m_LEADScr1.SetEnableMethodErrors(FALSE);
   /*display capture option dialog*/
   nRet = m_LEADScr1.CaptureOptionDlg((long)this->m_hWnd);
   if (nRet != 0)
   {
      if (nRet != ERROR_USER_ABORT)
         AfxMessageBox("Error setting options!");
   }


CaptureSelectedObject Example for C++ 4.0 and later

This is also the example for the CaptureObjectSelectCursorIndex, CaptureObjectInvert, CaptureObjectEnableKeyboard, CaptureObjectBorderWidth properties.

    /*set cursor*/
    m_LEADScr1.SetCaptureObjectSelectCursorIndex(1);

    /*disable invert colors*/
    m_LEADScr1.SetCaptureObjectInvert(FALSE);

    /*disable keyboard*/
    m_LEADScr1.SetCaptureObjectEnableKeyboard(FALSE);

    /*set object border width*/
    m_LEADScr1.SetCaptureObjectBorderWidth(3);

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

    /*copy the captured image to a Main Control*/
    m_LEAD1.SetBitmap(m_LEADScr1.GetBitmap());

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


CaptureWallPaper Example for C++ 4.0 and later

    /*capture the wallpaper*/
    m_LEADScr1.CaptureWallPaper();
    /*copy the captured image to a Main Control*/
    m_LEAD1.SetBitmap(m_LEADScr1.GetBitmap());


CaptureWindowUnderCursor Example for C++ 4.0 and later

    /*set 3 sec delay*/
    m_LEADScr1.SetCaptureDelay(3000);

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

    /*copy the captured image to a Main Control*/
    m_LEAD1.SetBitmap(m_LEADScr1.GetBitmap());


OptimizedHotkey Example for C++ 4.0 and later

void CMFCDlg::OnButton1()
{
    //set cancel key to ESC
    m_LEADSCRCAP1.SetCaptureCancelKey(VK_ESCAPE);

    //set hotkey
    m_LEADSCRCAP1.SetCaptureHotKey(123);/*F12*/

    //enable optimized hotkey
    m_LEADSCRCAP1.SetOptimizedHotkey(TRUE);

    //start the captures
    m_LEADSCRCAP1.CaptureActiveWindow();
}

void CMFCDlg::OnOnCaptureImageLeadscrctrl1(long CaptureNumber)
{
   //get the captured image here
   m_LEAD1.SetBitmap(m_LEADSCRCAP1.GetBitmap());
}


Tutorial for Delphi 2.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.

Note:	These tutorial examples are not intended to demonstrate good Delphi 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 (Delphi 2.0)

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

1.	Start Delphi 2.0.
2.	In the File menu, choose New Application.
3.	On the Delphi toolbar, click the OCX tab.   If you have used a LEAD ActiveX control before, the icon appears on the toolbar.  Otherwise, add the LEAD Controls as follows:
	a.	On the Component menu choose Install. (We assume that the LEAD Controls have already been registered).
	b.	In the Install Components dialog box, click the OCX button.
	c.	In the Import OLE control dialog box, click LEAD Screen Capture Control (14) and click OK.
	d.	In the Import OLE control dialog box, click LEAD Main Control (14) and click OK.  Click OK on the Install Components dialog box to update the toolbar. (This may take a little while.)
	e.	In the Project menu, select Add to Project and add the LEADDEF.PAS and LTSCROCX.PAS files to your project.
	f.	Click the Unit1 tab in the Unit1.Pas window.  In the File menu, select Use Unit.  Highlight LEADDEF and click OK. Again select Use Unit in the File menu.  Highlight LTSCROCX and click OK.
4.	Select the LEAD Main Control on the OCX toolbar and add it to the form.  Size and position the control as you want it to appear at run time.  Change the Name to LEAD1.
5.	Select the LEAD Screen Capture Control on the OCX toolbar and add it to the form. Change the Name to LEADScr1.
6.	Add a command button and name it as follows:
	Name	Caption
	CapWin	Capture Window
7.	Code the CapWinClick procedure as follows:
procedure TForm1.CapWinClick(Sender: TObject);
begin
LeadScr1.CaptureHotKey = 121;
LeadScr1.CaptureDelay := 2000;
LeadScr1.CaptureActiveWindow();
Lead1.Bitmap := LeadScr1.Bitmap;
end;

8.	Code the main form's FormClose procedure as follows:
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
LeadScr1.StopCapture();
end;

9.	Run your program to test it.  Click the Capture Window command button, select the window to capture, and press F11.
10.	Save the project to use as a starting point for other tasks in the tutorial.


Capturing an Area (Delphi 2.0)

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 (Delphi).
2.	Add a command button and name it as follows:
	Name	Caption
	CapArea	Capture Area
3.	Code the CapAreaClick procedure as follows:
procedure TForm1.CapAreaClick(Sender: TObject);
begin
{set the units of measure}
LEADScr1.ScaleMode := 3;

{set up the info window}
LEADScr1.CaptureAreaShowInfoWindow := True;
LEADScr1.CaptureAreaInfoTop := 0;
LEADScr1.CaptureAreaInfoLeft := 0;
LEADScr1.CaptureAreaInfoHeight := 300;
LEADScr1.CaptureAreaInfoWidth := 300;

{show area size and cursor information on an opaque background}
LEADScr1.CaptureAreaShowAreaSize := True;
LEADScr1.CaptureAreaShowCursorPosition := True;
LEADScr1.CaptureAreaShowOpaqueText := True;

{set text colors, fill colors, fill pattern, and line style}
LEADScr1.CaptureAreaDrawLineColor := RGB(0, 0, 0);
LEADScr1.CaptureAreaTextBackColor := RGB(0, 0, 255);
LEADScr1.CaptureAreaTextForeColor := RGB(255, 255, 255);
LEADScr1.CaptureAreaFillBackColor := RGB(255, 0, 0);
LEADScr1.CaptureAreaFillForeColor := RGB(0, 0, 255);
LEADScr1.CaptureAreaFillPattern := CAPTURE_AREA_PATTERN_CROSS;
LEADScr1.CaptureAreaDrawLineStyle := CAPTURE_AREA_LINE_DASH;

{do not include the cursor in the image}
LEADScr1.CaptureAreaIncludeCursor := False;

{do not enable the keyboard}
LEADScr1.CaptureAreaEnableKeyboard := False;

{save a bitmap with a region}
LEADScr1.CaptureAreaBitmapWithRegion := True;

{make the info window sensitive to the position of the cursor}
LEADScr1.CaptureAreaSensitiveInfoWindow := True;

{zoom the image in the info window}
LEADScr1.CaptureAreaZoomFactor := CAPTURE_AREA_ZOOM_BY2X;

{use the cross lines cursor instead of the CaptureAreaDrawCursorIndex}
LEADScr1.CaptureAreaUseCrossLinesCursor := True;
LEADScr1.CaptureAreaShowDrawCursor := True;

{capture a triangular area}
LEADScr1.CaptureArea (SCR_CAP_AREA_TRIANGLE);

{assign the Screen Capture Control bitmap to the Main Control bitmap}
LEAD1.Bitmap := LEADScr1.Bitmap;

end;

4.	Run your program to test it.  Click the Capture Area control button, press F11, and click and drag to select the area to capture.


Capturing an Icon from an EXE (Delphi 2.0)

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 (Delphi).
2.	Select the LEAD Main Control on the OCX toolbar and add it to the form.  Size and position the control as you want it to appear at run time.  Change the Name to LEAD2.
3.	Select the LEAD Main Control on the OCX toolbar and add it to the form.  Size and position the control as you want it to appear at run time.  Change the Name to LEAD3.
4.	Add a command button and name it as follows:
	Name	Caption
	CapEXE	Capture EXE
5.	Code the CapEXEClick procedure as follows:
procedure TForm1.CapEXEClick(Sender: TObject);
var
nCount : Smallint;
begin
nCount := 0;

LEADScr1.CaptureGetResourceCount ('c:\windows\calc.exe', SCR_CAP_ICON, nCount);
if (nCount < 1) then
   ShowMessage ('No Icons.');

if (nCount >= 1) then
begin
   LEADScr1.TransparentColor := RGB(255, 255, 255);
   LEAD1.TransparentColor:= RGB(255, 255, 255);
   LEAD1.UseTransparentColor := True;
   {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. }
   LEADScr1.CaptureEXE ('c:\windows\calc.exe', SCR_CAP_ICON, 'sc', 0, 0);
   LEAD1.Bitmap := LEADScr1.Bitmap;
   ShowMessage ('Wait');
end;

nCount := 0;
LEADScr1.CaptureGetResourceCount ('c:\windows\defrag.exe', SCR_CAP_ICON, nCount);
if (nCount < 1) then
   ShowMessage ('No Icons.');

if (nCount >= 1) then
begin
   LEADScr1.TransparentColor := RGB(255, 255, 255);
   LEAD2.TransparentColor := RGB(255, 255, 255);
   LEAD2.UseTransparentColor := True;
   {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. }
   LEADScr1.CaptureEXE ('c:\windows\defrag.exe', SCR_CAP_ICON, '111', 1, 0);
   LEAD2.Bitmap := LEADScr1.Bitmap;
   ShowMessage ('wait');
end;
nCount := 0;
LEADScr1.CaptureGetResourceCount ('c:\windows\Charmap.exe', SCR_CAP_ICON, nCount);
if (nCount < 1) then
   ShowMessage ('No Icons.');

if (nCount >= 1) then
begin
   LEADScr1.TransparentColor := RGB(255, 255, 255);
   LEAD3.TransparentColor := RGB(255, 255, 255);
   LEAD3.UseTransparentColor := True;
   {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. }
   LEADScr1.CaptureEXE ('c:\windows\Charmap.exe', SCR_CAP_ICON, '0', 1, 1);
   LEAD3.Bitmap := LEADScr1.Bitmap;
   ShowMessage ('wait');
end;

end;

6.	Run your program to test it.


Capturing a Selected Object (Delphi 2.0)

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 (Delphi).
2.	Add a command button and name it as follows:
	Name	Caption
	CapSelect	Capture Selected
3.	Code the CapSelectClick procedure as follows:
procedure TForm1.CapSelectClick(Sender: TObject);
begin
    {display the capture selected object dialog}
    LEADScr1.CaptureObjectOptionDlg(handle);
    {capture the selected object}
    LEADScr1.CaptureSelectedObject();
    {assign the screen control bitmap to the Main control bitmap}
    LEAD1.Bitmap := LEADScr1.Bitmap;
    {reset the object options}
    LEADScr1.ResetObjectOptions();
end;

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. Move the cursor over the object you wish to capture and click the left mouse button.


Capturing Multiple Images (Delphi 2.0)

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 (Delphi).
2.	Add two command buttons and name them as follows:
	Name	Caption
	CapMulti	Capture Multi
	Display	Display Multi
3.	Code the CapMultiClick procedure as follows:
procedure TForm1.CapMultiClick(Sender: TObject);
begin
{set the cancel key}
LEADScr1.CaptureCancelKey := VK_ESCAPE;
{set the delay, the interval, and the number of captures to perform}
LEADScr1.CaptureDelay := 2000;
LEADScr1.CaptureInterval := 2000;
LEADScr1.CaptureCount := 3;
{capture}
LEADScr1.CaptureActiveClient();
end;

4.	Code the DisplayClick procedure as follows:
procedure TForm1.DisplayClick(Sender: TObject);
begin
LEAD1.Load ('D:\Temp\Multi.tif', 0, 1, 1);
LEAD2.Load('D:\Temp\Multi.tif', 0, 2, 1);
LEAD3.Load('D:\Temp\Multi.tif', 0, 3, 1);
{remove the tif file so you can capture and display again without having to restart the program}
DeleteFile('D:\Temp\Multi.tif');
end;

5.	Code the OnCaptureImage procedure as follows:
procedure TForm1.LeadScr1OnCaptureImage(Sender: TObject;
  CaptureNumber: Integer);
begin
{copy the captured image to the Main control and save it}
LEAD1.Bitmap := LEADScr1.Bitmap;
LEAD1.Save ('D:\Temp\Multi.tif', FILE_TIF, 0, 2, SAVE_APPEND);
end;

6.	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 (Delphi 2.0)

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 Delphi 2.0

CaptureActiveWindow Example for Delphi 2.0

CaptureArea Example for Delphi 2.0

CaptureAreaOptionDlg Example for Delphi 2.0

CaptureEXE Example for Delphi 2.0

CaptureEXEDlg Example for Delphi 2.0

CaptureFullScreen Example for Delphi 2.0

CaptureGetResourceCount Example for Delphi 2.0

CaptureHotKey Example for Delphi 2.0

CaptureHotKeyPressed Example for Delphi 2.0

CaptureImage Example for Delphi 2.0

CaptureMenuUnderCursor Example for Delphi 2.0

CaptureMouseCursor Example for Delphi 2.0

CaptureObjectOptionDlg Example for Delphi 2.0

CaptureOptionDlg Example for Delphi 2.0

CaptureSelectedObject Example for Delphi 2.0

CaptureWallPaper Example for Delphi 2.0

CaptureWindowUnderCursor Example for Delphi 2.0


CaptureActiveClient Example for Delphi 2.0

This is also the example for the CaptureCursorIndex property.

    {set Capture cursor}
    {and include it in captured image}
    LEADScr1.CaptureDelay := 3000;
    LEADScr1.CaptureCursorIndex := 1;
    LEADScr1.CaptureAreaIncludeCursor := True;

    {capture the client area of the active window}
    LEADScr1.CaptureActiveClient();

    {copy the captured image to a Main Control}
    LEAD1.Bitmap := LEADScr1.Bitmap;


CaptureActiveWindow Example for Delphi 2.0

This is also the example for the CaptureCancelKey property, CaptureDelay property, CaptureCount property, CaptureInterval property, CaptureInfohWnd property, .

{set status cursor}
    LEADScr1.CaptureStatusCursorIndex := 11;

    {set cancel key to ESC}
    LEADScr1.CaptureCancelKey := VK_ESCAPE;

    LEADScr1.CaptureDelay := 1000;    {wait 5 secs before starting}
    LEADScr1.CaptureInterval := 1000; {capture every second}
    LEADScr1.CaptureCount := 25;      {capture 25 images}

    {start the captures}
    LEADScr1.CaptureActiveWindow();

    {display the results}
    Edit1.Text := IntToStr(LEADScr1.CaptureInfohWnd);


CaptureArea Example for Delphi 2.0

This is also the example for the ScaleMode property, CaptureAreaDrawCursorIndex property, CaptureAreaFillPattern property, CaptureAreaDrawLineStyle property, CaptureAreaDrawEllipseWidth property, CaptureAreaDrawEllipseHeight property, CaptureAreaInfoLeft property, CaptureAreaInfoTop property, CaptureAreaInfoHeight property, CaptureAreaInfoWidth property, CaptureAreaShowDrawCursor property, CaptureAreaIncludeCursor property, CaptureAreaEnableKeyboard property, CaptureAreaShowOpaqueText property, CaptureAreaShowCursorPosition property, CaptureAreaShowAreaSize property, CaptureAreaShowInfoWindow property, CaptureAreaSensitiveInfoWindow property, CaptureAreaBitmapWithRegion property, CaptureAreaZoomFactor property, CaptureAreaFillForeColor property, CaptureAreaFillPattern property, CaptureAreaFillBackColor property, CaptureAreaDrawLineColor property, CaptureAreaTextForeColor property, and CaptureAreaTextBackColor property.

LEADScr1.ScaleMode := 3; {set to pixels}

    {show area info window}
    LEADScr1.CaptureAreaShowInfoWindow := True;
    {show area size during capture}
    LEADScr1.CaptureAreaShowAreaSize := True;
    {enable sensitive  area info window}
    LEADScr1.CaptureAreaSensitiveInfoWindow := True;

    {set zoom factor}
    LEADScr1.CaptureAreaZoomFactor := CAPTURE_AREA_ZOOM_BY3X;

    {position capture area info window}
    LEADScr1.CaptureAreaInfoTop := 100;
    LEADScr1.CaptureAreaInfoLeft := 100;
    {size the capture area info window}
    LEADScr1.CaptureAreaInfoWidth := 100;
    LEADScr1.CaptureAreaInfoHeight := 200;

    {set colors}
    LEADScr1.CaptureAreaDrawLineColor := RGB(0,0,0);
    LEADScr1.CaptureAreaTextForeColor := RGB(0,0,255);
    LEADScr1.CaptureAreaTextBackColor := RGB(0,0,0);

    {capture with a region}
    LEADScr1.CaptureAreaBitmapWithRegion := True;

    {show cursor position with opaque background}
    LEADScr1.CaptureAreaShowCursorPosition := True;
    LEADScr1.CaptureAreaShowOpaqueText := True;

    {disable keyboard}
    LEADScr1.CaptureAreaEnableKeyboard := False;

    {do not include cursor in captured image}
    LEADScr1.CaptureAreaIncludeCursor := False;

    {setup the background}
    LEADScr1.CaptureAreaFillBackColor := RGB(255,0,0);
    LEADScr1.CaptureAreaFillForeColor := RGB(0,0,255);
    LEADScr1.CaptureAreaFillPattern := CAPTURE_AREA_PATTERN_DIAGCROSS;

    {capture a round rect}
    LEADScr1.CaptureAreaDrawLineStyle := CAPTURE_AREA_LINE_DASHDOT;
    LEADScr1.CaptureAreaDrawEllipseHeight := 5;
    LEADScr1.CaptureAreaDrawEllipseWidth := 5;

    {show cursor while drawing}
    LEADScr1.CaptureAreaUseCrossLinesCursor := False;
    LEADScr1.CaptureAreaDrawCursorIndex := 1;
    LEADScr1.CaptureAreaShowDrawCursor := True;

    {do the capture}
    LEADScr1.CaptureArea(SCR_CAP_AREA_ROUNDRECT);

    {copy the image to a Main Control}
    LEAD1.Bitmap := LEADScr1.Bitmap;


CaptureAreaOptionDlg Example for Delphi 2.0

This is also the example for the CaptureInfoTop, CaptureInfoLeft, CaptureInfoWidth, and CaptureInfoHeight properties.

{set options}
    LEADScr1.CaptureAreaOptionDlg(handle);
    {do a capture using these options}
    LEADScr1.CaptureArea(LEADScr1.CaptureAreaType);

    {copy the captured image to a Main Control}
    LEAD1.Bitmap := LEADScr1.Bitmap;

    {display the capture result info}
    Edit1.Text := IntToStr(Round(LEADScr1.CaptureInfoTop));
    Edit2.Text := IntToStr(Round(LEADScr1.CaptureInfoLeft));
    Edit3.Text := IntToStr(Round(LEADScr1.CaptureInfoWidth));
    Edit4.Text := IntToStr(Round(LEADScr1.CaptureInfoHeight));

    {reset area options}
    LEADScr1.ResetAreaOptions();


CaptureEXE Example for Delphi 2.0

    LEADScr1.TransparentColor := RGB(255,255,255);
    LEAD1.TransparentColor  := RGB(255,255,255);
    LEAD1.UseTransparentColor := True;

    {capture by string resource id}
    LEADScr1.CaptureEXE('c:\windows\calc.exe', SCR_CAP_ICON, 'sc', 0, 0);
    LEAD1.Bitmap := LEADScr1.Bitmap;
    ShowMessage('Wait');

    {now, capture by numeric resource id}
    LEADScr1.CaptureEXE('c:\windows\defrag.exe', SCR_CAP_ICON, '111', -1, 0);
    LEAD1.Bitmap := LEADScr1.Bitmap;
    ShowMessage('Wait');

    {finally, capture by resource index}
    LEADScr1.CaptureEXE('c:\windows\calc.exe', SCR_CAP_ICON, '0', -1, -1);
    LEAD1.Bitmap := LEADScr1.Bitmap;
    ShowMessage('Wait');


CaptureEXEDlg Example for Delphi 2.0

This is also the example for the CaptureInfoResType, CaptureInfoResIndex, CaptureInfoResID, and CaptureInfoExeName properties.

{display CaptureExe Dialog}
    LEADScr1.CaptureEXEDlg(handle, 'c:\windows\calc.exe', SCR_CAP_ALL, SCR_CAP_EXEDLG_TREEVIEW);

    {copy the captured image to a Main Control}
    LEAD1.Bitmap := LEADScr1.Bitmap;

    {display results}
    Edit1.Text := IntToStr(LEADScr1.CaptureInfoResType);
    Edit2.Text := IntToStr(LEADScr1.CaptureInfoResIndex);
    Edit3.Text := LEADScr1.CaptureInfoResourceId;
    Edit4.Text := LEADScr1.CaptureInfoExeName;


CaptureFullScreen Example for Delphi 2.0

This is the example for the Bitmap property.

    {set a 3 sec delay}
    LEADScr1.CaptureDelay := 3000;
    {capture the entire screen}
    LEADScr1.CaptureFullScreen();
    {copy the captured image to a Main Control}
    LEAD1.Bitmap := LEADScr1.Bitmap;


CaptureGetResourceCount Example for Delphi 2.0

    var
    nCount : SmallInt;
    begin
        nCount := 0;
        {are there any icons in the file?}
        LEADScr1.CaptureGetResourceCount('c:\windows\calc.exe', SCR_CAP_ICON, nCount);
        If (nCount < 1) Then
            ShowMessage('No Icons!');
    end;


CaptureHotKey Example for Delphi 2.0

This is also the example for the CaptureHotKeyModifiers property.

    LEADScr1.CaptureCount := 1;
    {set hotkey to  + F12}
    LEADScr1.CaptureHotKey := 123; {F12}
    LEADScr1.CaptureHotKeyModifiers := SCR_MOD_CONTROL;
    LEADScr1.CaptureArea(SCR_CAP_AREA_RECT);


CaptureHotKeyPressed Example for Delphi 2.0

procedure TForm1.LeadScrCtrl1OnCaptureHotKeyPressed(Sender: TObject);
var
ret : Word;
bRet : boolean;
begin
    ret := MessageDlg('Do you want to capture?', mtConfirmation, [mbYes, mbNo], 0);
    if (ret = mrNo) then
    begin
        bRet := LEADScr1.IsCaptureActive();
        If (bRet) Then
            {cancel the capture}
            LEADScr1.StopCapture();
    end;
end;


CaptureImage Example for Delphi 2.0

procedure TForm1.LeadScrCtrl1OnCaptureImage(Sender: TObject;
  CaptureNumber: Integer);
begin
    {copy the captured image to a Main Control and save it}
    LEAD1.Bitmap := LEADScr1.Bitmap;
    LEAD1.Save('d:\temp\test.tif', FILE_TIF, 0, 2, SAVE_APPEND);
end;


CaptureMenuUnderCursor Example for Delphi 2.0

    {set a 5 sec delay}
    LEADScr1.CaptureDelay := 5000;
    {capture a menu}
    LEADScr1.CaptureMenuUnderCursor();
    {copy the captured image to a Main Control}
    LEAD1.Bitmap := LEADScr1.Bitmap;


CaptureMouseCursor Example for Delphi 2.0

    {capture current mouse cursor}
    LEADScr1.CaptureMouseCursor();
    {copy the captured image to a Main Control}
    LEAD1.Bitmap := LEADScr1.Bitmap;


CaptureObjectOptionDlg Example for Delphi 2.0

    {display the capture selected object dialog}
    LEADScr1.CaptureObjectOptionDlg(handle);


CaptureOptionDlg Example for Delphi 2.0

Var
nRet : Integer;
begin
    {disable errors to check for cancel}
    LEADScr1.EnableMethodErrors := False;
    {display capture option dialog}
    nRet := LEADScr1.CaptureOptionDlg(handle);
    If (nRet <> 0) Then
        If (nRet <> ERROR_USER_ABORT) Then
            ShowMessage('Error setting options!');
end;


CaptureSelectedObject Example for Delphi 2.0

This is also the example for the CaptureObjectSelectCursorIndex, CaptureObjectInvert, CaptureObjectEnableKeyboard, CaptureObjectBorderWidth properties.

    {set cursor}
    LEADScr1.CaptureObjectSelectCursorIndex := 1;

    {disable invert colors}
    LEADScr1.CaptureObjectInvert := False;

    {disable keyboard}
    LEADScr1.CaptureObjectEnableKeyboard := False;

    {set object border width}
    LEADScr1.CaptureObjectBorderWidth := 3;

    {do the capture}
    LEADScr1.CaptureSelectedObject();

    {copy the captured image to a Main Control}
    LEAD1.Bitmap := LEADScr1.Bitmap;

    {reset options}
    LEADScr1.ResetObjectOptions();


CaptureWallPaper Example for Delphi 2.0

    {capture the wallpaper}
    LEADScr1.CaptureWallPaper();
    {copy the captured image to a Main Control}
    LEAD1.Bitmap := LEADScr1.Bitmap;


CaptureWindowUnderCursor Example for Delphi 2.0

    {set 3 sec delay}
    LEADScr1.CaptureDelay := 3000;

    {capture window under cursor}
    LEADScr1.CaptureWindowUnderCursor();

    {copy the captured image to a Main Control}
    LEAD1.Bitmap := LEADScr1.Bitmap;


Miscellaneous Examples (Visual J++)

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 J++

CaptureActiveWindow example for Visual J++

CaptureArea Example for Visual J++

CaptureAreaOptionDlg example for Visual J++

CaptureEXE example for Visual J++

CaptureEXEDlg example for Visual J++

CaptureFullScreen example for Visual J++

CaptureGetResourceCount example for Visual J++

CaptureHotKey example for Visual J++

CaptureHotKeyPressed example for Visual J++

CaptureImage example for Visual J++

CaptureMenuUnderCursor example for Visual J++

CaptureMouseCursor example for Visual J++

CaptureObjectOptionDlg Example for Visual J++

CaptureOptionDlg Example for Visual J++

CaptureSelectedObject Example for Visual J++

CaptureWallPaper Example for Visual J++

CaptureWindowUnderCursor Example for Visual J++


CaptureActiveClient Example for Visual J++

This is also the example for the CaptureCursorIndex and CaptureCursor properties.

// set custom Capture cursor
// and include it in captured image
LEADScr1.setCaptureDelay( 3000 );
LEADScr1.setCaptureCursor( new Icon( "c:\\temp\\test.cur" ) );
LEADScr1.setCaptureCursorIndex( (short) 99 );
LEADScr1.setCaptureAreaIncludeCursor( true );

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

// copy the captured image to a Main Control
LEAD1.setBitmap ( LEADScr1.getBitmap() );


CaptureActiveWindow Example for Visual J++

This is also the example for the CaptureCancelKey property, CaptureDelay property, CaptureCount property, CaptureInterval property, CaptureInfohWnd property, .

// set custom status cursor
LEADScr1.setCaptureStatusCursor( new Icon( "c:\\temp\\test.cur" ) );
LEADScr1.setCaptureStatusCursorIndex( (short) 99 );

// set cancel key to ESC
LEADScr1.setCaptureCancelKey( (short) Key.ESCAPE );

LEADScr1.setCaptureDelay( 5000 );  // wait 5 secs before starting
LEADScr1.setCaptureInterval( 1000 );  // capture every second
LEADScr1.setCaptureCount( (short) 25 );  // capture 25 images

// start the captures
LEADScr1.CaptureActiveWindow();

// display the results
edit1.setText( Integer.toString( LEADScr1.getCaptureInfohWnd() ) );


CaptureArea Example for Visual J++

This is also the example for the ScaleMode property, CaptureAreaDrawCursorIndex property, CaptureAreaFillPattern property, CaptureAreaDrawLineStyle property, CaptureAreaDrawEllipseWidth property, CaptureAreaDrawEllipseHeight property, CaptureAreaInfoLeft property, CaptureAreaInfoTop property, CaptureAreaInfoHeight property, CaptureAreaInfoWidth property, CaptureAreaShowDrawCursor property, CaptureAreaIncludeCursor property, CaptureAreaEnableKeyboard property, CaptureAreaShowOpaqueText property, CaptureAreaShowCursorPosition property, CaptureAreaShowAreaSize property, CaptureAreaShowInfoWindow property, CaptureAreaSensitiveInfoWindow property, CaptureAreaBitmapWithRegion property, CaptureAreaZoomFactor property, CaptureAreaFillForeColor property, CaptureAreaFillPattern property, CaptureAreaFillBackColor property, CaptureAreaDrawLineColor property, CaptureAreaTextForeColor property, and CaptureAreaTextBackColor property.

// show area info window
LEADScr1.setCaptureAreaShowInfoWindow( true );

// show area size during capture
LEADScr1.setCaptureAreaShowAreaSize( true );

// enable sensitive  area info window
LEADScr1.setCaptureAreaSensitiveInfoWindow( true );

// set zoom factor
LEADScr1.setCaptureAreaZoomFactor( (short) ltscr14n.__MIDL___MIDL_itf_ltscr_0136_0010.CAPTURE_AREA_ZOOM_BY3X );

// position capture area info window
LEADScr1.setCaptureAreaInfoTop( 1440 );
LEADScr1.setCaptureAreaInfoLeft( 1440 );

// size the capture area info window
LEADScr1.setCaptureAreaInfoWidth( 1440 );
LEADScr1.setCaptureAreaInfoHeight( 2880 );

// set colors
LEADScr1.setCaptureAreaDrawLineColor( Color.BLACK );
LEADScr1.setCaptureAreaTextForeColor( Color.BLUE );
LEADScr1.setCaptureAreaTextBackColor( Color.BLACK );

// capture with a region
LEADScr1.setCaptureAreaBitmapWithRegion( true );

// show cursor position with opaque background
LEADScr1.setCaptureAreaShowCursorPosition( true );
LEADScr1.setCaptureAreaShowOpaqueText( true );

// disable keyboard
LEADScr1.setCaptureAreaEnableKeyboard( false );

// do not include cursor in captured image
LEADScr1.setCaptureAreaIncludeCursor( false );

// setup the background
LEADScr1.setCaptureAreaFillBackColor( Color.RED );
LEADScr1.setCaptureAreaFillForeColor( Color.BLUE );
LEADScr1.setCaptureAreaFillPattern( (short) ltscr14n.__MIDL___MIDL_itf_ltscr_0136_0005.CAPTURE_AREA_PATTERN_DIAGCROSS );

// capture a round rect
LEADScr1.setCaptureAreaDrawLineStyle( (short) ltscr14n.__MIDL___MIDL_itf_ltscr_0136_0006.CAPTURE_AREA_LINE_DASHDOT );
LEADScr1.setCaptureAreaDrawEllipseHeight( 500 );
LEADScr1.setCaptureAreaDrawEllipseWidth( 500 );

// show custom cursor while drawing
LEADScr1.setCaptureAreaDrawCursor( new Icon( "c:\\temp\\test.cur" ) );
LEADScr1.setCaptureAreaDrawCursorIndex( (short) 99 );
LEADScr1.setCaptureAreaUseCrossLinesCursor( false );
LEADScr1.setCaptureAreaShowDrawCursor( true );

// do the capture
LEADScr1.CaptureArea( (short) ltscr14n.__MIDL___MIDL_itf_ltscr_0136_0002.SCR_CAP_AREA_ROUNDRECT );

// copy the image to a Main Control
LEAD1.setBitmap( LEADScr1.getBitmap() );


CaptureAreaOptionDlg Example for Visual J++

This is also the example for the CaptureInfoTop, CaptureInfoLeft, CaptureInfoWidth, and CaptureInfoHeight properties.

// set options
LEADScr1.CaptureAreaOptionDlg( getHandle() );

// do a capture using these options
LEADScr1.CaptureArea(  LEADScr1.getCaptureAreaType() );

// copy the captured image to a Main Control
LEAD1.setBitmap ( LEADScr1.getBitmap() );

// display the capture result info
edit1.setText( Float.toString( LEADScr1.getCaptureInfoTop() ) );
edit2.setText( Float.toString( LEADScr1.getCaptureInfoLeft() ) );
edit3.setText( Float.toString( LEADScr1.getCaptureInfoWidth() ) );
edit4.setText( Float.toString( LEADScr1.getCaptureInfoHeight() ) );

// reset area options
LEADScr1.ResetAreaOptions();


CaptureEXE Example for Visual J++

LEADScr1.setTransparentColor( Color.WHITE );
LEAD1.setTransparentColor( Color.WHITE );
LEAD1.setUseTransparentColor( true );

// capture by string resource id
LEADScr1.CaptureEXE( "c:\\windows\\calc.exe", ltscr14n.__MIDL___MIDL_itf_ltscr_0136_0001.SCR_CAP_ICON, "sc", 0, 0 );
LEAD1.setBitmap ( LEADScr1.getBitmap() );
MessageBox.show( "wait" );

// now, capture by numeric resource id
LEADScr1.CaptureEXE( "c:\\windows\\defrag.exe", ltscr14n.__MIDL___MIDL_itf_ltscr_0136_0001.SCR_CAP_ICON, "111", 1, 0 );
LEAD1.setBitmap ( LEADScr1.getBitmap() );
MessageBox.show( "wait" );

// finally, capture by resource index
LEADScr1.CaptureEXE( "c:\\windows\\calc.exe", ltscr14n.__MIDL___MIDL_itf_ltscr_0136_0001.SCR_CAP_ICON, "0", 1, 1 );
LEAD1.setBitmap ( LEADScr1.getBitmap() );
MessageBox.show( "wait" );


CaptureEXEDlg Example for Visual J++

This is also the example for the CaptureInfoResType, CaptureInfoResIndex, CaptureInfoResID, and CaptureInfoExeName properties.

// display CaptureExe Dialog
LEADScr1.CaptureEXEDlg( getHandle(), "c:\\windows\\calc.exe",
                        (short) ltscr14n.__MIDL___MIDL_itf_ltscr_0136_0001.SCR_CAP_ALL,
                        (short) ltscr14n.__MIDL___MIDL_itf_ltscr_0136_0004.SCR_CAP_EXEDLG_TREEVIEW );

// copy the captured image to a Main Control
LEAD1.setBitmap ( LEADScr1.getBitmap() );

// display results
edit1.setText( Integer.toString( LEADScr1.getCaptureInfoResType() ) );
edit2.setText( Integer.toString( LEADScr1.getCaptureInfoResIndex() ) );
edit3.setText( LEADScr1.getCaptureInfoResourceId() );
edit4.setText( LEADScr1.getCaptureInfoExeName() );


CaptureFullScreen Example for Visual J++

This is the example for the Bitmap property.

// set a 3 sec delay
LEADScr1.setCaptureDelay( 3000 );

// capture the entire screen
LEADScr1.CaptureFullScreen();

// copy the captured image to a Main Control
LEAD1.setBitmap ( LEADScr1.getBitmap() );


CaptureGetResourceCount Example for Visual J++

short psCount[] = { 0 };

// are there any icons in the file?
LEADScr1.CaptureGetResourceCount( "c:\\windows\\calc.exe",
                                 (short) ltscr14n.__MIDL___MIDL_itf_ltscr_0136_0001.SCR_CAP_ICON, psCount );
if( psCount[ 0 ] < 1 )
   MessageBox.show( "No Icons!" );


CaptureHotKey Example for Visual J++

This is also the example for the CaptureHotKeyModifiers property.

LEADScr1.setCaptureCount( (short) 1 );

// set hotkey to Ctrl + F12
LEADScr1.setCaptureHotKey( (short) Key.F12 );
LEADScr1.setCaptureHotKeyModifiers( (short) ltscr14n.__MIDL___MIDL_itf_ltscr_0136_0013.SCR_MOD_CONTROL );
LEADScr1.CaptureArea( (short) ltscr14n.__MIDL___MIDL_itf_ltscr_0136_0002.SCR_CAP_AREA_RECT );


CaptureHotKeyPressed Example for Visual J++

Private Sub LEADScr1_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 = LEADScr1.IsCaptureActive
        If (bRet) Then
            LEADScr1.StopCapture
        End If
    End If
 End Sub


CaptureImage Example for Visual J++

private void LEADScr1_onCaptureImage(Object source, ltscr14n.LEADScr.OnCaptureImageEvent e)
{
   // copy the captured image to a Main Control and save it
   LEAD1.setBitmap ( LEADScr1.getBitmap() );
   LEAD1.Save ( "c:\\temp\\test.tif", (short) ltocx14n.FileConstants.FILE_TIF,
               (short) 0, (short) 2, (short) ltocx14n.SaveModifyConstants.SAVE_APPEND );
}


CaptureMenuUnderCursor Example for Visual J++

// set a 5 sec delay
LEADScr1.setCaptureDelay( 5000 );

// capture a menu
LEADScr1.CaptureMenuUnderCursor();

// copy the captured image to a Main Control
LEAD1.setBitmap ( LEADScr1.getBitmap() );


CaptureMouseCursor Example for Visual J++

// capture current mouse cursor
LEADScr1.CaptureMouseCursor();

// copy the captured image to a Main Control
LEAD1.setBitmap ( LEADScr1.getBitmap() );


CaptureObjectOptionDlg Example for Visual J++

// display the capture selected object dialog
LEADScr1.CaptureObjectOptionDlg( getHandle() );


CaptureOptionDlg Example for Visual J++

// disable errors to check for cancel
LEADScr1.setEnableMethodErrors( false );

// display capture option dialog
short ret = LEADScr1.CaptureOptionDlg( getHandle() );
if( ret != 0 )
   if( ret != ltscr14n.__MIDL___MIDL_itf_ltscr_0136_0012.ERROR_USER_ABORT )
      MessageBox.show( "Error setting options!" );


CaptureSelectedObject Example for Visual J++

This is also the example for the CaptureObjectSelectCursorIndex, CaptureObjectInvert, CaptureObjectEnableKeyboard, CaptureObjectBorderWidth properties.

// set custom cursor
LEADScr1.setCaptureObjectSelectCursor( new Icon( "c:\\temp\\test.cur" ) );
LEADScr1.setCaptureObjectSelectCursorIndex( (short) 99 );

// disable invert colors
LEADScr1.setCaptureObjectInvert( false );

// disable keyboard
LEADScr1.setCaptureObjectEnableKeyboard( false );

// set object border width
LEADScr1.setCaptureObjectBorderWidth( (short) 3 );

// do the capture
LEADScr1.CaptureSelectedObject();

// copy the captured image to a Main Control
LEAD1.setBitmap ( LEADScr1.getBitmap() );

// reset options
LEADScr1.ResetObjectOptions();


CaptureWallPaper Example for Visual J++

// capture the wallpaper
LEADScr1.CaptureWallPaper();

// copy the captured image to a Main Control
LEAD1.setBitmap ( LEADScr1.getBitmap() );


CaptureWindowUnderCursor Example for Visual J++

// set 3 sec delay
LEADScr1.setCaptureDelay( 3000 );

// capture window under cursor
LEADScr1.CaptureWindowUnderCursor();

// copy the captured image to a Main Control
LEAD1.setBitmap ( LEADScr1.getBitmap() );


Bitmap property
Bitmap property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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. When assigning from the Main Bitmap property to this property, a reference to the source bitmap is created.  A copy is NOT made.  To remove the reference, assign a value of 0.  If you assign from this property to a Main Control, a copy of the image will be made in the target Main Control.

See Also

Elements:	CaptureActiveClient method, CaptureActiveWindow method, CaptureArea method, CaptureFullScreen method, CaptureMenuUnderCursor method, CaptureWindowUnderCursor method, CaptureWallPaper, CaptureSelectedObject method, CaptureMouseCursor method, CaptureEXE method, CaptureEXEDlg method


CaptureActiveClient method
CaptureActiveClient method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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:	You must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before you allow your 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


Return for CaptureActiveClient
Return Value

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


CaptureActiveWindow method
CaptureActiveWindow method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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:	You must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before you allow your 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


Return for CaptureActiveWindow
Return Value

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


CaptureArea method
CaptureArea method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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 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:	You must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before you allow your 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


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


Return for CaptureArea
Return Value

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


CaptureAreaBitmapWithRegion property
CaptureAreaBitmapWithRegion property (Screen control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	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 properties


CaptureAreaDrawCursor property
CaptureAreaDrawCursor property (Screen Control)

Visual Basic example	Other systems
Visual J++ example

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

Sets a custom cursor used when drawing during CaptureArea.

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

See Also

Elements:	CaptureAreaDrawCursorIndex property


CaptureAreaDrawCursorIndex property
CaptureAreaDrawCursorIndex property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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.

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


CaptureAreaDrawEllipseHeight property
CaptureAreaDrawEllipseHeight property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureAreaDrawEllipseWidth property
CaptureAreaDrawEllipseWidth property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureAreaDrawLineColor property
CaptureAreaDrawLineColor property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureAreaDrawLineStyle property
CaptureAreaDrawLineStyle property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	short 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


CaptureAreaEnableKeyboard property
CaptureAreaEnableKeyboard property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	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.


CaptureAreaFillBackColor property
CaptureAreaFillBackColor property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	OLE_COLOR CaptureAreaFillBackColor
Overview	Refer to Implementing Screen Capture.
Remarks

Gets or sets the background color for the CaptureAreaFillPattern.

See Also

Elements:	CaptureAreaFillForeColor property, CaptureAreaFillPattern property, CaptureArea method


CaptureAreaFillForeColor property
CaptureAreaFillForeColor property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	long CaptureAreaFillForeColor
Overview	Refer to Implementing Screen Capture.
Remarks

Gets or sets the foreground color for the CaptureAreaFillPattern.

See Also

Elements:	CaptureAreaFillBackColor property, CaptureAreaFillPattern property, CaptureArea method


CaptureAreaFillPattern property
CaptureAreaFillPattern property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	short 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


CaptureAreaIncludeCursor property
CaptureAreaIncludeCursor property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	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


CaptureAreaInfoHeight property
CaptureAreaInfoHeight property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureAreaInfoLeft property
CaptureAreaInfoLeft property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureAreaInfoTop property
CaptureAreaInfoTop property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureAreaInfoWidth property
CaptureAreaInfoWidth property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureAreaOptionDlg method
CaptureAreaOptionDlg method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	short CaptureAreaOptionDlg (long hWndParent);
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, and 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


hWndParent Parameter For CaptureAreaOptionDlg
hWndParent

Window handle or the dialog's parent.


Return for CaptureAreaOptionDlg
Return Value

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


CaptureAreaSensitiveInfoWindow property
CaptureAreaSensitiveInfoWindow property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	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


CaptureAreaShowAreaSize property
CaptureAreaShowAreaSize property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	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


CaptureAreaShowCursorPosition property
CaptureAreaShowCursorPosition property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	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


CaptureAreaShowDrawCursor property
CaptureAreaShowDrawCursor property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	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


CaptureAreaShowInfoWindow property
CaptureAreaShowInfoWindow property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	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


CaptureAreaShowOpaqueText property
CaptureAreaShowOpaqueText property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	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


CaptureAreaTextBackColor property
CaptureAreaTextBackColor property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	OLE_COLOR CaptureAreaTextBackColor
Overview	Refer to Implementing Screen Capture.
Remarks

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

See Also

Elements:	CaptureAreaShowAreaSize property, CaptureAreaShowCursorPosition property, CaptureAreaShowOpaqueText property, CaptureAreaTextForeColor property, CaptureArea method


CaptureAreaTextForeColor property
CaptureAreaTextForeColor property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	OLE_COLOR CaptureAreaTextForeColor
Overview	Refer to Implementing Screen Capture.
Remarks

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

See Also

Elements:	CaptureAreaShowAreaSize property, CaptureAreaShowCursorPosition property, CaptureAreaShowOpaqueText property, CaptureAreaTextBackColor property, CaptureArea method


CaptureAreaType property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	short CaptureAreaType
Overview	Refer to Implementing Screen Capture.
Remarks

(read only, not available at design-time) 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


CaptureAreaUseCrossLinesCursor property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	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 CaptureAreaUseCrossLinesCursor 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


CaptureAreaZoomFactor property
CaptureAreaZoomFactor property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureCancelKey property
CaptureCancelKey property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	short CaptureCancelKey
Overview	Refer to Implementing Screen Capture.
Remarks

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

You cannot set this to 'ALT' (VbKeyMenu).  If you do, it will be ignored, and set to 'ESC' (VbKeyEsc).

See Also

Elements:	StopCapture method, IsCaptureActive method, OptimizedHotkey property


CaptureCount property
CaptureCount property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureCursor property
CaptureCursor property (Screen Control)

Visual Basic example	Other systems
Visual J++ example

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


CaptureCursorIndex property
CaptureCursorIndex property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureDelay property
CaptureDelay property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureEXE method
CaptureEXE method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	short CaptureEXE (BSTR pszFileName, short iResType, BSTR pszResourceID, int bIsNumberResourceID, int bCaptureByIndexCaptureEXE);
Overview	Refer to Implementing Screen Capture.
Remarks

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

If you want to pass a string ID in pszResourceID, then set bIsNumberResourceID to FALSE and set bCaptureByIndex to FALSE.

If you want to pass a numeric ID in pszResourceID, then set bIsNumberResourceID to TRUE and set bCaptureByIndex to FALSE.

If you want to 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, Bitmap, CaptureImage event


pszFileName Parameter For CaptureEXE
pszFileName

Character string containing the file name from which to capture.


iResType Parameter For CaptureEXE
iResType

Type of resource to capture.  Possible values are:

Setting	Description
SCR_CAP_ALL	capture all types of resources
SCR_CAP_BITMAP	capture a bitmap resource
SCR_CAP_ICON	capture an icon resource
SCR_CAP_CURSOR	capture a cursor resource


pszResourceID Parameter For CaptureEXE
pszResourceID

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


bIsNumberResourceID Parameter For CaptureEXE
bIsNumberResourceID

Specifies whether the number is a resource ID


bCaptureByIndex Parameter For CaptureEXE
bCaptureByIndex

Specifies whether to capture by index.


Return for CaptureEXE
Return Value

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


CaptureEXEDlg method
CaptureEXEDlg method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	short CaptureEXEDlg (long hWndParent, BSTR pszFileName, short iResourceType, short iDialogType);
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, Bitmap, CaptureImage event


hWndParent Parameter For CaptureEXEDlg
hWndParent

Window handle or the dialog's parent.


pszFileName Parameter For CaptureEXEDlg
pszFileName

Character string containing the file name.


iResourceType Parameter For CaptureEXEDlg
iResourceType

Type of resource.  Possible values are:

Setting	Description
SCR_CAP_ALL	capture all types of resources
SCR_CAP_BITMAP	capture a bitmap resource
SCR_CAP_ICON	capture an icon resource
SCR_CAP_CURSOR	capture a cursor resource


iDialogType Parameter For CaptureEXEDlg
iDialogType

Type of dialog to display.  Possible values are:

Setting	Description
SCR_CAP_DLG_TREEVIEW	Display tree dialog
SCR_CAP_DLG_TABVIEW	Display tab view


Return for CaptureEXEDlg
Return Value

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


CaptureFullScreen method
CaptureFullScreen method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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:	You must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before you allow your 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, Bitmap, CaptureImage event


Return for CaptureFullScreen
Return Value

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


CaptureGetResourceCount method
CaptureGetResourceCount method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	short CaptureGetResourceCount (BSTR pszFileName, short iResType, short FAR * piCount);
Overview	Refer to Implementing Screen Capture.
Remarks

Updates a variable with the number of resources of the specified type in the specified file.

See Also

Elements:	CaptureEXE method, CaptureEXEDlg method, Bitmap, CaptureImage event


pszFileName Parameter For CaptureGetResourceCount
pszFileName

Character string containing the file name.


iResType Parameter For CaptureGetResourceCount
iResType

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


piCount Parameter For CaptureGetResourceCount
piCount

Pointer to a variable to be updated with the number of resources of type iResType in the file indicated by pszFileName.


Return for CaptureGetResourceCount
Return Value

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


CaptureHotKey property
CaptureHotKey property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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:	You must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before you allow your main window/application to terminate.
See Also

Elements:	CaptureHotKeyModifiers property, OptimizedHotkey property


CaptureHotKeyModifiers property
CaptureHotKeyModifiers property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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:	You must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before you allow your 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, OptimizedHotkey property


CaptureHotKeyPressed event
CaptureHotKeyPressed event (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example

Syntax	void CaptureHotKeyPressed (int nHotKeyType);
Overview	Refer to Implementing Screen Capture.
Remarks

Generated after the CaptureHotKey property is pressed.

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

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

See Also

Elements:	CaptureHotKey property, CaptureHotKeyModifiers property, OptimizedHotkey property


nHotKeyType Parameter For CaptureHotKeyPressed
nHotKeyType

Type of hot key.  Possible values are:

Setting	Description
SCR_HOTKEY_CAPTURE	[0x0000] Capture HotKey was pressed.


CaptureImage event
CaptureImage event (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	void CaptureImage (int nCurrentCaptureNo);
Overview	Refer to Implementing Screen Capture.
Remarks

Generated after each image is captured, using any of the capture methods.

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

You 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


nCurrentCaptureNo Parameter For CaptureImage
nCurrentCaptureNo

The current capture count.


CaptureInfoExeName property
CaptureInfoExeName property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureInfoHeight property
CaptureInfoHeight property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureInfohWnd property
CaptureInfohWnd property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureInfoLeft property
CaptureInfoLeft property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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.

See Also

Elements:	CaptureInfoHeight property, CaptureInfoTop property, CaptureInfoWidth property


CaptureInfoResIndex property
CaptureInfoResIndex property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureInfoResourceId property
CaptureInfoResourceId property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureInfoResType property
CaptureInfoResType property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	long 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


CaptureInfoTop property
CaptureInfoTop property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureInfoWidth property
CaptureInfoWidth property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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, CaptureInfoLeft property


CaptureInterval property
CaptureInterval property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureMenuUnderCursor method
CaptureMenuUnderCursor method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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:	You must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before you allow your 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, Bitmap, CaptureImage event


Return for CaptureMenuUnderCursor
Return Value

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


CaptureMouseCursor method
CaptureMouseCursor method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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:	You must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before you allow your 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, Bitmap, CaptureImage event


Return for CaptureMouseCursor
Return Value

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


CaptureObjectBorderWidth property
CaptureObjectBorderWidth property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureObjectEnableKeyboard property
CaptureObjectEnableKeyboard property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	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


CaptureObjectInvert property
CaptureObjectInvert property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	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


CaptureObjectOptionDlg method
CaptureObjectOptionDlg method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	short CaptureObjectOptionDlg (long hWndParent);
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, Bitmap, CaptureImage event


hWndParent Parameter For CaptureObjectOptionDlg
hWndParent

Window handle or the dialog's parent.


Return for CaptureObjectOptionDlg
Return Value

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


CaptureObjectSelectCursor property
CaptureObjectSelectCursor property (Screen Control)

Visual Basic example	Other systems
Visual J++ example

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


CaptureObjectSelectCursorIndex property
CaptureObjectSelectCursorIndex property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


CaptureOptionDlg method
CaptureOptionDlg method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	short CaptureOptionDlg (long hWndParent);
Overview	Refer to Implementing Screen CaptureProgScrCap.
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, and CaptureInterval.

Note:	You must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before you allow your 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, Bitmap, CaptureImage event


hWndParent Parameter For CaptureOptionDlg
hWndParent

Window handle or the dialog's parent.


Return for CaptureOptionDlg
Return Value

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


CaptureSelectedObject method
CaptureSelectedObject method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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:	You must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before you allow your 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, Bitmap, CaptureImage event


Return for CaptureSelectedObject
Return Value

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


CaptureStatusCursor property
CaptureStatusCursor property (Screen Control)

Visual Basic example	Other systems
Visual J++ example	Visual J++ example
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


CaptureStatusCursorIndex property
CaptureStatusCursorIndex property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	short CaptureStatusCursorIndex
Overview	Refer to Implementing Screen Capture.
Remarks

Gets or sets 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


CaptureWallPaper method
CaptureWallPaper method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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:	You must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before you allow your 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, Bitmap, CaptureImage event


Return for CaptureWallPaper
Return Value

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


CaptureWindowUnderCursor method
CaptureWindowUnderCursor method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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:	You must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before you allow your 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, Bitmap, CaptureImage event


Return for CaptureWindowUnderCursor
Return Value

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


EnableMethodErrors property
EnableMethodErrors property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	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.


IsCaptureActive method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example
Syntax	BOOL IsCaptureActive ();
Overview	Refer to Implementing Screen Capture.
Remarks

Indicates whether a capture operation has been started or not.

Note:	You must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before you allow your main window/application to terminate.
See Also

Elements:	CaptureHotKey property, CaptureHotKeyPressed event


Return for IsCaptureActive
Return Value

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


OptimizedHotkey property (Screen Control)

Visual Basic example	Visual C++ 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 method, CaptureEXE method, CaptureFullScreen method, CaptureMenuUnderCursor method, CaptureMouseCursor method, CaptureSelectedObject method, CaptureWallPaper method, CaptureWindowUnderCursor method
Topics:	Screen Capture: Properties


ResetAreaOptions method
ResetAreaOptions method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	short 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, and CaptureAreaZoomFactor.


Return for ResetAreaOptions
Return Value

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


ResetObjectOptions method
ResetObjectOptions method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ example
Syntax	short ResetObjectOptions ();
Overview	Refer to Implementing Screen Capture.
Remarks

Resets the object option properties to their defaults.  These properties are: CaptureObjectInvert, CaptureObjectEnableKeyboard, CaptureObjectBorderWidth, CaptureObjectSelectCursorIndex, and CaptureObjectSelectCursor.


Return for ResetObjectOptions
Return Value

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


ScaleMode property
ScaleMode property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example

Syntax	short ScaleMode
Overview	Refer to Implementing Screen Capture.
Remarks

Specifies the unit of measure for the Screen Control.

You 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 you set a property value in twips, the value that you get 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.


StopCapture method
StopCapture method (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example

Syntax	short StopCapture ();
Overview	Refer to Implementing Screen Capture.
Remarks

Stops the capture process.

Note:	You must call StopCapture if a capture operation has been started (for example, waiting for a hot key to be pressed) before you allow your main window/application to terminate.
See Also

Elements:	CaptureHotKey property, CaptureHotKeyPressed event, IsCaptureActive method


Return for StopCapture
Return Value

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


TransparentColor property
TransparentColor property (Screen Control)

Visual Basic example	Visual C++ 4.0 example
Delphi 2.0 Example	Visual J++ 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


Error Codes

For a list of all possible error codesfor LEADTOOLS Screen Capture OCX functions, refer to LEADTOOLS OCX Error Codes in the Main OCX help file (Ltocxn.hlp).


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 Screen Capture 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 from 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
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


Screen Capture Properties, methods, and events

Screen Capture properties

Screen Capture methods

Screen Capture events


Screen Capture methods

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

Getting and Setting Options

CaptureAreaOptionDlg method

CaptureGetResourceCount method

CaptureObjectOptionDlg method

CaptureOptionDlg method

ResetAreaOptions method

ResetObjectOptions method


Screen Capture Properties

Capture information properties:

CaptureInfoHeight property

CaptureInfohWnd property

CaptureInfoLeft property

CaptureInfoTop property

CaptureInfoWidth property

CaptureInfoResIndex property

CaptureInfoResourceId property

CaptureInfoResType property

CaptureInfoExeName property

Hot Key properties:

CaptureHotKey property

CaptureHotKeyModifiers property

OptimizedHotkey property

Capture Object properties:

CaptureObjectBorderWidth property

CaptureObjectEnableKeyboard property

CaptureObjectInvert property

CaptureObjectSelectCursor property

CaptureObjectSelectCursorIndex property

Multi-capture properties:

CaptureCount property

CaptureInterval property

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

Miscellaneous properties:

Bitmap property

CaptureCancelKey property

CaptureCursor property

CaptureCursorIndex property

CaptureDelay property

CaptureStatusCursor property

CaptureStatusCursorIndex property

EnableMethodErrors property

ScaleMode property

TransparentColor property


Screen Capture events

CaptureHotKeyPressed event

CaptureImage event