Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB.Net Graphics Question DrawPie

Posted on 2009-07-09
2
Medium Priority
?
335 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 24820955
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
ID: 31601962
This was very helpful thank you idle mind
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

650 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