Glossary Item Box

ImageMan DLL Suite Version 8 Submit feedback on this topic   

ScanAcquirePage

HANDLE IMAPI ScanAcquirePage (hWnd, wPixTypes)

This function displays the scanner's dialog to acquire an image. When the image has been scanned it is returned as a handle to a DIB (Device Independent Bitmap).

 

Parameter

Type

Description

hWnd

HWND

Handle to the a Window to be used as the parent for the scanner' s dialog.

wPixTypes

WORD

Specifies the color depth of the image data to be returned.

 

Return Value

The return value is a handle to a DIB if the scan was successful. If the scan failed then the return value is NULL.

Comments

Upon return from this function, you can call the ImgFromDIB function to create an ImageMan handle from the scanned image.

The following options are defined for the xPixTypes parameter:

Define Value Description

Define

Value

Description

TWAIN_ANYTYPE

0x00

Any Color format

TWAIN_BW

0x01

Black & White (1 Bit)

TWAIN_GRAY

0x02

Grayscale (4 or 8 Bit)

TWAIN_PALETTE

0x08

Color (4 or 8 Bit)

TWAIN_RGB

0x04

Color (24 Bit)

Example

HANDLE hDIB;

if( ScanIsTwainAvailable() ) {

hDIB = ScanAcquirePage( hWnd, TWAIN_ANYTYPE );

if( hDIB ) {

hImage = ImgFromDIB( hDIB );

// Now we can call ImgDrawImage or any other ImageMan functions

} else

// Scanning Failed!

}

 

 


Copyright 2008 Data Techniques, Inc. All Rights Reserved