Groups | Blog | Home
all groups > dotnet windows forms > april 2005 >

dotnet windows forms : zoom pictures


Bob Powell [MVP]
4/7/2005 12:00:00 AM
Check out the article in Windows Forms Tips and Tricks.

--
Bob Powell [MVP]
Visual C#, System.Drawing

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.





[quoted text, click to view]

harry
4/7/2005 1:21:16 PM
Hello everybody.

I want to do simple image viewer. I want to provide zoom functionality.
I have done this, by changing PictureBox control dimesions. But this
solution isn't good.
Can we put into picuterbox fragment of our picture and don't change
dimensions of the picutrebox.

May you tell me, how can i do this and where can i found informations about
this. ( simple project etc.)?

thanks
Chris

Bob Powell [MVP]
4/7/2005 2:42:40 PM
You would probably be better off ignoring PictureBox entirely and creating a
custom control that does zoomed drawing.

A simple control with an Image property and an overidden OnPaint method can
do everything that Picturebox can do anyway. Once you have control over the
drawing process you can use the Matrix class to create zooming and panning.

The simplest would be to derive from ScrollableControl and add zooming and
panning capabilities from there.

This is definitely a FAQ item so I'll put something in the Windows Forms
Tips ad Tricks pages to explain.

I suggest you subscribe to the RSS feed on that page.

--
Bob Powell [MVP]
Visual C#, System.Drawing

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.





[quoted text, click to view]

AddThis Social Bookmark Button