PDA

Click to See Complete Forum and Search --> : Contrast / Brightness in .BMP file.


JorgeLedo
Mar 30th, 2000, 09:04 PM
Does anyone know how to change Contrast / Brightness in .BMP file loaded into a picturebox ?

Or any site where I can learn it (I've searched it in VB Web Directory, VB Square, VB Api, this site and more) ?

Thanks in advance,

KENNNY
Mar 31st, 2000, 02:17 AM
dunno about the contrast, but brightness is quite easy:

just use the API GetPixel to get each pixel's colour and then convert it to RGB, then increase the RGB values by a bit, then SetPixel it back using the new values. that should work, i think :)

to convert long to RGB:

take long colour (called COLOUR below) , and:

Red = Colour Mod 256
Color = (Colour - Red) / 256
Green = Colour Mod 256
Color = (Colour - Green) / 256
Blue = Colour

hope that helps :)