use local image to display in webview for windows

2019-02-14 15:30发布

问题:

I have created hybrid app in Windows phone 8.1

One of my pages uses the webview control.

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

None of the samples work.

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

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?

I am guessing here.

Can this be done?

ADDITIONAL:

My html on aspx page on my server

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

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

回答1:

For anyone following this, this worked for me:

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