如何将Windows Phone 8的隔离存储中的图像显示到Web浏览器控件中 [英] How can I display image from isolated storage of the Windows Phone 8 into web browser control
问题描述
如何将Windows Phone 8的隔离存储中的图像显示到Web浏览器控件中?
How can I display image from isolated storage of the Windows Phone 8 into web browser control?
推荐答案
您可以将隔离存储中的内容加载到使用带有相对于隔离存储"/"的根的Uri的Uri的Navigate方法访问webBrowser控件.
You can load content from your isolated storage into the webBrowser control using the Navigate method with a Uri relative to the root of the isolated storage "/".
例如,假设我创建一个文件夹"WebContent",在我的IsolatedStorage中保存图像文件的位置:Lighthouse.jpg.我将像这样加载此图像:
For example, say I create a folder "WebContent" in my IsolatedStorage in which I save an image file: Lighthouse.jpg. I would load this image like so:
webBrowser1.Navigate(new Uri("WebContent/Lighthouse.jpg", UriKind.Relative));
另一个选项是将WebBrowser.Base属性设置为"WebContent".然后相对于文件夹"WebContent"指定Uri,如下所示:
Another option is to set the WebBrowser.Base property to "WebContent" then specify the Uri relative to the folder "WebContent", like so:
webBrowser1.Base = "WebContent";
webBrowser1.Navigate(new Uri("Lighthouse.jpg", UriKind.Relative));
如果您要保留多个版本的内容,这将很有用.
This can be useful if you have multiple versions of the content that you want to keep separate.
这篇关于如何将Windows Phone 8的隔离存储中的图像显示到Web浏览器控件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!