Windows 8的应用程序新城 - 渲染PNG图片 [英] Windows 8 Metro App - Render PNGs

查看:121
本文介绍了Windows 8的应用程序新城 - 渲染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中用户控件 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工具包有WriteableBitmap的,你可以使用一些过于扩展方法。你也许可以使用 WriteableBitmapLoadExtensions 装载和的 WriteableBitmapSaveExtensions 保存。它有一个相当有限的Blitting能力虽然因为这是暴露 WriteableBitmapEx 已经和简单的这么写。 WriteableBitmapBlitBlockExtensions 仅仅是块复制从位图像素的全宽块的方法的宽度相同。

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.

编辑* RenderTargetBitmap 现在是在Windows 8.1可用。它不支持某些元素,但(我认为这不会使相机预览,媒体元素也许网​​页视图)。

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的应用程序新城 - 渲染PNG图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