使用本地图像在Windows Phone 8.1的WebView中显示 [英] use local image to display in webview for windows phone 8.1

查看:101
本文介绍了使用本地图像在Windows Phone 8.1的WebView中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Windows Phone 8.1中创建了混合应用程序

I have created hybrid app in Windows phone 8.1

我的其中一个页面使用了webview控件.

One of my pages uses the webview control.

上面有一个img元素.

It has an img element on it.

作为应用程序构建的一部分,我有一幅小图像. 复制到输出目录"设置为始终复制"

I have a small image as part of the build of my application. The 'copy to Output Directory' is set to 'Copy always'

我已按照此页面上的说明进行操作:输入链接说明这里

I have followed the instructions from this page: enter link description here

所有示例均无效.

如果我可以在我的C#代码中分配该图像,那将是另一种替代选择?

If I could assign that image in my c# code then that would be another alternative to use?

我需要知道如何在解决方案中获取图像的绝对路径,然后从Webview获取ID?

I would need to know how to get the absolute path of my image in my solutions and then get the ID from the webview?

我猜在这里.

可以做到吗?

附加:

我在服务器上的aspx页面上的html

My html on aspx page on my server

<img src="/Images/eyeon.png" />

我将eyeon.png图像添加到了C#解决方案中.

I added the eyeon.png image to my C# solution.

推荐答案

对于任何遵循此规则的人来说,这对我有用:

For anyone following this, this worked for me:

src = "ms-appx-web:///Images/NoFeed.jpg"

这篇关于使用本地图像在Windows Phone 8.1的WebView中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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