LTwain::SetImageEffects

Summary

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

Syntax

#include "ltwrappr.h"

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

Parameters

L_UINT32 ulFlags

Flags that indicate which value(s) to set. 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.

pTW_FIX32 pBrightness

Pointer to a variable that contains the brightness value to set. Possible values range from -1000 to 1000.

pTW_FIX32 pContrast

Pointer to a variable that contains the contrast value to set. Possible values range from -1000 to 1000.

pTW_FIX32 pHighlight

Pointer to a variable that contains the highlight value to set. Possible values range from 0 to 255.

Returns

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

To get the current brightness, highlight, and contrast capability values, call the LTwain::GetImageEffects function.

Required DLLs and Libraries

See Also

Functions

Topics

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