Determining image lighting - 03-15-2006 , 10:16 AM
I am drawing a selector on my image for cropping purposes. It is done in
black, however if the image is real dark this doesn't show up well.
How can I determine the darkness of an image, or areas of an image so that I
can know whether to use black or white?
Is there a better way?
Re: Determining image lighting - 03-15-2006 , 12:56 PM
You can use the Color.GetBrightness method to get the brightness of any
Using perhaps an average brightness of an area you can choose an appropriate
An alternative would be to draw a cursor around the mouse position using
drawing commands from the ControlPaint.DrawReversiblexxxx methods.
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
Find great Windows Forms articles in Windows Forms Tips and Tricks
Answer those GDI+ questions with the GDI+ FAQ
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"SStory" <nospam (AT) nospam (DOT) com> wrote
|Thread Tools||Search this Thread|