2012-10-14 57 views
0

我有一个网页浏览器。我只加载一张图片。图片比网页浏览器大。如何将图片大小调整为适合网页浏览器,以便用户不再需要放大和缩小?让内容适合windows phone 7中的浏览器?

+0

您的网址是对html页面的引用,或者只是指向.png/jpg的链接?为什么不使用本地BitmapImage控件来显示图片? –

+0

其链接到.jpg。某些图像无法在BitmapImage中显示。所以我只想玩安全并使用网页浏览器。 – pmark019

回答

0

试试这个

string html = String.Format("<html><head></head><body><img style='width:100%' src='{0}'/></body></html>", "http://www.userlogos.org/files/logos/pek/stackoverflow2.png"); 

webBrowser.NavigateToString(html); 

您可以使用“风格”属性的图像添加更多的样式。

以下元标记对您来说可能也很有意思。

< meta name =“viewport”content =“width = device-width,height = device-height,initial-scale = 1.0,maximum-scale = 1.0,user-scalable = no;” />

相关问题