我已经制作了一个测试 WindowForm
应用程序,它通过窗口的边界获取窗口的快照。但我似乎不能给 GetBounds() 它所需要的。他想要图形,但它已经包含边界,我只想要他的点和大小:
private void CaptureBtn_Click(object sender, EventArgs e)
{
Region region = GetRegionByHWnd(GetForegroundWindow());
Rectangle rectangle = new Rectangle(
region.GetBounds().Location,
region.GetBounds().Size);
CaptureImage(rectangle.Location, Point.Empty, rectangle.Size);
}
以前有没有人遇到过这个问题,或者知道如何解决?
最佳答案
For getBound some windows for you can use ClientRectangle property , This property returns bound form and this dll (ScreenCaptureLib.dll) helps you for getImage in the desktop.
http://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=19415
关于c# - 使用 System.Drawing.Region,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6313196/