You can use the Color.GetBrightness method to get the brightness of any
given pixel.
Using perhaps an average brightness of an area you can choose an appropriate
cursor.
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
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
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
Quote:
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?
Thanks,
Shane |