increasing an decreasing brightness and contrast of an image in a picture box

akki

New member
Joined
Aug 10, 2004
Messages
3
Programming Experience
1-3
Hi all,
Is there any way to increase and decrease the contrast/brightness of an image in a picture box. Any sample code or example?

thanks
 
In a picturebox control? I don't think that this is possible. What I can suggest is that you modify the attributes of the image (e.g. GDI+) and then reload the image into the picturebox control.
 
Since you're posting in the GDI+ section, I assume you do want to use GDI+ to alter the image. Here's a link to some sample code: ColorMatrix Basics - Simple Image Color Adjustment.
Doing the brightness is pretty simple, just alter the RGB values by the same amount using the 'translate' function at the provided link. Doing the contrast will be a bit more difficult since it entails lightening the lighter pixels and darkening the darker pixels (or vice versa).
 
Thanks for the link it helped and clarified a lot and as far as my being using GDI, I couldn't think of anything else except GDI+ and was trying for some time with color matrix. Is there any other alternative ways of accomplishing this and which could be the best way to achieve this... any suggestions will be appreciated.
 
Buy a toolkit

Well, the easiest way to do this is definitely to get a toolkit - downside is $$$ and it will increase your installation package size.

I suggest either ImageMan or Pegasus Imaging - both do not require run-time licenses. I'm using both - ImageMan is much cheaper though.
 
I have some code that may help <a href="http://ess-image.com/Graphic/Image_Processing/Adjust_Brightness.aspx"> Adjust Brightness</a>
If this does not do the job let me know
 
Back
Top