Here’s the first (and still the best!) VB-based example that demonstrates how to correctly adjust an image’s contrast. I use DIB sections to maximize speed; it’s also worth mentioning that to perfectly determine contrast, you would have to first find the average brightness of the image – I use the shortcut method and assume that the average is 127 (close enough for our purposes).
Many people have used this code in various open-source VB projects, but rest assured: this is the original, most complete, most correct copy.
DISCLAIMER: These download files are regularly scanned to ensure they remain free from malicious content. Unfortunately, some virus scanners will flag these .zip files as suspicious simply because they contain source code and/or executable files. I have submitted my projects to a number of companies in an attempt to rectify these false-positives. Some have been cooperative. Others have not. If your virus scanner alerts you regarding these files, please allow the file to be submitted for further analysis (if your program allows for that). This should help ensure that any false-positive warnings gradually disappear for all users.
This site - and its many free downloads - are 100% funded by donations. Please consider a small contribution to fund server costs and to help me support my family. Even $1.00 helps. Thank you!