Method CaptureScreen.Image(+ 1 overload)
Overload
Creates image from a rectangle of screen pixels.
public static Bitmap Image(RECT r)
Parameters
r (RECT)
Rectangle in screen. |
Returns
Exceptions
ArgumentException
Empty rectangle. |
AuException
Failed. Probably there is not enough memory for bitmap of this size ( |
Examples
var file = folders.Temp + "notepad.png";
wnd w = wnd.find("* Notepad");
w.GetRect(out var r, true);
using(var b = CaptureScreen.Image(r)) { b.Save(file); }
run.it(file);
Overload(top)
Creates image from a rectangle of window client area pixels.
public static Bitmap Image(wnd w, RECT? r = null, CIFlags flags = CIFlags.WindowDC)
Parameters
w (wnd)
Window or control. |
r (RECT?)
Rectangle in w client area coordinates. If |
flags (CIFlags) |
Returns
Exceptions
AuWndException
Invalid w. |
ArgumentException
The rectangle is empty or does not intersect with the window's client area. |
AuException
Failed. For example there is not enough memory for bitmap of this size ( |
Remarks
If flags contains WindowDC (default) or PrintWindow:
- If the window is partially or completely transparent, captures its non-transparent view.
- If the window is DPI-scaled, captures its non-scaled view. However r must contain scaled coordinates.