LTwain::SetImageUnit

#include "ltwrappr.h"

L_INT LTwain::SetImageUnit (nUnit)

L_INT nUnit;

/* image unit */

Sets the image unit value used to transfer images from the current TWAIN source.

Parameter

Description

nUnit

Specifies the unit value to set. For more information on possible values, refer to http://www.twain.org/ and click on TWAIN Specification (Version 1.9).

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function internally sets the image unit capability ICAP_UNITS. For more information on this capability, refer to http://www.twain.org/ and click on TWAIN Specification (Version 1.9).

To obtain the current image unit value, call the LTwain::GetImageUnit 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::SetTransferOptions, LTwain::GetTransferOptions, LTwain::GetSupportedTransferMode, LTwain::SetResolution, LTwain::GetResolution, LTwain::SetImageFrame, LTwain::GetImageFrame, 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__SetImageUnitExample(LTwain * plTwain) 
{
   L_INT nRet = SUCCESS; 
   L_INT nUnit; 
   nRet = plTwain->GetImageUnit (&nUnit); 
   if (nRet == SUCCESS) 
   {
      if (nUnit == TWUN_INCHES) 
      {
         nRet = plTwain->SetImageUnit(TWUN_INCHES); 
         if(nRet != SUCCESS)
            return nRet;
      }
   }
   else
      return nRet;
   L_INT nBPP; 
   nRet = plTwain->GetImageBitsPerPixel (&nBPP); 
   if (nRet == SUCCESS) 
   {
      if (nBPP == 24) 
         plTwain->SetImageBitsPerPixel (24); 
   }
   else
      return nRet;
   return SUCCESS;
}