public static Bitmap CaptureWindow(IntPtr wndHandle, Point point, int width, int height) { User32.Rect windowRect; User32.GetWindowRect(wndHandle, out windowRect); var windowWidth = windowRect.right - windowRect.left; var windowHeight = windowRect.bottom - windowRect.top; var bmp = new Bitmap(windowWidth, windowHeight, PixelFormat.Format32bppArgb); using (var graphics = Graphics.FromImage(bmp)) { var hdc = graphics.GetHdc(); try { User32.PrintWindow(wndHandle, hdc, 0); } finally { graphics.ReleaseHdc(hdc); } } var cRect = new User32.Rect(); User32.GetClientRect(wndHandle, ref cRect); var cWidth = cRect.right - cRect.left; var cHeight = cRect.bottom - cRect.top; var captionHeight = windowHeight - cHeight > 0 ? SystemInformation.CaptionHeight : 0; return(bmp.Clone(new Rectangle((windowWidth - cWidth) / 2 + point.X, (windowHeight - cHeight - captionHeight) / 2 + captionHeight + point.Y, width, height), PixelFormat.Format32bppArgb)); }