Solved

VB.Net Graphics Question DrawPie

Posted on 2009-07-09
2
311 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 85

Accepted Solution

by:
Mike Tomlinson earned 500 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 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