Sets the brightness, highlight and contrast values to use when transferring images from the current TWAIN source.
#include "ltwrappr.h"
L_INT LTwain::SetImageEffects (ulFlags, pBrightness, pContrast, pHighlight);
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. |
Pointer to a variable that contains the brightness value to set. Possible values range from -1000 to 1000.
Pointer to a variable that contains the contrast value to set. Possible values range from -1000 to 1000.
Pointer to a variable that contains the highlight value to set. Possible values range from 0 to 255.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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.
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;
}