LTwain::SetImageFrame

Summary

Sets the image frame used when transferring images from the current TWAIN source.

Syntax

#include "ltwrappr.h"

L_INT LTwain::SetImageFrame (pFrame);

Parameters

pTW_FRAME pFrame

Pointer to a variable that contains the image frame value to set.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

The image frame specifies the size and location of the image to acquire. To obtain the current image frame value, call the LTwain::GetImageFrame function.

Required DLLs and Libraries

See Also

Functions

Topics

Example

TW_FIX32 FloatToTWFix32 (float Floater)  
 
{ 
   TW_FIX32 Fix32;  
   TW_INT32 Int32 = (TW_INT32)(Floater * 65536.0 + 0.5);  
 
   Fix32.Whole = (TW_INT16) (Int32 >> 16);  
 
   Fix32.Frac = (TW_UINT16) (Int32 & 0x0000FFFFL);  
 
   return Fix32;  
 
} 
 
L_INT LTwain__SetImageFrameExample(LTwain * plTwain)  
 
{ 
   L_INT    nRet = SUCCESS;  
   TW_FRAME frame;  
 
   nRet = plTwain->GetImageFrame (&frame);  
 
   if (nRet == SUCCESS)  
 
   { 
 
      frame.Left = FloatToTWFix32(0);  
 
      frame.Top = FloatToTWFix32(0);  
 
      frame.Right = FloatToTWFix32(8.5);  
 
      frame.Bottom = FloatToTWFix32(11);  
 
      nRet = plTwain->SetImageFrame(&frame);  
      if(nRet != SUCCESS) 
         return nRet; 
 
   } 
   else 
      return nRet; 
 
   return SUCCESS; 
 
} 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 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.