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