Introduction

The LEADTOOLS Screen Capture functions are available with the LEADTOOLS 32-bit API. The functions 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 products. The executable demos provide a quick and easy way to evaluate features and performance.

Summary of All Supported Image File Formats

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


Implementing Screen Capture

Capturing Screen Images

LEADTOOLS supports a number of functions for capturing images from the screen. You can capture the entire screen, or you can elect to capture some small part of the screen. L_CaptureFullScreen lets you capture the entire screen, while L_CaptureActiveWindow lets you capture all of the active window. To capture just the client portion of the active window, use L_CaptureActiveClient. L_CaptureWindowUnderCursor captures the window immediately under the cursor, and L_CaptureSelectedObject captures an image of the selected window's object.

In addition, you can capture wallpaper, menus and the mouse cursor, using L_CaptureWallPaper, L_CaptureMenuUnderCursor and L_CaptureMouseCursor. To capture an area, use L_CaptureArea. LEADTOOLS provides two functions for capturing bitmaps, cursors and icons from EXEs or DLLs, L_CaptureFromEXE and L_CaptureFromEXEDlg. L_CaptureEXEDlg provides a dialog box for entering capture options. Finally, to stop a capture operation, use L_StopCapture.

Getting and Setting Capture Information

In addition to the capture functions given above, there are a number of functions for getting and setting capture information, and two callbacks. These are as follows: L_CaptureAreaOptionDlg, L_GetCaptureOption, L_GetDefaultAreaOption, L_GetDefaultObjectOption, L_CaptureGetResCount, L_SetCaptureOption, L_SetCaptureOptionDlg, L_CaptureSetHotKeyCallback, L_IsCaptureActive, CAPTURECALLBACK, and CAPTUREHOTKEYCALLBACK.


Example Programs

The following example programs are in separate EXAMPLES subdirectories (such as C:\LEAD Technologies, Inc\LEADTOOLS\Examples\DLL\COLOR). The executable files for these examples were compiled with an Document/Medical edition 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.

Note:

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

SRCDEM32 | Screen Capture Demo is the main example program for screen capture. It uses pull-down menus to demonstrate most of the LEADTOOLS Screen Capture features in one application.
MFCMM | MFC Screen Capture Demo demonstrates the use of the LEADTOOLS API Screen Capture features with the Microsoft Foundation Class (MFC). This example includes a C++ wrapper for the LEADTOOLS API.


Version History

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

Changes from Version 14 to Version 14.5

Changes from Version 13 to Version 14

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 API has not changed from Version 14.


Changes from Version 13 to Version 14

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

LEADTOOLS Screen Capture API now supports UNICODE.

Changed Functions:

L_CaptureActiveClient (2 new/changed parameters)

L_CaptureActiveWindow (2 new/changed parameters)

L_CaptureArea (3 new/changed parameters)

L_CaptureFromEXE (1 new/changed parameter)

L_CaptureFromEXEDlg (2 new/changed parameters)

L_CaptureFullScreen (3 new/changed parameters)

L_CaptureMenuUnderCursor (2 new/changed parameters)

L_CaptureMouseCursor (2 new/changed parameters)

L_CaptureSelectedObject (3 new/changed parameters)

L_CaptureWallPaper (2 new/changed parameters)

L_CaptureWindowUnderCursor (2 new/changed parameters)

L_GetCaptureOption (1 new/changed parameter)

L_GetDefaultAreaOption (1 new/changed parameter)

L_GetDefaultObjectOption (1 new/changed parameter)

Changed Structures:

LEADCAPTUREOPTION (1 new/changed member)

LEADCAPTUREINFO (1 new/changed member)

LEADCAPTUREAREAOPTION (1 new/changed member)

LEADCAPTUREOBJECTOPTION (1 new/changed member)


Changes from Version 12.1 to Version 13

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


Changes from Version 12 to Version 12.1

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


Changes from Version 11.5 to Version 12

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


Changes from Version 11 to Version 11.5

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


Changes from Version 10 to Version 11

Version 11 of the LEADTOOLS Screen Capture API has changed from version 10 as follows:

Changed structures

The following members have been added to the BITMAPHANDLE structure:

L_UINT PaintGamma; /* Paint gamma value to be used during painting */

L_INT PaintContrast; /* Paint contrast value to be used during painting */

L_INT PaintIntensity; /* Paint intensity value to be used during painting */

L_UCHAR L_FAR*pPaintLUT; /* Paint LUT generated from PaintIntensity, PaintGamma, PaintIntensity */

L_UINT32 Reserved; /* reserved field, do not use */


Version 10

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

Screen Capture capabilities becomes the 15th imaging technology category found in LEADTOOLS. New capture functions 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.

New error messages

The following constants for error messages have been added:

New constant

ERROR_CAPTURE_STILL_IN_PROCESS | /* capture is still in progress */
ERROR_INVALID_DELAY | /* the user passed an invalid delay value */
ERROR_INVALID_COUNT | /* the user passed an invalid capture count */
ERROR_INVALID_INTERVAL | /* the user passed an invalid interval value */
ERROR_HOTKEY_CONFILCTS_WITH_CANCELKEY | /* the user specified the hotkey to be the same as the cancel key */
ERROR_CAPTURE_INVALID_AREA_TYPE | /* wrong area type passed to L_CaptureArea() */
ERROR_CAPTURE_NO_OPTION_STRUCTURE | /* invalid options structure pointer */
ERROR_CAPTURE_INVALID_FILL_PATTERN | /* invalid fill pattern */
ERROR_CAPTURE_INVALID_LINE_STYLE | /* invalid line style */
ERROR_CAPTURE_INVALID_INFOWND_POS | /* invalid position for the info window */
ERROR_CAPTURE_INVALID_INFOWND_SIZE | /* invalid size for the info window */
ERROR_CAPTURE_ZERO_AREA_SIZE | /* capture area is equal to zero */
ERROR_CAPTURE_FILE_ACCESS_FAILED | /* The specified filename couldn't be read */
ERROR_CAPTURE_INVALID_32BIT_EXE_OR_DLL | /* The specified filename is not a valid 32bit EXE/DLL */
ERROR_CAPTURE_INVALID_RESOURCE_TYPE | /* The specified resource type is not supported */
ERROR_CAPTURE_INVALID_RESOURCE_INDEX | /* The index resource is out of range */
ERROR_CAPTURE_NO_ACTIVE_WINDOW | /* no active window */
ERROR_CAPTURE_CANNOT_CAPTURE_WINDOW | /* cannot capture window */
ERROR_CAPTURE_STRING_ID_NOT_DEFINED | /* undefined string ID */
ERROR_CAPTURE_DELAY_LESS_THAN_ZERO | /* delay must be at least zero */
ERROR_CAPTURE_NO_MENU | /* no menu to capture */

The rest of this topic lists the new functions in version 10.

Screen Capture:

L_CaptureActiveClient

L_CaptureActiveWindow

L_CaptureArea

L_CaptureAreaOptionDlg

L_CaptureFromEXE

L_CaptureFromEXEDlg

L_CaptureFullScreen

L_CaptureGetResCount

L_CaptureMenuUnderCursor

L_CaptureMouseCursor

L_CaptureSelectedObject

L_CaptureSetHotKeyCallback

L_CaptureWallPaper

L_CaptureWindowUnderCursor

L_GetCaptureOption

L_GetDefaultAreaOption

L_GetDefaultObjectOption

L_IsCaptureActive

L_SetCaptureOption

L_SetCaptureOptionDlg

L_StopCapture

LEADCAPTUREOPTION

LEADCAPTUREINFO

LEADCAPTUREAREAOPTION

LEADCAPTUREOBJECTOPTION

CAPTURECALLBACK Function

CAPTUREHOTKEYCALLBACK Function


Copyright notice

Copyright Notices

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Trademarks

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

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

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

ScanAhead™ is a trademark of Pixel Translations, Inc.

FlashPix™ is a trademark of Eastman Kodak Company.

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

Address and Contact Information

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

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


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.

Note: You may not copy or redistribute any of the following files without obtaining the proper license. In some cases, the license is included with your initial purchase of LEADTOOLS. In other cases, you must obtain a license from a third party or enter into a royalty agreement with LEAD to obtain the proper license. For these special licensing situations, see the notes below accompanying the specific file.

Note: You may not distribute the header files with your application, and you may not provide software development capabilities in your application.

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 is required for ALL API applications. For more information on LTKRN and other files for the Main API, refer to Files To Be Included With Your Application .

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

Redistributables: | Explanation: | If you are using a standard release without Unicode, the files to use are: | If you are using a standard release with Unicode, the files to use are: | If you are using an evaluation release without Unicode, the files to use are: | If you are using an evaluation release with Unicode, the files to use are:
LTSCR | Screen Capture Support LTSCR14N.DLL is the LEADTOOLS Capture Support DLL. Also requires the LTFIL DLL and the LEAD file format DLLs. All other necessary files come with the 32-bit Windows Systems. | DLL: LTSCR14N.DLL Library: LTSCR_N.LIB | DLL: LTSCR14NU.DLL Library: LTSCR_NU.LIB | DLL: LTSCR14E.DLL Library: LTSCR_E.LIB | DLL: LTSCR14EU.DLL Library: LTSCR_EU.LIB


Installation Directory

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

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

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

