I am searching a solution on how to save the content of a form in a bitmap with C#. I have already tried to use DrawToBitmap, but it captures all the window with the border.
That is the result of this code:
public static Bitmap TakeDialogScreenshot(Form window)
{
var b = new Bitmap(window.Bounds.X, window.Bounds.Y);
window.DrawToBitmap(b, window.Bounds);
return b;
}
Call is:
TakeDialogScreenshot(this);
Who thought it :D
I have already searched on google, but I did not manage to get it. Thanks!
See Question&Answers more detail:os