var topLeft = control.PointToScreen(new Point(0

时间:2021-12-24 07:33:42

var topLeft = control.PointToScreen(new Point(0, 0));
            var bitmap = ScreenCapture.Capture(
                (int)topLeft.X,
                (int)topLeft.Y,
                (int)control.ActualWidth,
                (int)control.ActualHeight);
            bitmap.Save(path);

设置图形巨细,,然后生存为path路径图片。