我一直在尝试重复使用这两个答案中的代码。
Get a screenshot of a specific application 和 Capture screen of Window by handle
在这两种情况下,我都会出现奇怪的错误:
我可以很容易地通过更改来调整尺寸 Bitmap bmp = new(rc.Width, rc.Height, PixelFormat.Format32bppArgb); 到 Bitmap bmp = new(rc.Width * 3, rc.Height * 3, PixelFormat.Format32bppArgb);
Bitmap bmp = new(rc.Width, rc.Height, PixelFormat.Format32bppArgb);
Bitmap bmp = new(rc.Width * 3, rc.Height * 3, PixelFormat.Format32bppArgb);
然而,我无法让程序的主体出现。
有人知道这些有用的帖子发布后发生了什么变化吗?为什么代码只能部分工作?