LTwain::SetImageUnit

Summary

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

Syntax

#include "ltwrappr.h"

L_INT LTwain::SetImageUnit (nUnit)

Parameters

L_INT nUnit

Specifies the unit value to set. For more information on possible values, refer to the TWAIN specification.

Returns

Value Meaning
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 the TWAIN specification.

To obtain the current image unit value, call the LTwain::GetImageUnit function.

Required DLLs and Libraries

See Also

Functions

Topics

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; 
} 
Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS TWAIN C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.