public static Bitmap ScreenRectangle(Rectangle rect, bool includeCursor) { if (!rect.IsEmpty && rect.Width != 0 && rect.Height != 0) { Bitmap image = SCapture.GetImage(rect); if (includeCursor) { SCapture.DrawCursor(rect, image); } return(image); } throw new SCaptureException("Empty rectangle."); }
private static Bitmap GetImage(Rectangle rect) { IntPtr dc = SCapture.GetDC(); return(SCapture.GetImage(dc, rect)); }