观看影像时出现问题 [英] Problem while viewing image

查看:64
本文介绍了观看影像时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用添加新项"选项在项目中添加了一个图像文件.

现在,当我添加以下代码时.它在编译时显示图像.

I have added one image file in the project using "Add new item" option.

Now when I have added below code. it shows image at compile time.

<Image x:Name="ImageTimeLine" Source="/TimeLine.TIF"></Image>



但是@运行时它不会显示图像.

任何人有什么主意吗??????



But @ runtime it does not show an image.

Does any body have any idea???????

推荐答案

嗨 将图像添加到项目中,并将其构建操作"设置为资源".
XAML:
像这样:
Hi Add the image to project and set its "Build action" to "Resource".
XAML:
Like this:
<image x:name="ImageTimeLine" source="/TimeLine.TIF" xmlns:x="#unknown"></image>




or

<image x:name="ImageTimeLine" source="/<b>ASSEMBLY_NAME</b>;component/TimeLine.TIF" xmlns:x="#unknown"></image>




or

<image x:name="ImageTimeLine" source="pack://application:,,,/TimeLine.TIF" xmlns:x="#unknown"></image>



希望对您有所帮助.



I hope it helps.


这篇关于观看影像时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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