Exemple #1
0
 ArrayBuilder_ <wnd> _AllChildren(wnd wParent)
 {
     wParent.ThrowIfInvalid();
     return(EnumWindows2(EnumAPI.EnumChildWindows,
                         onlyVisible: 0 == (_flags & WCFlags.HiddenToo),
                         sortFirstVisible: true,
                         wParent: wParent,
                         directChild: 0 != (_flags & WCFlags.DirectChild)));
 }
Exemple #2
0
 /// <summary>
 /// Creates image from a rectangle of window client area pixels.
 /// </summary>
 /// <param name="w">Window or control.</param>
 /// <param name="r">Rectangle in <i>w</i> client area coordinates. Use <c>w.ClientRect</c> to get whole client area.</param>
 /// <param name="printWindow">Get pixels like with flag <see cref="IFFlags.PrintWindow"/>.</param>
 /// <exception cref="AuWndException">Invalid <i>w</i>.</exception>
 /// <exception cref="ArgumentException">Empty rectangle.</exception>
 /// <exception cref="AuException">Failed. For example there is not enough memory for bitmap of this size (width*height*4 bytes).</exception>
 /// <remarks>
 /// Unlike <see cref="capture(RECT)"/>, this overload gets pixels directly from window, not from screen. Like with flag <see cref="IFFlags.WindowDC"/> or <see cref="IFFlags.PrintWindow"/>. The window can be under other windows. The captured image can be different than displayed on screen.
 /// If the window is partially or completely transparent, captures its non-transparent view.
 /// If the window is DPI-scaled, captures its non-scaled view. And <i>r</i> must contain non-scaled coordinates.
 /// </remarks>
 public static Bitmap capture(wnd w, RECT r, bool printWindow = false)
 => _Capture(r, w.ThrowIfInvalid(), printWindow);
Exemple #3
0
 /// <summary>
 /// Gets pixel colors from a rectangle in window client area.
 /// </summary>
 /// <returns>2-dimensional array [row, column] containing pixel colors in 0xAARRGGBB format. Alpha 0xFF.</returns>
 /// <param name="w">Window or control.</param>
 /// <param name="r">Rectangle in <i>w</i> client area coordinates. Use <c>w.ClientRect</c> to get whole client area.</param>
 /// <param name="printWindow">Get pixels like with flag <see cref="IFFlags.PrintWindow"/>.</param>
 /// <exception cref="AuWndException">Invalid <i>w</i>.</exception>
 /// <exception cref="ArgumentException">Empty rectangle.</exception>
 /// <exception cref="AuException">Failed. Probably there is not enough memory for bitmap of this size (width*height*4 bytes).</exception>
 /// <remarks>
 /// Unlike <see cref="getPixels(RECT)"/>, this overload gets pixels directly from window, not from screen. Like with flag <see cref="IFFlags.WindowDC"/> or <see cref="IFFlags.PrintWindow"/>. The window can be under other windows. The captured image can be different than displayed on screen.
 /// If the window is partially or completely transparent, captures its non-transparent view.
 /// If the window is DPI-scaled, captures its non-scaled view. And <i>r</i> must contain non-scaled coordinates.
 /// </remarks>
 public static uint[,] getPixels(wnd w, RECT r, bool printWindow = false)
 => _Pixels(r, w.ThrowIfInvalid(), printWindow);
Exemple #4
0
 /// <summary>
 /// Creates image from a non-rectangular area of window client area pixels.
 /// </summary>
 /// <param name="w">Window or control.</param>
 /// <param name="outline">The outline (shape) of the area in w client area coordinates. If single element, captures single pixel.</param>
 /// <param name="printWindow"></param>
 /// <exception cref="AuWndException">Invalid <i>w</i>.</exception>
 /// <exception cref="ArgumentException"><i>outline</i> is null or has 0 elements.</exception>
 /// <exception cref="AuException">Failed. Probably there is not enough memory for bitmap of this size.</exception>
 /// <remarks>More info: <see cref="capture(wnd, RECT, bool)"/>.</remarks>
 public static Bitmap capture(wnd w, List <POINT> outline, bool printWindow = false)
 {
     w.ThrowIfInvalid();
     return(_Capture(outline, w, printWindow));
 }