Skip to content

Managing the image brightness and contrast at runtime

Animesh Mishra

Asked Sep 18, 2014, 2:43 AM EDT1 answer
Share
LinkedInX
hello,
i have 1 image and 1 button.i want ,that when i click on the button the image brightness gets 100% and when i again click the button ,the image intensity agains comes to normal.
 
2ques- i want to insert this intensity change value in database base too on that button click.please give full code if possible.thanks in advance 

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    About changing the brightness and contrast of the image, you might be able to do this by using the System.Drawing.Imaging.ImageAttributes Class. You can find more information here:
    http://msdn.microsoft.com/en-us/library/system.drawing.imaging.imageattributes

    Note that if your main purpose is to apply these effects on many file formats (including PDF, TIFF, PNG, JPEG, GIF, BMP, DICOM, etc.), you might not be able to do this by using the basic .NET classes.
    In this case, you need to use more specialized toolkit (like leadtools) that supports many file formats and many image processing functions (including Brightness, contrast and intensity). You can find more information here.

    About saving the brightness value in database, you should be able to create and store integer values in a field in your database (SQL for example) using the System.Data assembly in the .NET framework. There are plenty of examples of C# code to connect to a database. A good place to start would be with System.Data.SqlClient.SqlConnection class, which can be found in Microsoft's documentation here:
    http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection
    0