【问题标题】:C# ContentControl to Bitmap [duplicate]C# ContentControl 到位图 [重复]
【发布时间】:2016-12-01 18:45:25
【问题描述】:

我正在创建一个c# WPF 应用程序。该应用程序的一部分涉及用户在屏幕上移动项目。为此,每个项目都有自己的ContentControl,而且效果非常好。

不过,我现在需要将这些内容控制器的内容输出到bitmap

我正在通过

创建位图
Bitmap = new Bitmap(width, height)

但是如何添加内容控制输出呢?

【问题讨论】:

标签: c# wpf


【解决方案1】:

您可以使用 capturescreen 将当前窗口转换为图像:

ScreenCapture sc = new ScreenCapture();
// capture entire screen, and save it to a file
Image img = sc.CaptureScreen();
Bitmap = new Bitmap(img)

【讨论】:

    猜你喜欢
    • 2015-10-06
    • 1970-01-01
    • 2019-06-07
    • 1970-01-01
    • 1970-01-01
    • 2012-09-30
    • 1970-01-01
    • 1970-01-01
    • 2010-09-08
    相关资源
    最近更新 更多