ARKBreedingStats.Win32Stuff.PrintWindow C# (CSharp) Method

PrintWindow() public static method

public static PrintWindow ( IntPtr hwnd ) : Bitmap
hwnd IntPtr
return Bitmap
        public static Bitmap PrintWindow(IntPtr hwnd)
        {
            Rect rc;
            GetWindowRect(hwnd, out rc);

            Bitmap bmp = new Bitmap(rc.Width, rc.Height, PixelFormat.Format32bppArgb);
            Graphics gfxBmp = Graphics.FromImage(bmp);

            IntPtr hdcBitmap = gfxBmp.GetHdc();
            //PrintWindow(hwnd, hdcBitmap, 0);
            gfxBmp.ReleaseHdc(hdcBitmap);

            gfxBmp.CopyFromScreen(rc.left, rc.top, 0, 0, new Size(rc.Width, rc.Height), CopyPixelOperation.SourceCopy);

            gfxBmp.Dispose();

            return bmp;
        }

Same methods

Win32Stuff::PrintWindow ( IntPtr hWnd, IntPtr hdcBlt, int nFlags ) : bool