- This topic has 0 replies, 1 voice, and was last updated 14 years, 8 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
Forums › TWAIN Classic › Normalizing ContrastBrightness settings
I am trying to give the user a normailized range (1-255) to set the brightnesscontrast of any given scanner. As alot of you are probably aware, scanners come with all different types of ranges in brightness and contrast capababilities. The goal for me is to have the user choose a normailized value and for my source to figure out based on the normailized value what to set the current scanner source to.
For example:
Scanner: Fujitsu fi-4110CU
Range Values returned:
Min Value returned by twain: -127
Max value returned by Twain: +127
Step Size returned by Twain: 1
Normalized Range given to user: 1-255
If a user chooses 150 based on the normaized range, my code needs to return that value but in the range of the scanner settings for ContrastBrightness. (It would return -2)
It gets a little bit more comlicated than the previous example when you have a wider range of values and step sizes greater than 1.
I know that the source for twain (TWAIN Sample Application Project located in the Twain Toolkit) does this normalization already. My goal is to use this functionality that Twain has without have to aquire ALL the settings for a particular scanner.
If someone has any ideas of how to approach this problem OR knows where in the source code Twain normalizes these ranges values it would be of great help!