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
 

goodarowana

New member
Joined
Aug 16, 2004
Messages
4
Programming Experience
10+
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.
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
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).
 

akki

New member
Joined
Aug 10, 2004
Messages
3
Programming Experience
1-3
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.
 

goodarowana

New member
Joined
Aug 16, 2004
Messages
4
Programming Experience
10+
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.
 

essimage

New member
Joined
May 31, 2009
Messages
2
Programming Experience
10+
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
 

Mister Zippo

Active member
Joined
Dec 27, 2009
Messages
40
Programming Experience
1-3
Dear Essimage,
good morning.
I'm really interested in the same, but I cannot open your link...can you help me??

all my best
zippo
 
Top Bottom