LTwain::SetImageEffects

#include "ltwrappr.h"

L_INT LTwain::SetImageEffects (ulFlags, pBrightness, pContrast, pHighlight);

L_UINT32 ulFlags;

optional flags

pTW_FIX32 pBrightness;

pointer to a variable

pTW_FIX32 pContrast;

pointer to a variable

pTW_FIX32 pHighlight;

pointer to a variable

Sets the brightness, highlight and contrast values to use when transferring images from the current TWAIN source.

Parameter Description
ulFlags Flags that indicate which value(s) to set. You can combine values when appropriate by using a bitwise OR ( | ). Possible values are:
  Value Meaning
  TWAIN_NEGOTIATE_BRIGHTNESS [0x0010] Sets the brightness of the image.
  TWAIN_NEGOTIATE_CONTRAST [0x0020] Sets the contrast of the image.
  TWAIN_NEGOTIATE_HIGHLIGHT [0x0040] Sets the highlight of the image.
pBrightness Pointer to a variable that contains the brightness value to set. Possible values range from 1000 to 1000.
pContrast Pointer to a variable that contains the contrast value to set. Possible values range from 1000 to 1000.
pHighlight Pointer to a variable that contains the highlight value to set. Possible values range from 0 to 255.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function internally sets the brightness capability ICAP_BRIGHTNESS, the highlight capability ICAP_HIGHLIGHT, and the contrast capability ICAP_CONTRAST. For more information on these capabilities, refer to http://www.twain.org/ and click on TWAIN Specification (Version 1.9).

To get the current brightness, highlight, and contrast capability values, call the LTwain::GetImageEffects 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::SetImageUnit, LTwain::GetImageUnit, LTwain::SetImageBitsPerPixel, LTwain::GetImageBitsPerPixel, 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__SetImageEffectsExample(LTwain * plTwain) 
{ 
   L_INT    nRet = SUCCESS; 
   TW_FIX32 Brightness; 
   nRet = plTwain->GetImageEffects (TWAIN_NEGOTIATE_BRIGHTNESS, &Brightness, NULL, NULL); 
   if (nRet == SUCCESS) 
   { 
      if (Brightness.Whole != 100) 
      { 
         Brightness.Whole = 100; 
         nRet = plTwain->SetImageEffects(TWAIN_NEGOTIATE_BRIGHTNESS, &Brightness, NULL, NULL); 
         if(nRet != SUCCESS) 
            return nRet; 
      } 
   } 
   else 
      return nRet; 
   L_INT nPaperType, nPaperDirection; 
   nRet = plTwain->GetAcquirePageOptions (&nPaperType, &nPaperDirection); 
   if (nRet == SUCCESS) 
   { 
      if (nPaperDirection != TWOR_LANDSCAPE) 
      { 
         nRet = plTwain->SetAcquirePageOptions (TWSS_A4, TWOR_LANDSCAPE); 
         if(nRet != SUCCESS) 
            return nRet; 
      } 
   } 
   else 
      return nRet; 
   return SUCCESS; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS TWAIN C++ Class Library Help