Solved

VB.Net Graphics Question DrawPie

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

911 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

26 Experts available now in Live!

Get 1:1 Help Now