#include "ltwrappr.h"
L_INT LTwain::SetTransferOptions(pTransferOpts);
pTRANSFEROPTIONS pTransferOpts; |
pointer to a structure |
Sets the options used for transferring data from the current TWAIN source.
Parameter |
Description |
pTransferOpts |
Pointer to the TRANSFEROPTIONS structure that contains the transfer options to set. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
To obtain the current transfer options, call the LTwain::GetTransferOptions function.
Required DLLs and Libraries
LTTWN For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName
L_INT LTwain__SetTransferOptionsExample(LTwain * plTwain)
{
L_INT nRet = SUCCESS;
L_UINT TransferModes = 0;
nRet = plTwain->GetSupportedTransferMode (&TransferModes);
if (nRet == SUCCESS)
{
if ((TransferModes & TWAIN_TRANSFER_FILE) == TWAIN_TRANSFER_FILE)
MessageBox(NULL, TEXT("File transfer is supported"), TEXT("Notice!"), MB_OK);
}
else
return nRet;
TRANSFEROPTIONS TransOpts;
memset(&TransOpts, 0, sizeof(TRANSFEROPTIONS));
plTwain->GetTransferOptions (&TransOpts, sizeof(TRANSFEROPTIONS));
if (nRet == SUCCESS)
{
if (TransOpts.TransferMode != TWAIN_TRANSFER_FILE)
{
TransOpts.TransferMode = TWAIN_TRANSFER_FILE;
lstrcpy(TransOpts.szFileName, MAKE_IMAGE_PATH(TEXT("test.bmp")));
TransOpts.uFileFormat = TWFF_BMP;
}
nRet = plTwain->SetTransferOptions(&TransOpts);
if(nRet != SUCCESS)
return nRet;
}
return SUCCESS;
}