Solved

VB.Net Graphics Question DrawPie

Posted on 2009-07-09
2
305 Views
Last Modified: 2013-11-07
Hi using the graphics objects I managed to a draw a pie segment on the screen.

I'm now stuck because when I hover over the pie segment I need to display some text. Any ideas?

I have tried many things, I even tried to get the pixel color at a mouse point so that I could compare that colour with the colour I painted the segment with. But at the moment I battling to even get the colour from a pixel.
0
Comment
Question by:dfincham28
2 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
Comment Utility
Build a GraphicsPath() instance for each slice of the pie and build it up using the coordinates and associated drawing methods.  Then when the mouse moves over the pie you iterate over the GraphicsPath (store them in a List) and see if one contains the current position with the IsVisible() method.  If a match is found then display your tooltip or message in some control.

See: http://msdn.microsoft.com/en-us/library/system.drawing.drawing2d.graphicspath.aspx
0
 

Author Closing Comment

by:dfincham28
Comment Utility
This was very helpful thank you idle mind
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now