End Acquire and Retrieve Images |
Top Previous Next |
If you choose to process the image data yourself and not save the data to a file automatically, the functions DTWAIN_AcquireNative, DTWAIN_AcquireNativeEx, DTWAIN_AcquireBuffered, and DTWAIN_AcquireBufferedEx are used.
When using these functions, you will need to get the images that were created for the pages that were acquired from the Source. For almost all acquisitions, the returned images are either Device Independent Bitmaps (DIBs) or a specific image format. To retrieve the number of acquisitions, number of images for a particular acquisition and the images generated, the following functions are used:
Number of acquisitions attempted DTWAIN_ArrayGetCount on the returned DTWAIN_ARRAY.
Number of images generated for each acquisition request
Retrieval of one HANDLE to acquired image memory
Retrieval of all acquired images for an acquisition request
Retrieval of the last image acquired (useful for retrieving the images while a multi-page acquisition is executed) DTWAIN_GetCurrentAcquiredImage
Note: If the DTWAIN_AcquireBuffered is called to acquire images, and compression is used, compressed image data is returned instead of DIBs. The image data can be then saved to a file or processed by the application in any way it sees fit.
To get a handle to the image data, the application must call the Windows API function GlobalLock to lock the memory, and GlobalUnlock and GlobalFree to destroy the memory. The application is solely responsible for deleting the memory that is necessary to store the image data.
The DTWAIN_AcquireFile, and DTWAIN_AcquireFileEx functions do not store the acquired images in memory. Therefore the functions defined above do not apply. |