Windows 8 Metro App - Render PNGs(Windows 8 Metro 应用程序 - 渲染 PNG)
问题描述
我需要在 Windows 8 应用程序中呈现一些自定义 PNG.
I am needing to render some custom PNGs in a Windows 8 app.
基本上,我需要通过将我的应用中制作的一些绘图放在动态磁贴的图像上来创建自定义动态磁贴,唯一的方法是将 PNG 渲染到磁盘,看这里.
Basically I need to create a custom live tile by putting some drawings made in my app on top of an image for a live tile, and the only way to do this is render a PNG to disk, see here.
我应该使用什么库来执行此操作?我的第一个想法是使用 Xaml UserControl
和 RenderTargetBitmap
,但它在 Metro 应用程序中不可用.
What library should I use to do this? My first thought was to use a Xaml UserControl
and RenderTargetBitmap
, but it is not available in a Metro app.
推荐答案
WinRT XAML Toolkit 有一些您也可以使用的 WriteableBitmap 扩展方法.您可能可以使用 WriteableBitmapLoadExtensions 进行加载和 WriteableBitmapSaveExtensions 用于保存.它具有相当有限的 blitting 功能,因为 WriteableBitmapEx 已经公开了该功能,并且无论如何编写都很简单.WriteableBitmapBlitBlockExtensions 只是一种从位图中对全宽像素块进行 blit 的方法宽度相同.
WinRT XAML Toolkit has some extension methods for WriteableBitmap that you could use too. You could probably use WriteableBitmapLoadExtensions for loading and WriteableBitmapSaveExtensions for saving. It has a fairly limited blitting capability though since that is exposed by WriteableBitmapEx already and simple to write anyway. WriteableBitmapBlitBlockExtensions is only a method to blit a full width block of pixels from bitmaps of same width.
Edit* RenderTargetBitmap
现在在 Windows 8.1 中可用.但它不支持某些元素(我认为它不渲染相机预览、媒体元素,也许还有 WebViews
).
Edit* RenderTargetBitmap
is now available in Windows 8.1. It doesn't support some elements though (I think it doesn't render camera previews, media elements and perhaps WebViews
).
这篇关于Windows 8 Metro 应用程序 - 渲染 PNG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Windows 8 Metro 应用程序 - 渲染 PNG
基础教程推荐
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- SSE 浮点算术是否可重现? 2022-01-01