【发布时间】:2010-10-07 20:23:04
【问题描述】:
我有一个简单的 WPF 窗口。我打算将它的背景设置为我作为嵌入式资源添加到项目中的图像之一。这是我尝试过的:
<Window x:Class="A_Boggle.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="A-Boggle" Height="300" Width="625" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Name="Game">
<Window.Background>
<ImageBrush ImageSource="background.jpg"></ImageBrush>
</Window.Background>
<Grid>
</Grid>
但是有了这个,我总是得到这个:“错误 1 文件 splash.jpg 不是项目的一部分,或者它的“构建操作”属性未设置为“资源”。”
有什么想法吗?
【问题讨论】:
标签: wpf background