See Also Examples Applies To
Acquires a single image, from the currently selected Data Source to a file.
This function uses only the File transfer mode.
The disk file mode is ideal when transferring large images that might encounter memory limitations with Native or memory mode.
However, Disk File mode is a bit slower than other thansfer mode.
-> The output image format shoud be negociated with the TwainSetCurrentImageFileFormat() function.
-> The output image compression shoud be negociated with the TwainSetCurrentCompression() function.
Syntax
object.TwainAcquireToFile (sFilePath, hwnd)
The TwainAcquireToFile syntax has these parts:
| Part | Description |
| object | Required. An object expression that evaluates to an object in the Applies To list. |
| sFilePath | Required. String. The path of the image file to create. |
| hwnd | Optional. Long. Default value is 0. A Win32 Window Handle. In most applications you can use 0 but on Citrix and WTS, this must be a top-level window or a child of a top level window. |
Returns
Long. GdPictureStatus
Remarks
By default, the default data source (DS) is opened, displays its dialog, and determines all the parameters of the acquisition and transfer.
If you want to (try to) hide the DS dialog, see TWAINSetHideUI.
Before using this function check that the TWAIN state is >= 4 (TWAIN_SOURCE_OPEN)
To get the TWAIN state, use the TwainGetState() function.
To set the TWAIN state to 4, use the TwainOpenDefaultSource() or TwainOpenSource() function.
Warning: To works, this function requires that the current Data source allows file transfer mode.
Use the TwainIsFileTransferModeAvailable() to check if the source support this mode of transfer.
Category
TWAIN Functions