LTwain::SetTransferOptions

#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.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

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.

See Also

Functions:

LTwain::GetTransferOptions, LTwain::GetSupportedTransferMode, LTwain::SetResolution, LTwain::GetResolution, LTwain::SetImageFrame, LTwain::GetImageFrame, LTwain::SetImageUnit, LTwain::GetImageUnit, LTwain::SetImageBitsPerPixel, LTwain::GetImageBitsPerPixel, LTwain::SetImageEffects, LTwain::GetImageEffects, LTwain::SetAcquirePageOptions, LTwain::GetAcquirePageOptions, LTwain::SetRGBResponse, LTwain::ShowProgress, LTwain::EnableDuplex, LTwain::GetDuplexOptions, LTwain::SetMaxXferCount, LTwain::GetMaxXferCount

Topics:

Getting and Setting Capabilities

 

TWAIN Functionality: Capability Functions

Example

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, TEXT("C:\\Program Files\\LEAD Technologies, Inc\\LEADTOOLS 16\\Images\\test.bmp"));
         TransOpts.uFileFormat = TWFF_BMP; 
      }
      nRet = plTwain->SetTransferOptions(&TransOpts); 
      if(nRet != SUCCESS)
         return nRet;
   }
   return SUCCESS;
}