WPF: WebBrowser TO Bitmap

            var topLeftCorner = webBrowser.PointToScreen(new System.Windows.Point(0, 0)); 
            var topLeftGdiPoint = new System.Drawing.Point((int)topLeftCorner.X, (int)topLeftCorner.Y);
            var size = new System.Drawing.Size((int)webBrowser.ActualWidth, (int)webBrowser.ActualHeight);
            var screenShot = new Drawing.Bitmap((int)webBrowser.ActualWidth, (int)webBrowser.ActualHeight); 
            using (var graphics = Drawing.Graphics.FromImage(screenShot)) { graphics.CopyFromScreen(topLeftGdiPoint, new System.Drawing.Point(), size, Drawing.CopyPixelOperation.SourceCopy); } 
            screenShot.Save(@"D:\screenshot.bmp");
原文地址:https://www.cnblogs.com/ysharp/p/2009025.html