Get a image of a control even when a control is not visible.
I'm looking for a way to get the the image of a control even when it is not visible in screen (for example, when the form is minimized, or the control is under another control).
This clasical way to capture screen image is not good :
Graphics g1 = myControl.CreateGraphics();
Image myImage = new Bitmap(myControl.Width, myControl.Height, g1);
Graphics g2 = Graphics.FromImage(myImage);
IntPtr dc1 = g1.GetHdc();
IntPtr dc2 = g2.GetHdc();
BitBlt(dc2, 0, 0, myControl.Width, myControl.Height, dc1, 0, 0, 13369376);
g1.ReleaseHdc(dc1);
g2.ReleaseHdc(dc2);
myImage.Save("c:\\Captured.jpg", ImageFormat.Jpeg);
Any idea??
Thanks
Daniel