DTWAIN_SetContrast

Top  Previous  Next

The DTWAIN_SetContrast function sets the current contrast value for the Source.

 

DTWAIN_BOOL DTWAIN_SetContrast (

DTWAIN_SOURCE

Source,

DTWAIN_FLOAT

Contrast );

 

Parameters

Source

An open TWAIN Source.

 

Contrast

The contrast value to set the Source.

 

Return Values

The return value is TRUE if successful.  Otherwise FALSE is returned.

 

Comments

The DTWAIN_SetContrast function sets the current contrast value for the  Source Source.  The Contrast argument denotes the contrast value of the acquired image.  The contrast can be in the range between -1000.0 and +1000.0, with 0.0 being the default value for the contrast.

 

Note that some Sources do not support a contrast setting, so the return value for DTWAIN_SetContrast will always be FALSE.  If the contrast value is out of range of the Source, DTWAIN will choose the closest contrast value that the Source regards as valid.

 

Setting the contrast value may not work for all Sources.  If the contrast value is not set after calling this function, either the Source does not support setting the contrast (which in this case, a FALSE value is returned form DTWAIN_SetContrast), or it does not actually set the contrast, but still returns a TRUE stating that the contrast was set.  The latter case is a result of an improperly implemented Twain Source, and the manufacturer of the scanner should be contacted for further details.

 

To get the current contrast value, call DTWAIN_GetContrast.

 

For languages that have difficulties with DTWAIN_FLOAT parameters, the alternate function that can be used as a replacement for DTWAIN_SetContrast is DTWAIN_SetContrastString.

 

TWAIN State Transitions

The Source must be in State 4. or higher

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize

DTWAIN Source Selection Function

 

 

See Also

Setting / Getting Contrast Level