Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capture a form to image

Tags:

c#

.net

winforms

I have a form with controls, I need capture this form to image. Please help me. Thanks.

like image 454
Leo Vo Avatar asked Feb 20 '26 06:02

Leo Vo


1 Answers

//Control cntrl; previously declared and populated
            Bitmap bmp = new Bitmap(cntrl.Width,cntrl.Height);
            cntrl.DrawToBitmap(bmp, new Rectangle(Point.Empty, bmp.Size));
like image 52
Djole Avatar answered Feb 22 '26 20:02

Djole



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!