1

ImageBrush を jpg 画像に定義する Resourcedictionary を作成しました。この ImageBrush を Path オブジェクトで使用して塗りつぶします。ただし、ビルドすると、エラー エラーが発生します。 COM コンポーネントへの呼び出しからエラー HRESULT E_FAIL が返されました。

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:c="clr-namespace:System;assembly=mscorlib"
                xmlns:Model="clr-namespace:MVVMTestApp.Model;assembly=MVVMTestApp.Model"
                xmlns:View="clr-namespace:MVVMTestApp.View"
                xmlns:ViewModel="clr-namespace:MVVMTestApp.ViewModel">

<c:Double x:Key ="StrokeUserControl">
2
</c:Double>

<ImageBrush x:Key="CountryBackground" ImageSource="../Assets/gra-bakgrund.jpg" Stretch="Fill"/>

そして、このように Path オブジェクトを埋めようとしています

Fill="{StaticResource CountryBackground}"
4

0 に答える 0