You are here: GdPicture.NET > Documentation > Classes > GdPictureImaging Class > GdPictureImaging Methods > TWAIN Features > TwainAcquireToFile Method
logo.gif
ContentsIndexHome
PreviousUpNext
GdPictureImaging.TwainAcquireToFile Method

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 transfer mode. 

 

-> The output image format should be negotiated with the TwainSetImageFileFormat() function. 

-> The output image compression should be negotiated with the TwainSetCompression() function.

C#
public GdPictureStatus TwainAcquireToFile(
    String FilePath, 
    IntPtr HANDLE
);
Visual Basic
Public Function TwainAcquireToFile(
    ByVal FilePath As String, 
    ByVal HANDLE As IntPtr
) As GdPictureStatus
Parameters
Parameters 
Description 
FilePath 
The path of the image file to create.  
HANDLE 
A Window Handle IE: Me.Handle. In most applications you can use nothing but on Citrix and WTS, this must be a top-level window or a child of a top level window.  
Returns

A member of the GdPictureStatus enumeration.

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.

What do you think about this topic? Send feedback!
Copyright (c) 2009-2011 www.gdpicture.com. All rights reserved.