BIN | Executable files for the demonstration programs.
HELP | Online help files.
EXAMPLES\DLL | One subdirectory for each example API program.
EXAMPLES\OCX | One subdirectory for each example ActiveX program.
EXAMPLES\CLASSLIB | One subdirectory for each example Class Library program.
EXAMPLES\RES | Resource files for the example programs.
INCLUDE | Header files, BAS files, and the ActiveX's MFC interface files for versions of Visual C++ earlier than 4.0.
LIB | Library files.
REDIST\OCR | Redistributable files. These are copies of the LEADTOOLS files and other files that you may need to distribute with your application. For exact information about required files, refer to Files To Be Included With Your Application.


Technical Support

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

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

You can also contact LEAD by mail at:

LEAD Technologies, Inc.
Attn: Technical Support
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.


API Function Groups

Screen Capture API Function Groups

Getting and Setting Information Functions

Getting Information Functions

Setting Information Functions

Capture Functions

Capture Functions

Support Functions

Callbacks

Version and License Information


Getting Information Functions

L_CaptureGetResCount

L_GetCaptureOption

L_GetDefaultAreaOption

L_GetDefaultObjectOption

L_IsCaptureActive


Setting Information Functions

L_CaptureSetHotKeyCallback

L_SetCaptureOption

L_SetCaptureOptionDlg


Capture Functions

L_CaptureActiveClient

L_CaptureActiveWindow

L_CaptureArea

L_CaptureAreaOptionDlg

L_CaptureFromEXE

L_CaptureFromEXEDlg

L_CaptureFullScreen

L_CaptureMenuUnderCursor

L_CaptureMouseCursor

L_CaptureSelectedObject

L_CaptureWallPaper

L_CaptureWindowUnderCursor

L_StopCapture


Support Functions: Callbacks

Support Functions:
Callbacks

L_SetStatusCallBack

STATUSCALLBACK

CAPTURECALLBACK Function

CAPTUREHOTKEYCALLBACK Function


Support Functions: Version and License Information

Support Functions:
Version and License Information

L_IsSupportLocked

L_UnlockSupport

L_VersionInfo


Data Types

Basic Data Types and Keywords

LEADTOOLS Basic Data Types

Keywords Used in Declarations

Screen Capture Structures

LEADCAPTUREOPTION

LEADCAPTUREINFO

LEADCAPTUREAREAOPTION

LEADCAPTUREOBJECTOPTION

Image and Toolkit Information Structures

BITMAPHANDLE

Structures Used with Input and Output Functions

WINDOWS Structures

List and Animation Data Types

HBITMAPLIST


LEADTOOLS Basic Data Types

LEADTOOLS has defined the following basic data types for portability:

Data Type | Definition and Usage
L_BITFIELD | Defined as L_UINT; used as a bit field.
L_BOOL | Defined as L_UINT; used as a boolean value.
L_CHAR | Defined as char; used as a signed 8-bit integer.
L_DOUBLE | Defined as double; used as a double precision floating point number.
L_FLOAT | Defined as float; used as a floating point number.
L_INT | Defined as int; used as a signed integer, 16-bits or larger.
L_INT16 | Defined as short; used as a signed 16-bit integer.
L_INT32 | Defined as long; used as a signed 32-bit integer.
L_UCHAR | Defined as unsigned char; used as an unsigned 8-bit integer.
L_UINT | Defined as unsigned; used as an unsigned integer, 16-bits or larger.
L_UINT16 | Defined as unsigned short; used as an unsigned 16-bit integer.
L_UINT32 | Defined as unsigned long; used as an unsigned 32-bit integer.
L_VOID | Defined as void; used as a void.
L_COMP | Defined as L_UINT; used as a handle to a computer
L_MEDIA | Defined as L_VOID L_FAR *; used as a void pointer
L_TCHAR | Defined as either char or TCHAR. If FOR_UNICODE is defined, then L_TCHAR will be defined as TCHAR.


Keywords Used in Declarations

LEADTOOLS uses the following keywords in declarations of functions, structures, and datatypes:

Keyword | Definition and Usage
L_FAR | Defined as nothing; used as a placeholder.
L_HUGE | Defined as nothing; used as a placeholder.
L_EXPORT | Defined as nothing; used as a placeholder.
L_PASCAL | Defined as nothing; used as a placeholder.
EXT_FUNCTION | Defined as WINAPI; used as an attribute for all toolkit functions.
pEXT_FUNCTION | Defined as EXT_FUNCTION L_FAR *; used as an attribute when defining pointers to toolkit functions.
EXT_CALLBACK | Defined as _cdecl L_FAR; used as an attribute for all toolkit callback functions.
pEXT_CALLBACK | Defined as EXT_CALLBACK L_FAR *; used as an attribute when defining pointers to toolkit callback functions.


BITMAPHANDLE

The BITMAPHANDLE structure serves as a working area for image manipulation and conversion. LEADTOOLS functions use this structure as a bitmap handle for accessing the image in memory and for maintaining the characteristics of the image.

Note:

Fields intended for internal use, such as the pointer to the bitmap, are omitted from the table. If necessary, you can refer to the LTKRN.H header file which describes the entire structure.

Member | Data Type | Description
Width | L_INT | Image width in pixels.
Height | L_INT | Image height in pixels.
BitsPerPixel | L_INT | Number of bits per pixel.
BytesPerLine | L_UINT | Bytes per line, rounded upward to the nearest multiple of four.
Flags.Allocated | L_BITFIELD | TRUE if the bitmap is allocated.
Flags.ConventionalMemory | L_BITFIELD | TRUE if the bitmap is allocated using conventional memory.
Flags.DiskMemory | L_BITFIELD | TRUE if the bitmap is allocated using LEAD's own virtual memory.
Flags.LockedMemory | L_BITFIELD | TRUE if the bitmap memory is locked down.
Flags.Progressive | L_BITFIELD | TRUE if an image is being loaded from a progressive JPEG file.
Flags.WaitUserInput | L_BITFIELD | TRUE if the animation playback waits for user input.
Flags.Transparency | L_BITFIELD | TRUE if the animation playback uses transparency.
Flags.Compressed | L_BITFIELD | TRUE if the current bitmap is in 1-bit RLE-compressed format. For information about this format, refer to Speeding Up 1-Bit Documents .
Flags.Signed | L_BITFIELD | TRUE if the pixel values in the bitmap are signed.
nColors | L_INT | Number of colors (256 or less) that the bitmap has. If the image has more than 256 colors, this value is zero.
hPalette | HPALETTE | Handle to the image's palette. It can be an optimized palette or a fixed palette.
ViewPerspective | L_CHAR | Where the beginning of the image is stored. Valid values are TOP_LEFT, BOTTOM_LEFT, TOP_RIGHT, BOTTOM_RIGHT, TOP_LEFT90, and TOP_LEFT270. For descriptions, refer to Accounting for View Perspective .
Order | L_INT | Color order of the bitmap. Possible values are ORDER_RGB, ORDER_BGR and ORDER_GRAY.
Size | L_UINT32 | Size of the bitmap image data, in bytes.
LoadRow | L_INT | The number of the current row during a load, when an image is being loaded from a progressive JPEG file.
DitheringMethod | L_UINT | Dithering method (referenced by some functions). For possible values, refer to the L_DefaultDithering function.
XResolution | L_INT | Horizontal resolution, in dots per inch. Some file formats save this value in the file header.
YResolution | L_INT | Vertical resolution, in dots per inch. Some file formats save this value in the file header.
Left | L_INT | Left offset for animation playback.
Top | L_INT | Top offset for animation playback, based on a TOP_LEFT view perspective.
Delay | L_UINT32 | Animation playback delay in milliseconds (ms).
Background | COLORREF | Background color for animation playback. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
Transparency | COLORREF | Transparent color for animation playback. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
DisposalMethod | L_UINT | Animation playback disposal method. For possible values, refer to Animation Disposal Methods .
LowBit | L_INT | Value indicating the low bit used for window leveling. 0 <= nLowBit <= nHighBit <= (11 for 12-bit grayscale or 15 for 16-bit grayscale). A value of -1 will be treated as 0.
HighBit | L_INT | Value indicating the high bit used for window leveling. 0 <= nLowBit <= nHighBit <= (11 for 12-bit grayscale or 15 for 16-bit grayscale). A value of -1 will be treated as BitsPerPixel -1.
MinVal | L_INT32 | Minimum grayscale value. For every value between 0 and MinVal, Black (RGB(0,0,0)) will be used. For values between MinVal and MaxVal, the gray value to be displayed is calculated by : gray = (index - MinVal) * 255 / (MaxVal - MinVal).(See * below)
MaxVal | L_UINT | Maximum grayscale value. For every value larger than MaxVal, White (RGB(255,255,255)) will be used. For values between MinVal and MaxVal, the gray value to be displayed is calculated by : gray = (index - MinVal) * 255 / (MaxVal - MinVal). (See * below)

* index is the intensity value of the pixel. If the intensity value is > MaxVal, the color will be White. If the intensity value is < MinVal, the color will be Black. For those intensity values between MinVal and MaxVal, the above equation is used to determine the color, with index equal to the intensity value.

Comments

pBITMAPHANDLE is a pointer to a BITMAPHANDLE structure. Generally, where a function parameter type is pBITMAPHANDLE, you can declare a BITMAPHANDLE variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pBITMAPHANDLE variable is necessary only if your program requires a pointer.

