all groups > dotnet windows forms > march 2005 >
You're in the

dotnet windows forms

group:

Picturebox



Re: Picturebox Bob Powell [MVP]
3/25/2005 4:19:00 PM
dotnet windows forms: To display an image that's larger than the available area put your
picturebox inside a panel with autoscroll enabled. You can scrolll it around
easily. To display an image centered you might have to dynamically position
the picturebox at runtime.

--
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]

Picturebox Some Guy
3/25/2005 11:36:10 PM
Hi there,

Can anybody give me some pointers on the best way to display an image and
allow zooming and scrolling? I have tried resizing the picturebox with
maintainaspectratio set to true but it has the weird effect of moving the
image off screen, rather than resizing it.

If the image being viewed is smaller than the form area I'd like it
centered, like a canvas in a graphics app.

A little confused.... any help appreciated...

Cheers

AddThis Social Bookmark Button