我正在尝试编写一个在 Windows 8 及更高版本上提供 Toast 通知的应用程序。
是否可以不引用本地磁盘上的图像文件,而使用数据 URI 来通过传递来显示 toast 的 XML 显示图像?到目前为止,我无法提供任何文档,而且我的项目仍处于研究阶段(因此还没有代码可以“简单”尝试)。
最佳答案
没有。 Toast(或图 block )中的图像不支持 DataUris
更新/文档/证明:
对于8
来自 https://msdn.microsoft.com/en-us/library/windows/apps/hh761494.aspx
In this set of templates, the image element is expressed using one of these protocols:
•http:// or https:// A web-based image.
•ms-appx:/// An image included in the app package.
•ms-appdata:///local/ An image saved to local storage.
•file:/// A local image. (Only supported for desktop apps.)
10
来自 https://msdn.microsoft.com/en-us/library/windows/apps/br230844.aspx
The URI of the image source, using one of these protocol handlers:
•http:// or https:// A web-based image.
•ms-appx:/// An image included in the app package.
•ms-appdata:///local/ An image saved to local storage.
•file:/// A local image. (Supported only for desktop apps. This protocol cannot be used by Windows Store apps.)
奖励,在 WP 8.X 上,您甚至无法指定图像,它只是使用应用程序图标。
关于windows-8 - 我可以将图像作为数据 URI 嵌入到 Windows 8/10 Toast 通知中吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33425233/