Last post Jul 08, 2014 07:11 AM by PatriceSc
May 31, 2011 09:48 PM|oozaru|LINK
i have a problem with take the graphitcs area, for example:
in windows form:
in form have 2 controls Panel and ImageBox, my Panel width 100px heght 100px, in panel have ImageBox of course the imagen is more big but the panel have AutoScroll = true.
for Take save the image have this fuction
public Bitmap CaptureControl(Control ctrl)
Graphics g = ctrl.CreateGraphics();
Bitmap img = new Bitmap(ctrl.ClientRectangle.Width,
Graphics memg = Graphics.FromImage(img);
IntPtr dc1 = g.GetHdc();
IntPtr dc2 = memg.GetHdc();
BitBlt(dc2, 0, 0, img.Width, img.Height, dc1, 0, 0, SRCCOPY);
this moment have the problem, i cant take only imageBox the form correct, take the panel area with image, (i cant see the imagen), have other metodo for take snapshot the control.
Jul 08, 2014 07:11 AM|PatriceSc|LINK
Have you tried
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.drawtobitmap(v=vs.110).aspx to render the control you want?
As it seems a Windows Forms question, if you need further help please try to find a suitable forum at
ASP.NET for is for web applications (and so tis forum is for C# but rather in the context of web application).