1

我创建了一个 Resourcedictionary,在其中将 ImageBrush 定义为 jpg 图片。我在我的 Path 对象上使用这个 ImageBrush 来填充它。但是,当我构建时,我收到错误错误:错误 HRESULT E_FAIL 已从对 COM 组件的调用中返回。

<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