I am currently trying to save a windows form as an image, and I have been able to using the following code:
Dim frm = Me
Using bmp = New Bitmap(frm.Width, frm.Height)
frm.DrawToBitmap(bmp, New Rectangle(0, 0, bmp.Width, bmp.Height))
bmp.Save("D:\programs\files\image.png")
End Using
However, the image includes the borders of the form. Is there any way to save the image without the borders?