Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.23
LEADTOOLS TWAIN C++ Class Library Help

LTwain::SetImageFrame

Show in webframe

#include "ltwrappr.h"

L_INT LTwain::SetImageFrame (pFrame);

pTW_FRAME pFrame;

/* pointer to a structure */

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

Parameter

Description

pFrame

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

Returns

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

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::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

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;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.