Results 1 to 2 of 2

Thread: Contrast / Brightness in .BMP file.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    Oporto, Portugal
    Posts
    134
    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,
    Jorge Ledo
    [email protected]
    Portugal were the sun allways shine... for programmers.

  2. #2
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355
    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


    buzzwords are the language of fools

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width