【发布时间】:2021-12-01 03:58:17
【问题描述】:
我正在尝试使用 svg 在 uwp 应用程序上显示插图。我正在使用 svg 创建 BitmapImage 对象,如下所示
m_imageSource = Windows::UI::Xaml::Media::Imaging::BitmapImage(Windows::Foundation::Uri{ GetFilePath() + L"FamilyValueProp\\Assets\\Images\\family_promo.svg"});
并将此来源设置为 Image 组件
<Image x:Name="PromoImage" Source="{x:Bind ViewModel.ImageSource, Mode=OneWay}" />
但这不会渲染图像。图像存在于提供给 BitmapImage 对象的路径中。不知道出了什么问题。有什么帮助吗?
【问题讨论】:
-
@shawan Kendrot 的答案应该有效,您可以检查一下。
标签: xaml uwp winrt-xaml uwp-xaml