mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Screenshot only taken from ConnectionTab area
Screenshots contained dockstrip area (the tab name with the x icon), now they are only limited to the ConnectionTab area
This commit is contained in:
@@ -84,16 +84,15 @@ namespace mRemoteNG.Tools
|
||||
}
|
||||
|
||||
|
||||
public static Image TakeScreenshot(ConnectionWindow sender)
|
||||
public static Image TakeScreenshot(UI.Tabs.ConnectionTab sender)
|
||||
{
|
||||
try
|
||||
{
|
||||
var ac = sender.ActiveControl;
|
||||
if (ac != null)
|
||||
{
|
||||
if (sender != null)
|
||||
{
|
||||
var bmp = new Bitmap(ac.Width, ac.Height, PixelFormat.Format32bppRgb);
|
||||
var bmp = new Bitmap(sender.Width, sender.Height, PixelFormat.Format32bppRgb);
|
||||
Graphics g = Graphics.FromImage(bmp);
|
||||
g.CopyFromScreen(ac.PointToScreen(Point.Empty), Point.Empty , bmp.Size, CopyPixelOperation.SourceCopy);
|
||||
g.CopyFromScreen(sender.PointToScreen(Point.Empty), Point.Empty , bmp.Size, CopyPixelOperation.SourceCopy);
|
||||
return bmp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -723,7 +723,9 @@ namespace mRemoteNG.UI.Window
|
||||
{
|
||||
cmenTab.Close();
|
||||
Application.DoEvents();
|
||||
Windows.ScreenshotForm.AddScreenshot(MiscTools.TakeScreenshot(this));
|
||||
var selectedTab = (ConnectionTab)GetInterfaceControl()?.Parent;
|
||||
if (selectedTab == null) return;
|
||||
Windows.ScreenshotForm.AddScreenshot(MiscTools.TakeScreenshot(selectedTab));
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user