Feedback

Screenshot eines Controls oder einer Form

Sprache: C#

Screenshot eines Controls oder einer Form
public static void ControlToImage(Control control, string path)
{
    Bitmap bitmap = new Bitmap(control.Width, control.Height);
    control.DrawToBitmap(bitmap, new System.Drawing.Rectangle(new Point(0, 0), control.Size));
    bitmap.Save(path, System.Drawing.Imaging.ImageFormat.Jpeg);
}
public static void ControlToImage(Control control, string path)
{
    Bitmap bitmap = new Bitmap(control.Width, control.Height);
    control.DrawToBitmap(bitmap, new System.Drawing.Rectangle(new Point(0, 0), control.Size));
    bitmap.Save(path, System.Drawing.Imaging.ImageFormat.Jpeg);
}