Example #1
0
 public void RedrawControlAsBitmap(IntPtr hwnd)
 {
     global::System.Windows.Forms.Control c = global::System.Windows.Forms.Control.FromHandle(hwnd);
     using (Bitmap bm = new Bitmap(c.Width, c.Height))
     {
         c.DrawToBitmap(bm, c.ClientRectangle);
         using (Graphics g = c.CreateGraphics())
         {
             Point p = new Point(-1, -1);
             g.DrawImage(bm, p);
         }
     }
 }