Image Control not displaying in Win Phone 8 Emulator

亡梦爱人 提交于 2019-12-25 02:07:43

问题


I'm familiar with C#, but this is my first Windows Phone application so I don't really know what I'm doing. I have a few images (I assume this is the picturebox equivalent from form applications?) on my designer, but when I run it in the emulator they do not show up.

Here is my code:

<Image HorizontalAlignment = "Left" Height= "14" Margin="10,42,0,0" VerticalAlignment = "Top" Width = "14" Source="/Resources/Blackbox.png" Visibility = "Visible"/>

I'm probably missing something very obvious.


回答1:


Make sure your picture's URL is correct, also make sure that the Build action of your image is "Content". If the Build Action is Resource, then you must change your URL pattern to the following format:

/HostAssemblyName;component/UrlToYourImage

Content is much more better in terms of performance compared to Resource.



来源:https://stackoverflow.com/questions/21662367/image-control-not-displaying-in-win-phone-8-emulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!