0
我有一個網頁瀏覽器。我只加載一張圖片。圖片比網頁瀏覽器大。如何將圖片大小調整爲適合網頁瀏覽器,以便用戶不再需要放大和縮小?讓內容適合windows phone 7中的瀏覽器?
我有一個網頁瀏覽器。我只加載一張圖片。圖片比網頁瀏覽器大。如何將圖片大小調整爲適合網頁瀏覽器,以便用戶不再需要放大和縮小?讓內容適合windows phone 7中的瀏覽器?
試試這個
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;」 />
您的網址是對html頁面的引用,或者只是指向.png/jpg的鏈接?爲什麼不使用本地BitmapImage控件來顯示圖片? –
其鏈接到.jpg。某些圖像無法在BitmapImage中顯示。所以我只想玩安全並使用網頁瀏覽器。 – pmark019