使用XAML/C#在都会风格的应用程序中将画布另存为图像 [英] saving canvas as image in metro style app with XAML/C#

查看:165
本文介绍了使用XAML/C#在都会风格的应用程序中将画布另存为图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在使用XAML/C#开发Metro风格的类似于Paint的应用程序.我想将在画布上绘制的所有内容保存为图像.我已经检查了此解决方案,但并没有帮助我.

将画布保存到位图 [ WPF/XAML:将窗口或画布另存为PNG位图 [

Hi, I am developing a paint like application in metro style with XAML/C# . I want to save whatever content is drawn on canvas as image. I have checked this solutions but it didn''t helped me.

Save canvas to bitmap[^]

WPF/XAML: Saving a Window or Canvas as a PNG Bitmap[^]

So how can I save the canvas content as image in win 8 metro app? Please help me with sample coding.

推荐答案


您可以使用画布的msToBlob属性:
http://msdn.microsoft.com/en-us/library/windows/apps/hh465734.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/windows/apps/hh465735.aspx [ ^ ]

比您可以将该博客转换为流并将其保存.
Hi,
You can use the msToBlob property of the canvas:
http://msdn.microsoft.com/en-us/library/windows/apps/hh465734.aspx[^]
http://msdn.microsoft.com/en-us/library/windows/apps/hh465735.aspx[^]

Than you can convert that blog to a stream and save it.
Link[^]


感谢Jαved,但我想要XAML/C#的解决方案画布元素不适用于HTML5/JS画布.
Thanks Jαved, but I want the solution for XAML/C# canvas element not for HTML5/JS canvas.


这篇关于使用XAML/C#在都会风格的应用程序中将画布另存为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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