WP8 - WebBrowser控件显示来自资源文件夹的图像 [英] WP8 - WebBrowser control to display images from resource folder

查看:100
本文介绍了WP8 - WebBrowser控件显示来自资源文件夹的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理 WP8 应用程序,在位置 Resources \Graphics\ 我有几张图片试图从这些文件夹中显示图像,但它没有选择路径。



这是我的代码:



< img src = \/ Resources; component / Graphics /+ ImageName).Append(\)这是我使用的字符串在我的WebBrowserControl中。


$ b WebBrowserControl.NavigateToString(html); //这里的html是一个字符串,它包含所有的html代码。 code>



但是它没有显示图片。这里的问题是如何解决这个问题的?

./文件名.ext
它不适用于我用来访问的任何资源路径结构e webview中的本地文件。


I am working on WP8application, I have few images in location Resources\Graphics\ i am trying to display images from these folder, but its not picking the path.

Here is my code :

<img src=\"/Resources;component/Graphics/"+ImageName).Append("\" ") this is in my string which i am using in my WebBrowserControl.

WebBrowserControl.NavigateToString(html); // here html is a string which has all the html code in it.

But its not display the images. What is the issue here how to fix this ?

解决方案

I faced a similar issue when I tried to open images that have been saved to local storage. I could solve this by putting an HTML file at the same location so that I could access the files with "./filename.ext". It did not work with any of the resource path constructions that I used to access the local file within the webview.

这篇关于WP8 - WebBrowser控件显示来自资源文件夹的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