In most cases, the values of fields in the BITMAPHANDLE structure are maintained by LEADTOOLS functions.


HBITMAPLIST

LEADTOOLS has defined the following data types for referencing a list of bitmaps:

Data Type | Definition and Usage
HBITMAPLIST | Defined as HANDLE; used as a handle to a list of bitmaps.
pHBITMAPLIST | Defined as HBITMAPLIST L_FAR *; used as a pointer to an HBITMAPLIST variable.


LEADCAPTUREAREAOPTION

typedef struct tagLEADCAPTUREAREAOPTION
{
L_UINT uStructSize;
L_UINT uAreaType;
L_INT nFillPattern;
COLORREF crFillForeColor
COLORREF crFillBackColor
L_UINT uDrawLineStyle;
COLORREF crDrawLineColor
L_UINT uEllipseWidth;
L_UINT uEllipseHeight;
L_UINT uFlags;
HCURSOR hDrawCursor;
COLORREF crTextForeColor;
COLORREF crTextBackColor;
L_INT nInfoLeft;
L_INT nInfoTop;
L_INT nInfoWidth;
L_INT nInfoHeight;
} LEADCAPTUREAREAOPTION, L_FAR * LPLEADCAPTUREAREAOPTION;

This structure is used to define the options of the L_CaptureArea function.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
uAreaType | Type of area to capture. Possible values are:
 | CAPTURE_AREA_TRIANGLE | [0x1] Triangle
 | CAPTURE_AREA_RECT | [0x2] Rectangle
 | CAPTURE_AREA_ROUNDRECT | [0x3] Rounded Rectangle
 | CAPTURE_AREA_ELLIPSE | [0x4] Ellipse
 | CAPTURE_AREA_POLYGON | [0x5] Polygon (each click defines point)
 | CAPTURE_AREA_FREEHAND | [0x6] Freehand (click and drag)

nFillPattern | Fill pattern for the bitmap. Possible values are:
 | CAPTURE_AREA_PATTERN_HORIZONTAL | HS_HORIZONTAL /* ----- */
 | CAPTURE_AREA_PATTERN_VERTICAL | HS_VERTICAL /* ||||| */
 | CAPTURE_AREA_PATTERN_FDIAGONAL | HS_FDIAGONAL /* \\\\\ */
 | CAPTURE_AREA_PATTERN_BDIAGONAL | HS_BDIAGONAL /* ///// */
 | CAPTURE_AREA_PATTERN_CROSS | HS_CROSS /* +++++ */
 | CAPTURE_AREA_PATTERN_DIAGCROSS | HS_DIAGCROSS /* xxxxx */
 | CAPTURE_AREA_PATTERN_SOLID | HS_DIAGCROSS+1 /*Solid Fill*/

crFillForeColor | Foreground color.
crFillBackColor | Background color.
uDrawLineStyle | Draw line style. Possible values are:
 | CAPTURE_AREA_LINE_SOLID | PS_SOLID /*________*/
 | CAPTURE_AREA_LINE_DASH | PS_DASH /*----------*/
 | CAPTURE_AREA_LINE_DOT | PS_DOT /*..........*/
 | CAPTURE_AREA_LINE_DASHDOT | PS_DASHDOT /*-.-.-.-.-.*/
 | CAPTURE_AREA_LINE_DASHDOTDOT | PS_DASHDOTDOT /*-..-..-*/
crDrawLineColor | Line color for drawing.
uEllipseWidth | Width of the ellipse used when drawing a rounded rectangle.
uEllipseHeight | Height of the ellipse used when drawing a rounded rectangle.
uFlags | Flags for options. Possible values are:

 | CAPTURE_AREA_SHOW_DRAWCURSOR | [0x0001] Show cursor during drawing.
 | CAPTURE_AREA_INCLUDE_CURSOR | [0x0002] Include cursor in captured image (this is the hCursor from LEADCAPTUREOPTION).
 | CAPTURE_AREA_ENABLE_KEYBOARD | [0x0004] Allow Ctrl, Shift,+,- keys during capture.
 |  | (+/-) Are used for 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.).
 | CAPTURE_AREA_SHOW_OPAQUE_TEXT | [0x0008] Text for cursor position and capture size should have an opaque back color. (Used only for the above CAPTURE_AREA_SHOW_CURSORPOS and CAPTURE_AREA_SHOW_CAPTURESIZE. The info window has opaque text).
 | CAPTURE_AREA_SHOW_CURSORPOS | [0x0010] Show cursor position during drawing right next to the cursor
 | CAPTURE_AREA_SHOW_CAPTURESIZE | [0x0020] Show the width and height of the capture.
 | CAPTURE_AREA_SHOW_INFOWINDOW | [0x0040] Display the info window, the current cursor location, the coordinates of the cursor, and the width and height of the area.
 | CAPTURE_AREA_SENSITIVE_INFOWINDOW | [0x0080] Enable Sensitive detection for the Info window position.
 | CAPTURE_AREA_BITMAP_WITH_REGION | [0x0100] Captured bitmap will contain a region selected by user. This region will be the shape indicated in Area.
 | CAPTURE_AREA_USE_DEFAULT_VALUES | [0x0200] Use default capture area options, all the other flags will be ignored if this flag is set.
 |  | When this flag is set, uAreaType and uSize must be set.
 | CAPTURE_AREA_ZOOM_NORM | [0x1000] The image is not zoomed.
 | CAPTURE_AREA_ZOOM_BY2X | [0x2000] the image is zoomed 2X.
 | CAPTURE_AREA_ZOOM_BY3X | [0x3000] the image is zoomed 3X.
 | CAPTURE_AREA_ZOOM_BY4X | [0x4000] the image is zoomed 4X.
 | CAPTURE_AREA_ZOOM_BY5X | [0x5000] the image is zoomed 5X.
 | CAPTURE_AREA_ZOOM_BY6X | [0x6000] the image is zoomed 6X.
 | CAPTURE_AREA_ZOOM_BY7X | [0x7000] the images is zoomed 7X.
 | CAPTURE_AREA_ZOOM_BY8X | [0x8000] the image is zoomed 8X.
 | CAPTURE_AREA_ZOOM_BY9X | [0x9000] the image is zoomed 9X.
 | CAPTURE_AREA_ZOOM_BY10X | [0xA000] the image is zoomed 10X.
 | CAPTURE_AREA_ZOOM_BY11X | [0xB000] the image is zoomed 11X.
 | CAPTURE_AREA_ZOOM_BY12X | [0xC000] the image is zoomed 12X.
 | CAPTURE_AREA_ZOOM_BY13X | [0xD000] the image is zoomed 13X.
 | CAPTURE_AREA_ZOOM_BY14X | [0xE000] the image is zoomed 14X.
 | CAPTURE_AREA_ZOOM_BY15X | [0xF000] the image is zoomed 15X.
 | CAPTURE_AREA_ZOOM_MASK | [0xF000] the image is zoomed by the mask.
hDrawCursor | Cursor for drawing area.
crTextForeColor | Foreground color of info text.
crTextbackColor | Background color of info text.
nInfoLeft | Left coordinate of the info window. Possible values are listed below. In addition, any other positive value specified by the user to define left position for the Info Window may be used.
 | CAPTURE_AREA_INFOWND_POS_LEFT | -1
 | CAPTURE_AREA_INFOWND_POS_RIGHT | -2
nInfoTop | Top coordinate of the info window. Possible values are listed below. In addition, any other positive value specified by the user to define the top position for the Info Window may be used.
 | CAPTURE_AREA_INFOWND_POS_TOP | -3
 | CAPTURE_AREA_INFOWND_POS_BOTTOM | -4
nInfoWidth | Width of the info window. Possible values are listed below. In addition, any other positive value specified by the user to define custom width and height for the info window may be used.
 | CAPTURE_AREA_INFOWND_SIZE_TINY | -1
 | CAPTURE_AREA_INFOWND_SIZE_SMALL | -2
 | CAPTURE_AREA_INFOWND_SIZE_MEDIUM | -3
 | CAPTURE_AREA_INFOWND_SIZE_LARGE | -4
 | CAPTURE_AREA_INFOWND_SIZE_XLARGE | -5
nInfoHeight | Height of the info window. Possible values are the same as for nInfoWidth. Both nInfoWidth and nInfoHeight must be positive values or values from the table in nInfoWidth.

Comments

The area of the bitmap outside the user-defined region will be filled with the pattern defined by nFillPattern, crFillForeColor, and crFillBackColor.

The zoom factor can be obtained from the flags as follows:

zoom_factor = ((uFlags & CAPTURE_AREA_ZOOM_MASK) >> 12)

The flag can be obtained from the zoom factor as follows

Flag = (zoom_factor)<< 12

nInfoWidth, nInfoTop, nInfoWidth and nInfoHeight are ignored if CAPTURE_AREA_SHOW_INFOWINDOW is not set.

CAPTURE_AREA_SHOW_INFOWINDOW and CAPTURE_AREA_SHOW_CAPTURESIZE are not mutually exclusive. If both flags are set, you will have both an info window and the size of the captured area. Likewise, if CAPTURE_AREA_SHOW_INFOWINDOW and CAPTURE_AREA_SHOW_CURSORPOS are set, you will have both an info window and the position of the cursor.

