110,534
社区成员
发帖
与我相关
我的任务
分享
[quote=引用 2 楼 duanzi_peng 的回复:] 嵌入的资源 编译的时候不会编译到 Debug或者Release文件夹下。 -> 嵌入的资源 编译的时候会编译到 Debug或者Release文件夹下。
<Window x:Class="WPF3.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WPF3"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Image Source="55.png"/>
</Grid>
</Window>
[/quote]
复制到输入目录 ->如果较新则复制
生成操作 ->嵌入的资源
嵌入的资源 编译的时候不会编译到 Debug或者Release文件夹下。 -> 嵌入的资源 编译的时候会编译到 Debug或者Release文件夹下。
<Window x:Class="WPF3.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WPF3"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Image Source="55.png"/>
</Grid>
</Window>
嵌入的资源 编译的时候不会编译到 Debug或者Release文件夹下。 Resource 不会。 这些资源 在项目 你可以使用相对路径使用它们。