471,344 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,344 software developers and data experts.

How best can I create a panel which allows zoom on a drawing?


I would like to create a panel, or other widget, on which I can draw,
say, a triangle, and use the wheel on the mouse to zoom in and out on
the drawing. A vector drawing.

I know this can be done because I have seen apps that do this. They
were 3D and I only need 2D but they were very fast.

Is there an easy way to do this? Do I need to use the DirectX
libraries to do this?

Any pointer in the right direction would be very welcome and hopefully
save me much time.

Thanks,

Steve
Jun 27 '08 #1
5 4497
I wonder if your best approach might be to use WPF to render the area?
This natively supports scaleable vector-based graphics - you'd just need
to add the mouse hooks... Try searching for +WPF +zoom

Marc
Jun 27 '08 #2

Thanks. My original app was written using Windows Forms. Is there an
easy way to convert to WPF?

Steve

On Fri, 09 May 2008 13:05:56 +0100, Marc Gravell
<ma**********@gmail.comwrote:
>I wonder if your best approach might be to use WPF to render the area?
This natively supports scaleable vector-based graphics - you'd just need
to add the mouse hooks... Try searching for +WPF +zoom

Marc
Jun 27 '08 #3
On May 9, 6:48 am, steve <s_j_b...@yahoo.comwrote:
I would like to create a panel, or other widget, on which I can draw,
say, a triangle, and use the wheel on the mouse to zoom in and out on
the drawing. A vector drawing.

I know this can be done because I have seen apps that do this. They
were 3D and I only need 2D but they were very fast.

Is there an easy way to do this? Do I need to use the DirectX
libraries to do this?

Any pointer in the right direction would be very welcome and hopefully
save me much time.

Thanks,

Steve
Check out this site:

http://www.bobpowell.net

and this link in particular:

http://www.bobpowell.net/zoompicbox.htm

Chris
Jun 27 '08 #4
Not really, but you can embed WPF in WinForm (via ElementHost) and
WinForm in WPF (via WindowsFormsHost).

However, depending on the complexity, the zooming picturebox (that Chris
mentions) looks interesting.

Marc
Jun 27 '08 #5

thanks, I will have to play around with it a bit to see how it would
work for what I want.

Steve

On Fri, 9 May 2008 06:41:43 -0700 (PDT), Chris Dunaway
<du******@gmail.comwrote:
>On May 9, 6:48 am, steve <s_j_b...@yahoo.comwrote:
>I would like to create a panel, or other widget, on which I can draw,
say, a triangle, and use the wheel on the mouse to zoom in and out on
the drawing. A vector drawing.

I know this can be done because I have seen apps that do this. They
were 3D and I only need 2D but they were very fast.

Is there an easy way to do this? Do I need to use the DirectX
libraries to do this?

Any pointer in the right direction would be very welcome and hopefully
save me much time.

Thanks,

Steve

Check out this site:

http://www.bobpowell.net

and this link in particular:

http://www.bobpowell.net/zoompicbox.htm

Chris
Jun 27 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by JasonL | last post: by
2 posts views Thread by Mo Ade via .NET 247 | last post: by
1 post views Thread by Larry | last post: by
4 posts views Thread by Thiru .Net | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.