After the initial placement of the info window, the window will be moved to another corner of the screen whenever the mouse cursor becomes near the info window. This way, the user will not be disturbed during the selection of the area he wants, and he will be able to see a zoomed image for the current cursor position. The info window will look like this:


LEADCAPTUREINFO

typedef struct tagLEADCAPTUREINFO
{
L_UINT uStructSize;
HWND hWnd;
RECT rcArea;
L_INT nResType;
L_INT nIndex;
LPTSTR pszResID;
L_TCHAR szReserved[256];
LPTSTR pszExeName;
L_INT nMaxExeName;
} LEADCAPTUREINFO, L_FAR * pLEADCAPTUREINFO;

This structure is used by the capture functions to return information about the capture that took place.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
hWnd | Handle to window being captured. This will be filled by all of the capture functions, with the handle to the window that was captured.
rcArea | Area being captured. This will be filled by all of the capture functions, with the bounding rectangle of the area that was captured. The coordinates should be relative to the full screen, left, top being 0,0.
nResType | Resource type. In the case of an EXE capture, this will be filled with the type of resource that was captured. Possible values are:
 | RESTYPE_BITMAP | Capture a bitmap resource
 | RESTYPE_ICON | Capture an icon resource
 | RESTYPE_CURSOR | Capture a cursor resource
nIndex | Index of the resource that was captured. In the case of an EXE capture, this will be filled with the index of the resource that was captured. In this toolkit, resource indices will begin at 0.
pszResID | Character string containing the resource ID.
szReserved | Reserved.
pszExeName | Character string to be filled with the name of the EXE from which L_CaptureFromEXEDlg captured a resource.
nMaxExeName | Maximum length of the pszExeName buffer.


LEADCAPTUREOBJECTOPTION

typedef struct tagLEADCAPTUREOBJECTOPTION
{
L_UINT uStructSize;
L_UINT uFlags;
L_UINT uBorderWidth;
HCURSOR hSelectCursor;
} LEADCAPTUREOBJECTOPTION, L_FAR * pLEADCAPTUREOBJECTOPTION;

This structure is used in L_CaptureSelectedObject.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
uFlags | Flags that control the selection process. Possible values are:
 | CAPTURE_OBJECT_INVERT | Invert the selected object. If this flag is not specified, a border will be drawn around the object.
 | CAPTURE_OBJECT_ENABLE_KEYBOARD | Enable the SHIFT key during the selection process. Pressing the SHIFT key will select the client area of the object
uBorderWidth | Border width when highlighting object.
hSelectedCursor | Cursor to be used during selecting.


LEADCAPTUREOPTION

typedef struct tagLEADCAPTUREOPTION
{
L_UINT uStructSize;
HCURSOR hCursor;
HCURSOR hStatusCursor;
L_INT nHotKey;
L_UINT uHotKeyModifiers;
L_INT nCancelKey;
L_INT nDelay;
L_UINT uCount;
L_INT nInterval;
L_UINT32 uFlags;
} LEADCAPTUREOPTION, L_FAR * pLEADCAPTUREOPTION;

This structure is used in L_SetCaptureOptions and L_GetCaptureOption to set/get the capture options.

Member | Description
uStructSize | Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.
hCursor | Cursor to place on image after capture. Default is NULL.
hStatusCursor | Cursor to display as status between multiple captures. Default is NULL.
nHotKey | Key code for activation key. Default is F11.
uHotKeyModifiers | Modifier keys used with nHotKey. Default is 0. Possible values are listed below and may be combined:
 | MOD_ALT | Alt Key pressed.
 | MOD_CONTROL | Control key pressed.
 | MOD_SHIFT | Shift key pressed.
 | 0 | No modifier key was pressed.
nCancelKey | Key code for capture operation cancel key. Default is ESC. You cannot set this to the 'ALT' key (VK-MENU). If you do, it will be ignored internally and set to 'ESC' (VK-ESCAPE).
nDelay | Milliseconds delay before capture. Default is 0
uCount | Number of times to capture. 0 or 1 means one capture, 2 means 2 captures, etc. Default is 1.
nInterval | Milliseconds delay between captures. Default is 0.
uFlags | Flag that indicates whether to optimize hotkey processing. Possible values are:
 | Value | Meaning
 | 0 | [0x0000] Perform normal hot key processing.
 | CAPTURE_OPTIMIZED_HOTKEY | [0x0001] Use a global system hook for hotkey processing.

Comments

Normally, when a capture function is called, the function enters a loop, and waits for the hot key specified in nHotKey to be pressed, before capturing. This loop can cause the CPU usage indicator to appear maxed out. Specifying CAPTURE_OPTIMIZED_HOTKEY in uFlags will cause the capture function to return immediately, if a hotkey has been specified in nHotKey. 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 callback passed to the capture function is called with the result of the capture. Use this option only if the normal behavior is causing your application problems. This option is ignored in Win95/98/Me.


WINDOWS Structures

BITMAPINFO

This is a Microsoft Windows structure as documented in the Microsoft SDK documentation. For complete documentation on this structure please refer to the Microsoft SDK documentation for BITMAPINFO.

COLORREF

COLORREF is a Windows data type. For further information concerning COLORREF, please refer to the Microsoft SDK documentation.

DWORD

DWORD is a Windows data type, 32 bit unsigned int. For further information concerning DWORD, please refer to the Microsoft SDK documentation.

HANDLE

Handle is a standard Windows structure. For further information concerning HANDLE, please refer to the Microsoft SDK documentation or your compiler's documentation.

HDC

HDC is a standard Windows structure. For further information concerning HDC, please refer to the Microsoft SDK documentation or your compiler's documentation.

HGLOBAL

HGLOBAL is a standard Windows data type. For further information concerning HGLOBAL, please refer to the Microsoft SDK documentation or your compiler's documentation.

HWND

HWND is a standard Windows data type. For further information concerning HWND, please refer to the Microsoft SDK documentation or your compiler's documentation.

LPBYTE

LPBYTE is a standard Windows data type. For further information concerning LPBYTE, please refer to the Microsoft SDK documentation or your compiler's documentation.

LPRECT

LPRECT is a standard Windows structure. For further information concerning LPRECT, please refer to the Microsoft SDK documentation or your compiler's documentation.

LPSTR

LPSTR is a standard Windows data type. For further information concerning LPSTR, please refer to the Microsoft SDK documentation or your compiler's documentation.

OPENFILENAME

This is a Microsoft Windows structure as documented in the Microsoft SDK documentation. For complete documentation on this structure please refer to the Microsoft SDK documentation for OPENFILENAME.


Return Codes

For a list of all possible return codes for LEADTOOLS Screen Capture API functions, refer to LEADTOOLS API Return Codes in the Main API help file.


L_CaptureActiveClient

#include "l_bitmap.h"

