小编Mik*_*ike的帖子

将窗体捕获到图像中

我知道这个问题已经回答过了。但是,没有一个答案是正确的。如何捕获Windows窗体的图像并将其保存。我用这个:

Bitmap bmp = new Bitmap(this.Width, this.Height);
this.DrawToBitmap(bmp, new Rectangle(Point.Empty, bmp.Size));
bmp.Save(@"C://Desktop//sample.png",ImageFormat.Png);
Run Code Online (Sandbox Code Playgroud)

但得到错误:

GDI +中发生一般错误

我还阅读了有关此错误的信息,但没有任何建议对我有用!请帮忙

c# capture

-1
推荐指数
1
解决办法
4345
查看次数

标签 统计

c# ×1

capture ×1