如何将WPF控件转换为图像? [英] How can I convert a WPF control into an image?

查看:105
本文介绍了如何将WPF控件转换为图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有简单的方法将WPF视觉转换为图像?
如果是这样,代码是什么?

Is there an easy way to convert a WPF visual into an image? If so, what's the code?

推荐答案

尽管你可能想要结束功能,但这并不是特别困难。我想看看 RenderTargetBitmap MSDN页面有示例用法。

It's not terribly difficult although you will probably want to wrap up functionality. I would take a look at RenderTargetBitmap the MSDN page has example usage.

文章如何:从视觉创建位图链接在页面底部附近。

The article How to: Create a Bitmap from a Visual is linked near the bottom of the page.

这篇关于如何将WPF控件转换为图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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