Sets the options used for transferring data from the current TWAIN source.
#include "ltwrappr.h"
L_INT LTwain::SetTransferOptions(pTransferOpts);
Pointer to the TRANSFEROPTIONS structure that contains the transfer options to set.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
To obtain the current transfer options, call the LTwain::GetTransferOptions function.
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;
}