【发布时间】:2021-02-10 21:12:50
【问题描述】:
我使用 C# 中的 Graphics 类编写了一个截取屏幕截图的代码。代码-
Bitmap bitmapScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Width, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
Graphics graphicsScreenshot = Graphics.FromImage(bitmapScreenshot);
graphicsScreenshot.CopyFromScreen(0, 0, 0, 0, Screen.PrimaryScreen.Bounds.Size);
虽然我找不到对任何打开的应用程序/窗口执行相同操作的方法,但有没有办法使用 Graphics 类来执行此操作,如果不在 Graphics 类中,我该怎么做?任何帮助表示赞赏。
【问题讨论】:
标签: c# graphics bitmap window screenshot