L_INT L_CaptureActiveClient(pBitmap, uBitmapStructSize, pCaptureInfo, uInfoStructSize, pfnCaptureCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uBitmapStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
pLEADCAPTUREINFO pCaptureInfo; | /* pointer to info structure */
L_UINT uInfoStructSize; | /* size in bytes, of the structure pointed to by pCaptureInfo */
CAPTURECALLBACK pfnCaptureCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Captures an image of the selected window's client area.

Parameter | Description
pBitmap | Pointer to a bitmap handle that references the captured data.
uBitmapStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
pCaptureInfo | Address of LEADCAPTUREINFO structure to be filled with information regarding the captured image's source. Pass NULL if you are not interested in extra information about the capture.
uInfoStructSize | Size in bytes, of the structure pointed to by pCaptureInfo, for versioning. Use sizeof(LEADCAPTUREINFO).
pfnCaptureCallback | Optional callback function for additional processing. If you do not provide a callback function, use NULL as the value of this parameter. If you do provide a callback function, use the function pointer as the value of this parameter. The callback function must adhere to the function prototype described in CAPTURECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function captures the currently active window's client area into a bitmap. The callback can be used to do multiple captures, depending on the options set using L_SetCaptureOption.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_SetCaptureOption, L_SetCaptureOptionDlg, CAPTURECALLBACK, L_StopCapture

Example

int MyMain()
{
BITMAPHANDLE Bitmap;
LEADCAPTUREINFO CaptureInfo;

/*To call the L_CaptureActiveClient*/
L_CaptureActiveClient (
&Bitmap, sizeof(BITMAPHANDLE),
&CaptureInfo, sizeof(LEADCAPTUREINFO),
pfnCaptureCallback,
NULL
);
L_FreeBitmap (&Bitmap);

return 0;
}

L_INT L_EXPORT pfnCaptureCallback (pBITMAPHANDLE pBitmap, pLEADCAPTUREINFO pCaptureInfo, L_VOID L_FAR* pUserData)
{
/* save the captured image */
return(L_SaveBitmap (TEXT("d:\\temp\\test.bmp"), pBitmap, FILE_BMP, 0, 0, NULL));
}


L_CaptureActiveWindow

#include "l_bitmap.h"

L_INT L_CaptureActiveWindow(pBitmap, uBitmapStructSize, pCaptureInfo, uInfoStructSize, pfnCaptureCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uBitmapStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
pLEADCAPTUREINFO pCaptureInfo; | /* pointer to info structure */
L_UINT uInfoStructSize; | /* size in bytes, of the structure pointed to by pCaptureInfo */
CAPTURECALLBACK pfnCaptureCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Captures an image of the currently active window.

Parameter | Description
pBitmap | Pointer to a bitmap handle that references the captured data.
uBitmapStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
pCaptureInfo | Address of the LEADCAPTUREINFO structure to be filled with information regarding the captured image's source. Pass NULL if you are not interested in extra information about the capture.
uInfoStructSize | Size in bytes, of the structure pointed to by pCaptureInfo, for versioning. Use sizeof(LEADCAPTURE).
pfnCaptureCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in CAPTURECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function performs a screen capture of the currently active window. The callback can be used to do multiple captures, depending on the options set using L_SetCaptureOption.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_SetCaptureOption, L_SetCaptureOptionDlg, CAPTURECALLBACK, L_StopCapture

Example

int MyMain()
{
BITMAPHANDLE Bitmap;
LEADCAPTUREINFO CaptureInfo;

/*To call the L_CaptureActiveWindow*/
L_CaptureActiveWindow (
&Bitmap, sizeof(BITMAPHANDLE),
&CaptureInfo, sizeof(LEADCAPTUREINFO),
pfnCaptureCallback,
NULL
);
L_FreeBitmap (&Bitmap);

return 0;
}

L_INT L_EXPORT pfnCaptureCallback (pBITMAPHANDLE pBitmap, pLEADCAPTUREINFO pCaptureInfo, L_VOID L_FAR* pUserData)
{
/* save the captured image */
return(L_SaveBitmap (TEXT("d:\\temp\\test.bmp"), pBitmap, FILE_BMP, 0, 0, NULL));
}


L_CaptureArea

#include "l_bitmap.h"

L_INT L_CaptureArea(pBitmap, uBitmapStructSize, pCaptureAreaOption, uOptionsStructSize, pCaptureInfo, uInfoStructSize, pfnCaptureCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uBitmapStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
pLEADCAPTUREAREAOPTION pCaptureAreaOption; | /* pointer to an area option structure */
L_UINT uOptionsStructSize; | /* size in bytes, of the structure pointed to by pCaptureAreaOption */
pLEADCAPTUREINFO pCaptureInfo; | /* pointer to an info option structure */
L_UINT uInfoStructSize; | /* size in bytes, of the structure pointed to by pCaptureInfo */
CAPTURECALLBACK pfnCaptureCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Captures an image of the user selected area.

Parameter | Description
pBitmap | Pointer to a bitmap handle that references the captured data.
uBitmapStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
pCaptureAreaOption | Address of a LEADCAPTUREAREAOPTION structure that contains information on what type of area to capture.
uOptionsStructSize | Size in bytes, of the structure pointed to by pCaptureAreaOption, for versioning. Use sizeof(LEADCAPTUREAREAOPTION).
pCaptureInfo | Address of a LEADCAPTUREINFO structure to be filled with information regarding the captured image's source. Pass NULL if you are not interested in more information about the capture.
uInfoStructSize | Size in bytes, of the structure pointed to by pCaptureInfo, for versioning. Use sizeof(LEADCAPTUREINFO).
pfnCaptureCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in CAPTURECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function allows the user to select an area from the entire screen of the specified type, and then captures that area to a bitmap. The resulting bitmap will contain a region of the specified type, and all image data outside that region will be filled with the specified color in the options structure. The callback can be used to do multiple captures, depending on the options set using L_SetCaptureOption.

If the area is CAPTURE_AREA_POLYGON, a double-click will end the area definition. A right mouse click will delete the last point that was drawn.

If the area is any type other than CAPTURE_AREA_POLYGON, the area definition will be ended and the image captured when the left mouse button is released.

If ALT key is depressed while selecting the area, it will cancel the current capture area selection, but not stop the capture (in other words, the user will be able to start a new capture area draw).

If the cancel or ESC key, defined in LEADCAPTUREOPTION, is pressed during capture area, the entire operation is canceled, and the function will return ERROR_USER_ABORT.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_SetCaptureOption, L_SetCaptureOptionDlg, CAPTURECALLBACK, L_CaptureAreaOptionDlg, L_StopCapture

Example

int MyMain()
{
BITMAPHANDLE Bitmap;
LEADCAPTUREAREAOPTION CaptureAreaOption;
LEADCAPTUREINFO CaptureInfo;

/*To call the L_CaptureArea, L_GetDefaultAreaOption*/
/* This function gets the default area options.*/
L_GetDefaultAreaOption(&CaptureAreaOption, sizeof(LEADCAPTUREAREAOPTION));
/* set the Object Options CaptureType to Free hand.*/
CaptureAreaOption.uAreaType = CAPTURE_AREA_FREEHAND;
L_CaptureArea (&Bitmap, sizeof(BITMAPHANDLE), &CaptureAreaOption, sizeof(LEADCAPTUREAREAOPTION), &CaptureInfo, sizeof(LEADCAPTUREINFO), pfnCaptureCallback, NULL);
L_FreeBitmap (&Bitmap);

return 0;
}

L_INT L_EXPORT pfnCaptureCallback (pBITMAPHANDLE pBitmap, pLEADCAPTUREINFO pCaptureInfo, L_VOID L_FAR* pUserData)
{
/* save the captured image */
return(L_SaveBitmap (TEXT("d:\\temp\\test.bmp"), pBitmap, FILE_BMP, 0, 0, NULL));
}


L_CaptureAreaOptionDlg

#include "l_bitmap.h"

L_INT L_CaptureAreaOptionDlg(hParentWnd, pCaptureAreaOption, nUseDefault)

HWND hParentWnd; | /* handle to parent window */
pLEADCAPTUREAREAOPTION pCaptureAreaOption; | /* pointer to a capture area options structure */
L_INT nUseDefault; | /* flag */

Displays a dialog to retrieve the options for the L_CaptureArea function.

Parameter | Description
hParentWnd | Handle to the parent window.
pCaptureAreaOption | Pointer to a LEADCAPTUREAREAOPTION structure that contains information about capturing an area.
nUseDefault | If TRUE, the dialog will start with default values. Otherwise the dialog will use the values specified by the pLEADCAPTUREAREAOPTION structure. These values must be a valid values or the dialog will return an error code.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will display the common dialog for setting the options for the L_CaptureArea function. The options selected by the user will be copied to pCaptureAreaOption.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_CaptureArea, L_GetDefaultAreaOption

Example

int MyMain()
{
BITMAPHANDLE Bitmap;
LEADCAPTUREAREAOPTION CaptureAreaOption;
HWND hwnd;
int nRet;

/* To call the L_CaptureAreaOptionDlg */
hwnd = GetForegroundWindow();
/* use the defaults*/
L_CaptureAreaOptionDlg (hwnd, &CaptureAreaOption, TRUE);
L_FreeBitmap (&Bitmap);

return 0;
}


L_CaptureFromEXE

#include "l_bitmap.h"

L_INT L_CaptureFromEXE(pBitmap, uStructSize, pszFileName, nResType, pResID, bCaptureByIndex, clrBackGnd, pfnCaptureCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
L_TCHAR L_FAR * pszFileName; | /* filename to capture from */
L_INT nResType; | /* resource type to capture */
L_TCHAR L_FAR *pResID; | /* resource ID to be captured*/
L_BOOL bCaptureByIndex; | /* flag */
COLORREF clrBackGnd; | /* background color to be used for icons.*/
CAPTURECALLBACK pfnCaptureCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Captures an image from the specified resource stored in an EXE or DLL.

Parameter | Description
pBitmap | Pointer to a bitmap handle that references the captured data.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
pszFileName | Character string containing the name of the exe (or dll) from which the resource should be captured.
nResType | Specifies the type of resource to capture. Possible values are:
 | Value | Meaning
 | RESTYPE_BITMAP | Capture a bitmap resource
 | RESTYPE_ICON | Capture an icon resource
 | RESTYPE_CURSOR | Capture a cursor resource

pResID | Specifies the index of the resource to capture. You can use MAKEINDEX or MAKERESOURCEID macros to convert the resource ids to strings.
bCaptureByIndex | Flag of the requested resource. Possible values are:
 | Value | Meaning
 | TRUE | Indicates that pResID is the index position of the requested resource.
 | FALSE | Indicates that pResID is the resource ID of the requested resource.
clrBackGnd | Background color for icons.
pfnCaptureCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in CAPTURECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function is similar to L_CaptureFromEXEDlg, but does not display a dialog box. It simply captures the resource identified by nResType and pResID, from pszFileName. The captured bitmap may or may not have a region, depending on the transparency information of the captured resource.

Use L_CaptureGetResCount to determine the number of resources in an executable.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_CaptureFromEXEDlg, CAPTURECALLBACK, L_StopCapture, L_CaptureGetResCount

Example

int MyMain()
{
BITMAPHANDLE Bitmap;
int nRet;

/*To call the L_CaptureFromExe*/

nRet = L_CaptureFromExe(
&Bitmap, sizeof(BITMAPHANDLE),
TEXT("annot32.exe"),
RESTYPE_ICON,

0,
TRUE,
RGB(255,192,192),
pfnCaptureCallback,
NULL
);
L_FreeBitmap (&Bitmap);

return 0;
}

L_INT L_EXPORT pfnCaptureCallback (pBITMAPHANDLE pBitmap, pLEADCAPTUREINFO pCaptureInfo, L_VOID L_FAR* pUserData)
{
/* save the captured image */
return(L_SaveBitmap (TEXT("d:\\temp\\test.bmp"), pBitmap, FILE_BMP, 0, 0, NULL));
}


L_CaptureFromEXEDlg

#include "l_bitmap.h"

L_INT L_CaptureFromEXEDlg(pBitmap, uBitmapStructSize, pszFileName, pTransparentColor, nResType, nDialogType, pCaptureInfo, uInfoStructSize, pfnCaptureCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uBitmapStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
L_TCHAR L_FAR * pszFileName; | /* filename to capture from */
LPCOLORREF pTransparentColor; | /* pointer to a color */
L_INT nResType; | /* resource type to be captured. */
L_INT nDialogType; | /* type of dialog to be displayed */
pLEADCAPTUREINFO pCaptureInfo; | /* pointer to info structure */
L_UINT uInfoStructSize; | /* size in bytes, of the structure pointed to by pCaptureInfo */
CAPTURECALLBACK pfnCaptureCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Displays a dialog and captures an image from a resource stored in an EXE or DLL.

Parameter | Description
pBitmap | Pointer to a bitmap handle that references the captured data.
uBitmapStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
pszFileName | Character string containing the name of the exe (or dll) from which the resource should be captured.
pTransparentColor | Pointer to a color to be used in place of the transparent color of an Icon or Cursor.
nResType | Type of resource to be captured. Possible values are:
 | Value | Meaning
 | RESTYPE_BITMAP | Capture a bitmap
 | RESTYPE_ICON | Capture an icon
 | RESTYPE_CURSOR | Capture a cursor

nDialogType | Type of dialog to be displayed. Possible values are:
 | Value | Meaning
 | LTCAPDLG_TREEVIEW | Display tree dialog
 | LTCAPDLG_TABVIEW | Display tab view
pCaptureInfo | Address of LEADCAPTUREINFO structure to be filled with information regarding the captured image's source. Pass NULL if you are not interested in extra information about the capture.
uInfoStructSize | Size in bytes, of the structure pointed to by pCaptureInfo, for versioning. Use sizeof(LEADCAPTUREINFO).
pfnCaptureCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in CAPTURECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function displays a dialog box that allows the user to select a resource from which a captured image should be made. The callback can be used to do multiple captures, depending on the options set using L_SetCaptureOption.

The captured bitmap may or may not have a region, depending on the transparency information of the captured resource.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_SetCaptureOption, L_SetCaptureOptionDlg, CAPTURECALLBACK, L_StopCapture

Example

L_INT L_EXPORT pfnCaptureCallback (pBITMAPHANDLE pBitmap, pLEADCAPTUREINFO pCaptureInfo, L_VOID L_FAR* pUserData)
{
/* save the captured image */
return(L_SaveBitmap (TEXT("d:\\temp\\test.bmp"), pBitmap, FILE_BMP, 0, 0, NULL));
}

int MyMain()
{
BITMAPHANDLE Bitmap;
COLORREF TransparentColor;
LEADCAPTUREINFO CaptureInfo;
int nRet;

/*To call the L_CaptureFromExeDlg Tree*/
TransparentColor = RGB(0, 0, 0);
L_CaptureFromExeDlg (
&Bitmap, sizeof(BITMAPHANDLE),
NULL,
&TransparentColor,
RESTYPE_BITMAP | RESTYPE_ICON | RESTYPE_CURSOR,
LTCAPDLG_TREEVIEW,
&CaptureInfo, sizeof(LEADCAPTUREINFO),
pfnCaptureCallback,
NULL
);
L_FreeBitmap (&Bitmap);

return 0;
}


L_CaptureFullScreen

#include "l_bitmap.h"

L_INT L_CaptureFullScreen(pBitmap, uStructSize, pCaptureInfo, uInfoStructSize, pfnCaptureCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uBitmapStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
pLEADCAPTUREINFO pCaptureInfo; | /* pointer to info structure */
L_UINT uInfoStructSize; | /* size in bytes, of the structure pointed to by pCaptureInfo */
CAPTURECALLBACK pfnCaptureCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Captures an image of the entire screen.

Parameter | Description
pBitmap | Pointer to a bitmap handle that references the captured data.
uBitmapStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
pCaptureInfo | Address of LEADCAPTUREINFO structure to be filled with information regarding the captured image's source. Pass NULL if you are not interested in extra information about the capture.
uInfoStructSize | Size in bytes, of the structure pointed to by pCaptureInfo, for versioning. Use sizeof(LEADCAPTUREINFO).
pfnCaptureCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in CAPTURECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function captures an image of the entire screen. The callback can be used to do multiple captures, depending on the options set using L_SetCaptureOption.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_SetCaptureOption, CAPTURECALLBACK, L_StopCapture

Example

int MyMain()
{
BITMAPHANDLE Bitmap;
LEADCAPTUREINFO CaptureInfo;

/*To call the L_CaptureFullScreen*/
L_CaptureFullScreen (
&Bitmap, sizeof(BITMAPHANDLE),
&CaptureInfo, sizeof(LEADCAPTUREINFO),
pfnCaptureCallback,
NULL
);
L_FreeBitmap (&Bitmap);

return 0;
}

L_INT L_EXPORT pfnCaptureCallback (pBITMAPHANDLE pBitmap, pLEADCAPTUREINFO pCaptureInfo, L_VOID L_FAR* pUserData)
{
/* save the captured image */
return(L_SaveBitmap (TEXT("d:\\temp\\test.bmp"), pBitmap, FILE_BMP, 0, 0, NULL));
}


L_CaptureGetResCount

#include "l_bitmap.h"

L_INT L_CaptureGetResCount(pszFileName, nResType, pnCount)

L_TCHAR L_FAR * pszFileName; | /* name of the file in which to count resources */
L_INT nResType; | /* resource type to count */
L_INT L_FAR * pnCount; | /* address of the variable to be updated with the resource count */

Counts the number of resources of the specified type in the given executable file.

Parameter | Description
pszFileName | Character string containing the name of the exe (or dll) from which the resources should be counted.
nResType | Specifies the type of resource to count. Possible values are:
 | Value | Meaning
 | RESTYPE_BITMAP | Count bitmap resources
 | RESTYPE_ICON | Count icon resources
 | RESTYPE_CURSOR | Count cursor resources
pnCount | Address of a variable to be filled with the number of resources found.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

After calling this function, pnCount points to the number of resources of the specified type that were found in the given executable file.

You can use this to capture all of the resources with calls to L_CaptureFromEXE.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_CaptureFromEXE, L_CaptureFromEXEDlg

Example

int MyMain()
{

BITMAPHANDLE Bitmap;
int nIconsCount;

/*To call the L_CaptureGetResCount*/
L_CaptureGetResCount(TEXT("annot32.exe"),RESTYPE_ICON,&nIconsCount);
L_FreeBitmap (&Bitmap);

return 0;
}


L_CaptureMenuUnderCursor

#include "l_bitmap.h"

L_INT L_CaptureMenuUnderCursor(pBitmap, uBitmapStructSize, pCaptureInfo, uInfoStructSize, pfnCaptureCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uBitmapStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
pLEADCAPTUREINFO pCaptureInfo; | /* pointer to info structure */
L_UINT uInfoStructSize; | /* size in bytes, of the structure pointed to by pCaptureInfo */
CAPTURECALLBACK pfnCaptureCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Captures an image of the selected menu's contents.

Parameter | Description
pBitmap | Pointer to a bitmap handle that references the captured data.
uBitmapStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
pCaptureInfo | Address of LEADCAPTUREINFO structure to be filled with information regarding the captured image's source. Pass NULL if you are not interested in extra information about the capture.
uInfoStructSize | Size in bytes, of the structure pointed to by pCaptureInfo, for versioning. Use sizeof(LEADCAPTUREINFO).
pfnCaptureCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in CAPTURECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function captures the contents of the menu directly under the cursor to a bitmap. The callback can be used to do multiple captures, depending on the options set using L_SetCaptureOption.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_SetCaptureOption, L_SetCaptureOptionDlg, CAPTURECALLBACK

Example

int MyMain()
{
BITMAPHANDLE Bitmap;
LEADCAPTUREINFO CaptureInfo;

/*To call the L_CaptureMenuUnderCursor*/
L_CaptureMenuUnderCursor ( &Bitmap, sizeof(BITMAPHANDLE), &CaptureInfo, sizeof(LEADCAPTUREINFO), pfnCaptureCallback, NULL);
L_FreeBitmap (&Bitmap);

return 0;
}

L_INT L_EXPORT pfnCaptureCallback (pBITMAPHANDLE pBitmap, pLEADCAPTUREINFO pCaptureInfo, L_VOID L_FAR* pUserData)
{
/* save the captured image */
return(L_SaveBitmap (TEXT("d:\\temp\\test.bmp"), pBitmap, FILE_BMP, 0, 0, NULL));
}


L_CaptureMouseCursor

#include "l_bitmap.h"

L_INT L_CaptureMouseCursor(pBitmap, uBitmapStructSize, crFill, pCaptureInfo, uInfoStructSize, pfnCaptureCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uBitmapStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
COLORREF crFill; | /* color to fill the transparent area of the captured image */
pLEADCAPTUREINFO pCaptureInfo; | /* pointer to info structure */
L_UINT uInfoStructSize; | /* size in bytes, of the structure pointed to by pCaptureInfo */
CAPTURECALLBACK pfnCaptureCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Captures an image of the current mouse cursor shape.

Parameter | Description
pBitmap | Pointer to a bitmap handle that references the captured data.
uBitmapStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
crFill | Color used to fill the transparent area of the captured image.
pCaptureInfo | Address of LEADCAPTUREINFO structure to be filled with information regarding the captured image's source. Pass NULL if you are not interested in extra information about the capture.
uInfoStructSize | Size in bytes, of the structure pointed to by pCaptureInfo, for versioning. Use sizeof(LEADCAPTUREINFO).
pfnCaptureCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in CAPTURECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function captures an image of the current mouse cursor shape.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

CAPTURECALLBACK

Example

int MyMain()
{
BITMAPHANDLE Bitmap;
LEADCAPTUREINFO CaptureInfo;

/*To call the L_CaptureMouseCursor*/
L_CaptureMouseCursor ( &Bitmap, sizeof(BITMAPHANDLE),
RGB(0, 0, 0),
&CaptureInfo, sizeof(LEADCAPTUREINFO),
(CAPTURECALLBACK)pfnCaptureCallback,
NULL);
L_FreeBitmap (&Bitmap);

return 0;
}

L_INT L_EXPORT pfnCaptureCallback (pBITMAPHANDLE pBitmap, pLEADCAPTUREINFO pCaptureInfo, L_VOID L_FAR* pUserData)
{
/* save the captured image */
return(L_SaveBitmap (TEXT("d:\\temp\\test.bmp"), pBitmap, FILE_BMP, 0, 0, NULL));
}


L_CaptureSelectedObject

#include "l_bitmap.h"

L_INT L_CaptureSelectedObject(pBitmap, uBitmapStructSize, pObjectOptions, uOptionsStructSize, pCaptureInfo, uInfoStructSize, pfnCaptureCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uBitmapStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
pLEADCAPTUREOBJECTOPTION pObjectOptions; | /* pointer to an object options structure */
L_UINT uOptionsStructSize; | /* size in bytes, of the structure pointed to by pObjectOptions */
pLEADCAPTUREINFO pCaptureInfo; | /* pointer to info structure */
L_UINT uInfoStructSize; | /* size in bytes, of the structure pointed to by pCaptureInfo */
CAPTURECALLBACK pfnCaptureCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Captures an image of the selected window's object.

Parameter | Description
pBitmap | Pointer to a bitmap handle that references the captured data.
uBitmapStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
pObjectOptions | Address of a LEADCAPTUREOBJECTOPTION structure to be filled with specific options for the L_CaptureSelectedObject function. Pass NULL if you don’t want to use this parameter.
uOptionsStructSize | Size in bytes, of the structure pointed to by pObjectOptions, for versioning. Use sizeof(LEADCAPTUREOBJECTOPTION).
pCaptureInfo | Address of LEADCAPTUREINFO structure to be filled with information regarding the captured image's source. Pass NULL if you are not interested in extra information about the capture.
uInfoStructSize | Size in bytes, of the structure pointed to by pCaptureInfo, for versioning. Use sizeof(LEADCAPTUREINFO).
pfnCaptureCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in CAPTURECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function allows the user to select an object to capture, and then captures that object to a bitmap. Any Windows object, such as a window, tool bar, or icon, can be captured. The callback can be used to do multiple captures, depending on the options set using L_SetCaptureOption.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_SetCaptureOption, L_SetCaptureOptionDlg, L_GetDefaultObjectOption, CAPTURECALLBACK

Example

int MyMain()
{
BITMAPHANDLE Bitmap;
LEADCAPTUREOBJECTOPTION ObjectOptions;
LEADCAPTUREINFO CaptureInfo;
int nRet;

/* To call the L_CaptureSelectedObject & L_GetDefaultObjectOption */
/* get the default object options */
nRet = L_GetDefaultObjectOption(&ObjectOptions, sizeof(LEADCAPTUREOBJECTOPTION));
ObjectOptions.uBorderWidth = 3;
if(nRet == SUCCESS)
L_CaptureSelectedObject ( &Bitmap, sizeof(BITMAPHANDLE), &ObjectOptions, sizeof(LEADCAPTUREOBJECTOPTION), &CaptureInfo, sizeof(LEADCAPTUREINFO), pfnCaptureCallback, NULL);
L_FreeBitmap (&Bitmap);

return 0;
}

L_INT L_EXPORT pfnCaptureCallback (pBITMAPHANDLE pBitmap, pLEADCAPTUREINFO pCaptureInfo, L_VOID L_FAR* pUserData)
{
/* save the captured image */
return(L_SaveBitmap (TEXT("d:\\temp\\test.bmp"), pBitmap, FILE_BMP, 0, 0, NULL));
}


L_CaptureSetHotKeyCallback

#include "l_bitmap.h"

L_INT L_CaptureSetHotKeyCallback(pfnCaptureHotKeyCB, pUserData)

CAPTUREHOTKEYCALLBACK pfnCaptureHotKeyCB; | /* notification callback */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Sets the callback function that will be called to notify the application that the user has pressed the capture HotKey.

Parameter | Description
pfnCaptureHotKeyCB | Callback function notifying the application that the HotKey was pressed. Specify NULL to cancel the previously assigned callback and terminate the waiting process.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

None.

Comments

Call this function to cause LEADTOOLS to wait and check for the HotKey specified in a call to L_SetCaptureOption to be pressed. When this HotKey is pressed, the CaptureHotKeyCB callback will be called to notify the application that the user wishes to capture an image. By default, there is no waiting process for the capture HotKey.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_SetCaptureOption, CAPTUREHOTKEYCALLBACK

Example

L_INT CALLBACK CaptureHotKeyCB (L_INT nHotKey, L_UINT uHotKeyModifiers, L_VOID L_FAR * pUserData);

int MyMain()
{
/*To call the L_CaptureSetHotKeyCallback*/
L_CaptureSetHotKeyCallback(CaptureHotKeyCB, NULL);
return 0;
}

L_INT CALLBACK CaptureHotKeyCB (L_INT nHotKey, L_UINT uHotKeyModifiers, L_VOID L_FAR * pUserData)
{
MessageBox(NULL, TEXT("HotKey"), TEXT("HotKey Pressed"), MB_OK);
/* start a capture here */
return SUCCESS;
}


L_CaptureWallPaper

#include "l_bitmap.h"

L_INT L_CaptureWallPaper(pBitmap, uBitmapStructSize, pCaptureInfo, uInfoStructSize, pfnCaptureCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uBitmapStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
pLEADCAPTUREINFO pCaptureInfo; | /* pointer to info structure */
L_UINT uInfoStructSize; | /* size in bytes, of the structure pointed to by pCaptureInfo */
CAPTURECALLBACK pfnCaptureCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Captures an image of the current wallpaper.

Parameter | Description
pBitmap | Pointer to a bitmap handle that references the captured data.
uBitmapStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
pCaptureInfo | Address of LEADCAPTUREINFO structure to be filled with information regarding the captured image's source. Pass NULL if you are not interested in extra information about the capture.
uInfoStructSize | Size in bytes, of the structure pointed to by pCaptureInfo, for versioning. Use sizeof(LEADCAPTUREINFO).
pfnCaptureCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in CAPTURECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function captures an image of the current wallpaper.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

CAPTURECALLBACK, L_StopCapture

Example

int MyMain()
{
BITMAPHANDLE Bitmap;
LEADCAPTUREINFO CaptureInfo;

/* To call the L_CaptureWallPaper */
L_CaptureWallPaper (&Bitmap, sizeof(BITMAPHANDLE), &CaptureInfo, sizeof(LEADCAPTUREINFO), (CAPTURECALLBACK)pfnCaptureCallback, NULL);
L_FreeBitmap (&Bitmap);

return 0;
}

L_INT L_EXPORT pfnCaptureCallback (pBITMAPHANDLE pBitmap, pLEADCAPTUREINFO pCaptureInfo, L_VOID L_FAR* pUserData)
{
/* save the captured image */
return(L_SaveBitmap (TEXT("d:\\temp\\test.bmp"), pBitmap, FILE_BMP, 0, 0, NULL));
}


L_CaptureWindowUnderCursor

#include "l_bitmap.h"

L_INT L_CaptureWindowUnderCursor(pBitmap, uBitmapStructSize, pCaptureInfo, uInfoStructSize, pfnCaptureCallback, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uBitmapStructSize; | /* size in bytes, of the structure pointed to by pBitmap */
pLEADCAPTUREINFO pCaptureInfo; | /* pointer to info structure */
L_UINT uInfoStructSize; | /* size in bytes, of the structure pointed to by pCaptureInfo */
CAPTURECALLBACK pfnCaptureCallback; | /* optional callback function */
L_VOID L_FAR * pUserData; | /* pointer to more parameters for the callback */

Captures an image of the window under the cursor position.

Parameter | Description
pBitmap | Pointer to a bitmap handle that references the captured data.
uBitmapStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
pCaptureInfo | Address of LEADCAPTUREINFO structure to be filled with information regarding the captured image's source. Pass NULL if you are not interested in extra information about the capture.
uInfoStructSize | Size in bytes, of the structure pointed to by pCaptureInfo, for versioning. Use sizeof(LEADCAPTUREINFO).
pfnCaptureCallback | Optional callback function for additional processing.
 | If you do not provide a callback function, use NULL as the value of this parameter.
 | If you do provide a callback function, use the function pointer as the value of this parameter.
 | The callback function must adhere to the function prototype described in CAPTURECALLBACK Function.
pUserData | Void pointer that you can use to pass one or more additional parameters that the callback function needs.
 | To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID L_FAR *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure.
 | If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function captures an image of the window under the mouse cursor.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

CAPTURECALLBACK

Example

int MyMain()
{
BITMAPHANDLE Bitmap;
LEADCAPTUREINFO CaptureInfo;

/* To call the L_CaptureWindowUnderCursor */
L_CaptureWindowUnderCursor (
&Bitmap, sizeof(BITMAPHANDLE),
&CaptureInfo, sizeof(LEADCAPTUREINFO),
(CAPTURECALLBACK)pfnCaptureCallback,
NULL);
L_FreeBitmap (&Bitmap);

return 0;
}

L_INT L_EXPORT pfnCaptureCallback (pBITMAPHANDLE pBitmap, pLEADCAPTUREINFO pCaptureInfo, L_VOID L_FAR* pUserData)
{
/* save the captured image */
return(L_SaveBitmap (TEXT("d:\\temp\\test.bmp"), pBitmap, FILE_BMP, 0, 0, NULL));
}


L_GetCaptureOption

#include "l_bitmap.h"

L_INT L_GetCaptureOption(pOptions, uStructSize)

pLEADCAPTUREOPTION pOptions; | /* address of structure to be filled */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pOptions */

Gets the current options for image capture such as HotKey, Delay, and Count.

Parameter | Description
pOptions | Pointer to the LEADCAPTUREOPTION structure to be filled with the current capture options.
uStructSize | Size in bytes, of the structure pointed to by pOptions, for versioning. Use sizeof(LEADCAPTUREOPTION).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function to get the current image capture options. For information on the default capture options, refer to LEADCAPTUREOPTION.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_SetCaptureOption, L_SetCaptureOptionDlg

Example

void MyMain()
{
LEADCAPTUREOPTION CaptureOption;

/*To call the L_SetCaptureOption & L_GetCaptureOption
/* get current capture options */
memset(&CaptureOption, 0, sizeof(LEADCAPTUREOPTION));

CaptureOption.uStructSize = sizeof(LEADCAPTUREOPTION);

L_SetCaptureOption(&CaptureOption);

/* change the hot key to F6 */
CaptureOption.nHotKey = VK_F6;
/* set the new options */
L_GetCaptureOption(&CaptureOption, sizeof(LEADCAPTUREOPTION));
}


L_GetDefaultAreaOption

#include "l_bitmap.h"

L_INT L_GetDefaultAreaOption(pCaptureAreaOption, uStructSize)

pLEADCAPTUREAREAOPTION pCaptureAreaOption; | /* pointer to the area option structure */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pCaptureAreaOption */

Resets the passed area option structure to its default values.

Parameter | Description
pCaptureAreaOption | Pointer to the area option structure to be reset to its default values.
uStructSize | Size in bytes, of the structure pointed to by pCaptureAreaOption, for versioning. Use sizeof(LEADCAPTUREAREAOPTION).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function resets the passed area option structure to its default values.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_CaptureArea, L_CaptureAreaOptionDlg

Example

For an example, refer to L_CaptureArea.


L_GetDefaultObjectOption

#include "l_bitmap.h"

L_INT L_GetDefaultObjectOption(pObjectOptions, uStructSize)

pLEADCAPTUREOBJECTOPTION pObjectOptions; | /* pointer to the object option structure */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pObjectOptions */

Resets the passed object option structure to its default values.

Parameter | Description
pObjectOptions | Pointer to the object option structure to be reset to its default values.
uStructSize | Size in bytes, of the structure pointed to by pObjectOptions, for versioning. Use sizeof(LEADCAPTUREOBJECTOPTION).

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function resets the passed object option structure to its default values.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_CaptureSelectedObject

Example

For an example, refer to L_CaptureSelectedObject.


L_IsCaptureActive

#include "l_bitmap.h"

L_INT L_IsCaptureActive(void)

Indicates whether a capture process has been started.

Returns

None

Comments

You should stop a previously started capture process before starting another, or before the calling thread terminates.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_StopCapture

Example

/* if capture is active, stop it */
if(L_IsCaptureActive())
L_StopCapture();


L_SetCaptureOption

#include "l_bitmap.h"

L_INT L_SetCaptureOption(pOptions)

pLEADCAPTUREOPTION pOptions;

/* address of structure with options */

Sets options for image capture, such as HotKey, Delay, and Count.

Parameter | Description
pOptions | Address of the structure where you have set the option values.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function to change the current image capture options. For information on the default option settings, refer to LEADCAPTUREOPTION.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_SetCaptureOptionDlg, L_GetCaptureOption

Example

For an example, refer to L_GetCaptureOption.


L_SetCaptureOptionDlg

#include "l_bitmap.h"

L_INT L_SetCaptureOptionDlg(hWndOwner, pOptions)

HWND hWndOwner; | /* handle of parent window */
pLEADCAPTUREOPTION pOptions; | /* address of structure with options */

Brings up the capture option dialog box and sets the capture options.

Parameter | Description
hWndOwner | Handle of parent window.
pOptions | Address of a LEADCAPTUREOPTION structure that will be updated with the capture options entered through the dialog. You can pass NULL if you are not interested in the specified settings.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function to change the current image capture options. For information on the default capture options, refer to LEADCAPTUREOPTION.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_SetCaptureOption, L_GetCaptureOption

Example

int MyMain()
{
BITMAPHANDLE Bitmap;
HWND hwnd;
LEADCAPTUREINFO CaptureInfo;
LEADCAPTUREOPTION CaptureOption;
int nRet;

/*To call the L_SetCaptureOptionDlg*/
hwnd = GetForegroundWindow();
/* retrieve a copy of CaptureOption */
L_SetCaptureOptionDlg (hwnd, &CaptureOption);
L_FreeBitmap (&Bitmap);

return 0;
}


L_StopCapture

#include "l_bitmap.h"

L_INT L_StopCapture (L_VOID)

Stops the current capture process.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function stops the current capture process.

You should stop a previously started capture process before beginning another, or before the calling thread terminates.

Required DLLs and Libraries

LTSCR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions

L_IsCaptureActive, L_CaptureActiveClient, L_CaptureActiveWindow, L_CaptureFullScreen, L_CaptureArea, L_CaptureFromEXE, L_CaptureFromEXEDlg, L_CaptureMenuUnderCursor, L_CaptureMouseCursor, L_CaptureSelectedObject, L_CaptureWallPaper, L_CaptureWindowUnderCursor

Example

int MyMain()
{

/* To call the L_CaptureStopCapture */
L_StopCapture();

return 0;
}


CAPTURECALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (pBitmap, pCaptureInfo, pUserData)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
pLEADCAPTUREINFO pCaptureInfo; | /* pointer to an info structure */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

Handles the output image data acquired by one of the image capture functions.

Parameter | Description
pBitmap | The pointer to the bitmap handle referencing the bitmap that contains the captured image.
pCaptureInfo | Pointer to a LEADCAPTUREINFO structure containing information about the source of the captured image.
pUserData | Void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this callback function to process captured image data when multiple captures are performed. Multiple captures can be done by setting the capture options using L_SetCaptureOption.

Example

For an example, refer to L_CaptureArea.


CAPTUREHOTKEYCALLBACK Function

#include "l_bitmap.h"

L_INT pEXT_CALLBACK YourFunction (nHotKey, uHotKeyModifiers, pUserData)

L_INT nHotKey; | /* code for HotKey that was pressed */
L_UINT uHotKeyModifiers; | /* modifier key */
L_VOID L_FAR * pUserData; | /* pointer to additional parameters */

Signals that the user has pressed the capture HotKey.

Parameter | Description
nHotKey | Key code for activation key.
uHotKeyModifiers | Modifier keys used with nHotKey. Possible values are listed below and may be combined.
 | MOD_ALT | Alt Key pressed.
 | MOD_CONTROL | Control key pressed.
 | MOD_SHIFT | Shift key pressed.
 | 0 | No modifier key was pressed.
pUserData | Void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of the calling function.)
 | Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this callback function to receive notification that the capture HotKey has been pressed by the user. Set this callback using L_CaptureSetHotKeyCallback.

If you do not wish to process the pressed HotKey + Modifiers combination, return ERROR_USER_ABORT.

Example

For an example, refer to L_CaptureSetHotKeyCallback.


Raster Pro/Document/Medical Features

Raster Pro:

LEADTOOLS Raster Imaging Pro provides some imaging capabilities that are not available in the LEADTOOLS Raster Imaging product. In order to access these features, you must unlock them by calling L_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 L_UnlockSupport.

Document/Medical:

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

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

LEADTOOLS Document Imaging

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

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

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

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

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

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

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

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

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

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

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

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

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

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

LEADTOOLS Document Imaging Suite

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

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

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

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

LEADTOOLS Medical Imaging

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

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

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

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

LEADTOOLS Medical Imaging Suite

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

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

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

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

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


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.


Topic Selection

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

Sales@Leadtools.com
www.leadtools.com

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

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

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

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

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