Setting the Filename and Format Type for Disk File Transfer

 

You can set the path and name of the file to scan as seen in the Setting the TWAIN Image Acquisition Mode section. If the scanner allows you to change the image file format, you can change it with the SetCapabilityOneNumValue function/method of the BiTWAIN DLL/OCX. The ICAP_IMAGEFILEFORMAT TWAIN capability specifies the file format of the scanned image. You can get and set this value if the scanner supports this capability.

 

 

[C++]

 

/* Set the image file format to tiff */

 

#include “BiTwain.h”

 

/* 1. parameter: Name of the capability to set

   2. parameter: MSG_SET or MSG_RESET

   3. parameter: Value to set */

 

int err = SetCapabilityOneNumValue(ICAP_IMAGEFILEFORMAT,

MSG_SET, 0);

 

if (err == TW_OK)

{

            // Success

}

else

{

            // Error

}

 

[VB]

 

‘ Set the image file format to tiff

 

Dim err As Long

 

err = _ BiTwain.SetCapabilityOneNumValue(ICAP_IMAGEFILEFORMAT, _

MSG_SET, 0)

 

If err = TW_OK Then

            ‘ Success

Else

            ‘ Error

End IF

 

[C#]

 

/* Set the image file format to tiff */

 

int err = BiTwain.SetCapabilityOneNumValue(

(int)BITWAINLib.enumCapabilities.ICAP_IMAGEFILEFORMAT,

(int)BITWAINLib.enumCapabilityOperations.MSG_SET, 0);

 

if (err == (int)BITWAINLib.enumErrorCodes.TW_OK)

{

            // Success

}

else

{

            // Error

}