Re: Hotspots in graphic



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


.



Relevant Pages

  • Re: Custom Zoom & Performance
    ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... Answer those GDI+ questions with the GDI+ FAQ ... the scaled pixel ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Printing graphics/text that span multiple pages
    ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... Answer those GDI+ questions with the GDI+ FAQ ... You need to figure out how many pages you need and then render your ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Hotspots in graphic
    ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... Answer those GDI+ questions with the GDI+ FAQ ... > What is the best way to draw that image on the screen? ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Drawing backgeound image slows down form performance
    ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... Answer those GDI+ questions with the GDI+ FAQ ... > I have a windows form application that draws the background with a color ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Problems with a Image
    ... and then exportting that image to the response stream. ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... > i have a problem when i want to draw, only, a part of an image. ...
    (microsoft.public.dotnet.framework.drawing)

Loading