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
Light - 13 Jan 2006 18:24 GMT
If you create an overlay graphic wth different colors then coded to the
machine parts then that would be a possible solution. You could also
use a single hit test color and divide the imagine up into multiple
layers -- ie each part. That would be more extendable.
I'd also consider using an embedded HTML viewer and HTML or possibly
even Flash.
http://www.ghostclip.com
The Premier Help System For Developers
Light - 13 Jan 2006 19:01 GMT
If you create an overlay graphic wth different colors then coded to the
machine parts then that would be a possible solution. You could also
use a single hit test color and divide the imagine up into multiple
layers -- ie each part. That would be more extendable.
I'd also consider using an embedded HTML viewer and HTML or possibly
even Flash.
Curtis
http://www.ghostclip.com
The Premier Help System For Developers
Frank Hileman - 17 Jan 2006 21:19 GMT
I would not use flash for that. There is a product commonly used for these
types of applications. Each component would be a graphical object and they
take care of hit testing and mouse events.
http://www.vgdotnet.com
Regards,
Frank Hileman
>I have an image that I would like to put in a Windows form. Similar to
> http://www.wesolve-it.com/graphics/chassis.htm
[quoted text clipped - 16 lines]
>
> Thanks in advance
Bob Powell [MVP] - 18 Jan 2006 09:04 GMT
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

Signature
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.
>I have an image that I would like to put in a Windows form. Similar to
> http://www.wesolve-it.com/graphics/chassis.htm
[quoted text clipped - 16 lines]
>
> Thanks in advance
Bob Powell [MVP] - 18 Jan 2006 09:04 GMT
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

Signature
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.
>I have an image that I would like to put in a Windows form. Similar to
> http://www.wesolve-it.com/graphics/chassis.htm
[quoted text clipped - 16 lines]
>
> Thanks in advance