WebView Magic Tricks: Zoom Levels


One question I've heard a few times in the MSDN Windows Store App forums is about how to resize the content of the WebView.  In my second post of the WebView Magic Tricks series, I explain how we can manipulate the content by using CSS that is fully supported by WebView and apply it without much hassle.  Source code is attached to the post for your convenience.

If you enjoyed this video, please check out all of our videos at our YouTube channel and be sure to follow us on Twitter @wsdevsol

WebViewZoom.zip

Comments (4)

  1. Javier says:

    Thank you for the tip.  I would recommend a different tactic though.  A lot of online news sites and online newspapers don't like frames and will navigate the window directly to the content to avoid any external advertising.  What I recommend is sticking the webview inside of a scrollviewer.  Then adjust the height and width of the webview inversely proportional to the zoom factor.  That way it will still completely fill the scrollviewer.  Also, align the webview to the top and left.  I've put together a sample app to show you and I'll be happy to email it to you.

  2. Matt Small says:

    Javier – I'm open to any good tricks.  Please feel free to post a link to a download on this blog.

  3. Teemu Nurminen says:

    how can I set a new src to iframe?

  4. C says:

    This zoom trick works great in Win8.1, but it does not seem to work in Win10 Universal apps. Is there a way to zoom WebView contents in Win10? Thanks!

Skip to main content