how to zoom

  • Thread starter Thread starter Wiebe Tijsma
  • Start date Start date
I'm developing windows application using c#.net (vs 2003), i've placed
several images (picture boxes) in panel control and i want to zoom the
panel control so that the images and text which contained in the panel
control has to be zoomed and i want to work on that zoomed portion like we
work in photo shop by zooming the image.

can anybody tell me how to do this one using gdi+, or suggest me with some
articles which suies my requirement.

Regards
yoshitha
 
Hi Yoshitha,

If you are trying to zoom a collection of image controls and text-based controls all at once, you might want to try embedding a
WebBrowser control instead and use HTML to define the images and text. Doing so will allow you to use the built-in zoom
functionality in the WebBrowser and you'll have a lot more control over the layout and style.

CSS zoom style on MSDN:
http://msdn.microsoft.com/library/d...op/author/dhtml/reference/properties/zoom.asp

Here's an example that you can save to disc as an .htm file to see what zoom does. ("zoom" only works in IE. Valid image
references aren't required for the example to work):

<html>
<head></head>
<body style="zoom: 200%">
<img src="someimage.jpg" />
<span>And this is some text to go with it</span><br /><br />
<img src="anotherimg.jpg" />
<span>And yet more text.</span>
</body>
</html>


..NET 2.0

To use the html source at runtime you can save it to a file on disc and browse to it using the WebBrowser.Url property or you can
save it as an embedded resource in your assembly and stream it into the browser using the WebBrowser.DocumentStream property or
WebBrowser.DocumentText property.

WebBrowser control on MSDN:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx


..NET 1.*

Here you'll have to access the DOM directly if you want to write the html into the browser, otherwise you can just call the Navigate
method with a url to your source .htm file on disc. You need a reference to the WebBrowser control from the COM tab and a reference
to the mshtml COM library (to access the DOM), IIRC.

COM WebBrowser control on MSDN:
http://msdn.microsoft.com/library/d...r/webbrowser/reference/objects/webbrowser.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top