C# Class Microsoft.WindowsAPICodePack.Taskbar.TabbedThumbnailScreenCapture

Helper class to capture a control or window as System.Drawing.Bitmap
显示文件 Open project: dlech/SshAgentLib Class Usage Examples

Public Methods

Method Description
GrabWindowBitmap ( IntPtr windowHandle, System bitmapSize ) : Bitmap

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).

Private Methods

Method Description
ResizeImageWithAspect ( IntPtr originalHBitmap, int newWidth, int maxHeight, bool resizeIfWider ) : Bitmap

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

Resizes the given bitmap while maintaining the aspect ratio.

Method Details

GrabWindowBitmap() public static method

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 GrabWindowBitmap ( IntPtr windowHandle, System bitmapSize ) : Bitmap
windowHandle System.IntPtr The window handle.
bitmapSize System The requested bitmap size.
return System.Drawing.Bitmap