Table of Contents

Class TabbedThumbnailScreenCapture

Namespace
Microsoft.WindowsAPICodePack.Taskbar
Assembly
Microsoft.WindowsAPICodePack.Shell.dll

Helper class to capture a control or window as System.Drawing.Bitmap

public static class TabbedThumbnailScreenCapture
Inheritance
TabbedThumbnailScreenCapture
Inherited Members

Methods

GrabWindowBitmap(nint, Size)

Captures a screenshot of the specified window at the specified bitmap size.

NOTE: This method will not accurately capture controls that are hidden or obstructed (partially or completely) by another control (e.g. hidden tabs, or MDI child windows that are obstructed by other child windows/forms).
public static Bitmap GrabWindowBitmap(nint windowHandle, Size bitmapSize)

Parameters

windowHandle nint

The window handle.

bitmapSize Size

The requested bitmap size.

Returns

Bitmap

A screen capture of the window.

GrabWindowBitmap(UIElement, int, int, int, int)

Grabs a snapshot of a WPF UIElement and returns the image as Bitmap.

public static Bitmap GrabWindowBitmap(UIElement element, int dpiX, int dpiY, int width, int height)

Parameters

element UIElement

Represents the element to take the snapshot from.

dpiX int

Represents the X DPI value used to capture this snapshot.

dpiY int

Represents the Y DPI value used to capture this snapshot.

width int

The requested bitmap width.

height int

The requested bitmap height.

Returns

Bitmap

Returns the bitmap (PNG format).