UWP Tile 未显示 svg 图像

问题描述

Windows 10 开始菜单上的磁贴的以下代码显示了我使用 MS Paint 创建的“.png”图像。但是相同的代码没有显示我使用 InkScape 创建的类似 .svg 图像(在 Tile 中)。

问题:为什么相同的代码不适用于 .svg 图像而它适用于 .png 图像 - 我们如何使其适用于 .svg图像,以及?

带有 .png 文件的平铺显示的“开始”菜单快照

enter image description here

代码

public void Tiletest()
{
    // Construct the tile content
    TileContent content = new TileContent()
    {
        Visual = new TileVisual()
        {
            TileWide = new TileBinding()
            {

                Content = new TileBindingContentAdaptive()
                {
                    Children =
                    {
                        new AdaptiveGroup()
                        {
                            Children =
                            {
                                new AdaptiveSubgroup()
                                {
                                    HintWeight = 2,Children =
                                    {
                                        new AdaptiveImage()
                                        {
                                           //NOTE: if I replace Test.png with Test.svg image,it 
                                            //does not show up
                                            Source = "Images/MyImages/Test.png",HintRemoveMargin = true
                                        }
                                    }
                                }
                            }
                        },}
                }
            }
        }
    };

    TileNotification notification = new TileNotification(content.GetXml());
    TileUpdateManager.CreateTileUpdaterForApplication().Update(notification);
}

备注:这可能无关紧要,但以防万一:我使用的是调用 UWP/WinRT API 的 Packaged WPF app - 使用 VS2019 - ver 16.9 和 {{1 }} 在.NET5。 以下是我在上述代码中尝试的 Windows 10 Pro - ver 2004.png 图像。 .svg 没有出现在磁贴中:

Test.png

enter image description here

Test.Svg

.svg

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)