Brightness/Contrast slider control to manipulate bitmaps

Hi there,
        could anyone provide me with any help regarding the manipulation of
the brightness in an image and contrast. I have seen these implemented
in other graphic programs but I am not sure how it is done!!
        Many thanks