Event if Twain state is 4 (TWAIN_SOURCE_OPEN) it is sometimes not possible to set the pixel type at the "TwainSetCurrentPixelType" function:
--> Result code: TWRC_FAILURE, Twain status: TWAIN_SOURCE_OPEN, Condition code = TWCC_BADVALUEsetPictureConfigurationParameters(brightness=0, contrast=0, pictureModus=GREYSCALE): scanning set pixel types has been failed. twainResultCode=TWRC_FAILURE, twainStatus=TWAIN_SOURCE_OPEN, twainConditionCode=TWCC_BADVALUE
Code: Select all
// Set pixel type
// Default pixel type is blackwhite
TwainPixelType pixelType = TwainPixelType.TWPT_BW;
for(int i = 0; i < _pixelTypeValues.Length; i++)
{
if((int)pictureModus == _pixelTypeValues[i])
{
pixelType = TwainHandlerUtil.setPixelType(pictureModus);
_pictureModus = pictureModus;
break;
}
}
if(!_gdTwain.TwainSetCurrentPixelType(pixelType))
{
setTwainStatus();
_logger.logWarning("setPictureConfigurationParameters(brightness={0}, contrast={1}, pictureModus={2}): scanning set pixel types has been failed. "
+ "twainResultCode={3}, twainStatus={4}, twainConditionCode={5}", brightness, contrast, pictureModus, _twainResultCode, _twainStatus, _twainConditionCode);
}
Thank you
Br, ctn