Screenshot method change

Some screenshots were blank because DrawToBitmap uses the tab drawing graphics, New method uses screen buffer that brings the pixels from the final screen render.
This commit is contained in:
Camilo Alvarez
2019-01-22 15:44:10 -05:00
parent 0699e895fd
commit c93deb7696

View File

@@ -1,6 +1,7 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.Globalization;
using System.IO;
using System.Security;
@@ -90,8 +91,9 @@ namespace mRemoteNG.Tools
var ac = sender.ActiveControl;
if (ac != null)
{
var bmp = new Bitmap(ac.Width, ac.Height);
ac.DrawToBitmap(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height));
var bmp = new Bitmap(ac.Width, ac.Height, PixelFormat.Format32bppRgb);
Graphics g = Graphics.FromImage(bmp);
g.CopyFromScreen(ac.PointToScreen(Point.Empty), Point.Empty , bmp.Size, CopyPixelOperation.SourceCopy);
return bmp;
}
}