3

次の方法で作成している wpf プロジェクトの画像リソースを追加しました。

right-click on the Project -> Properties -> Resources -> Images -> From Existing -> ClientBackGround.png

メインウィンドウの背景にしました:

<Window x:Class="Illuminate_AutoPatcher.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Width="1000" Height="750" ResizeMode="NoResize" WindowStyle="None" WindowStartupLocation="CenterScreen">
    <Window.Background>
        <ImageBrush ImageSource="pack://siteoforigin:,,,/Resources/ClientBackground.png"/>
    </Window.Background>
    <Grid>
        <Button Content="" HorizontalAlignment="Left" VerticalAlignment="Top" Width="224" Margin="766,613,0,0" Height="124" >
        </Button>
    </Grid>
</Window>

しかし、それは機能していません。この厄介なエラーをスローし続けていますSystem.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '6' and line position '10。どうすれば修正できるので、プロジェクトでビルドされた静的リソースを使用しますか?

4

1 に答える 1