如何将WPF窗口转换为位图? [英] How do I convert a WPF window to a bitmap?

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

问题描述

我想对与应用程序相关联的所有窗口进行屏幕截图,并允许用户对其进行编辑.我不确定如何将窗口转换为位图图像.

I want to take screen shots of all the windows associated with an application and allow the user to edit them. I am not sure how to convert a window to a bitmap image though.

我想做这样的事情...

I want to do something like this...

WindowCollection handles = Application.Current.Windows;
List<Image> windowList = new List<Image>();
foreach (Window window in handles)
{
do something here to turn each window into a bitmap
windowList.Add(bitmapFromWindow)
}

我找到了相关的问题,但没有任何答案可以回答我的问题.如果您找到任何相关资源,请发布.

I have found related questions, but nothing that answers my question. If you find any related resources please post.

推荐答案

您可以使用或者看看那个:

http://blogs.msdn.com/b/swick/archive/2007/12/02/rendering-ink-and-image-to-a-bitmap-using-wpf.aspx

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

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