Method CaptureScreen.Pixels(+ 1 overload)
Overload
Gets pixel colors from a rectangle in screen.
public static uint[,] Pixels(RECT r)
Parameters
r (RECT)
Rectangle in screen. |
Returns
uint[,]
2-dimensional array |
Exceptions
ArgumentException
Empty rectangle. |
AuException
Failed. Probably there is not enough memory for bitmap of this size ( |
Examples
print.clear();
var a = CaptureScreen.Pixels(new(100, 100, 4, 10));
for(int i = 0, nRows = a.GetLength(0); i < nRows; i++) print.it(a[i,0], a[i,1], a[i,2], a[i,3]);
Overload(top)
Gets pixel colors from a rectangle in window client area.
public static uint[,] Pixels(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
uint[,]
2-dimensional array |
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.