mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user