Re: Hotspots in graphic
- From: "Bob Powell [MVP]" <bob@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 18 Jan 2006 10:04:07 +0100
I've done this in the past using a bitmap upon which I placed blocks of a
specific colour for each link. You can get the mouse position from an image
displayed in a PictureBox and see what the colour is in the link-image using
GetPixel. Using a simple table you can determine which colour corresponds to
which link
--
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.
"Nigel Stratton" <Nigel Stratton@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:101A58E7-425B-48A6-A324-A598AD185F95@xxxxxxxxxxxxxxxx
>I have an image that I would like to put in a Windows form. Similar to
> http://www.wesolve-it.com/graphics/chassis.htm
>
> The user should be able to click a part of the chassis and get custom
> information about that part.
>
> Two questions.
> What is the best way to draw that image on the screen?
> What is the best way to test for a hit on a certain part?
>
> Do I use an image and create some kind of hot spot? Do I use the GDI to
> draw
> the lines that represent that image? I want to create a business object
> "Chassis" and I wanted to have that object communicate with the
> presentation
> layer. Maybe to draw itself or at least respond to a request for
> information
> about a certain part.
>
> Thanks in advance
.
- Prev by Date: RE: DataGridView ScrollBars
- Next by Date: Re: Hotspots in graphic
- Previous by thread: Re: Hotspots in graphic
- Next by thread: Re: Hotspots in graphic
- Index(es):
Relevant Pages
|
Loading