mirror of
https://github.com/greenshot/greenshot
synced 2025-08-23 06:36:20 -07:00
Updated Dapplo.Windows and Dapplo.CaliburnMicro, this commit fixes the breaking changes.
This commit is contained in:
parent
44b3611c13
commit
a9b3a221ab
54 changed files with 203 additions and 207 deletions
|
@ -44,12 +44,12 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
<PackageReference Include="Fody" Version="3.3.2">
|
<PackageReference Include="Fody" Version="3.3.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
|
|
|
@ -51,11 +51,11 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
<PackageReference Include="Dapplo.Confluence" Version="0.8.16" />
|
<PackageReference Include="Dapplo.Confluence" Version="0.8.16" />
|
||||||
<PackageReference Include="Fody" Version="3.3.2">
|
<PackageReference Include="Fody" Version="3.3.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
|
|
@ -46,12 +46,12 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
<PackageReference Include="Fody" Version="3.3.2">
|
<PackageReference Include="Fody" Version="3.3.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
|
|
|
@ -38,9 +38,9 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
<PackageReference Include="CliWrap" Version="2.1.0" />
|
<PackageReference Include="CliWrap" Version="2.1.0" />
|
||||||
<PackageReference Include="Fody" Version="3.3.2">
|
<PackageReference Include="Fody" Version="3.3.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
|
|
@ -46,10 +46,10 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
<PackageReference Include="Fody" Version="3.3.2">
|
<PackageReference Include="Fody" Version="3.3.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
|
|
|
@ -46,10 +46,10 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
<PackageReference Include="Fody" Version="3.3.2">
|
<PackageReference Include="Fody" Version="3.3.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
|
|
|
@ -46,11 +46,11 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
<PackageReference Include="Fody" Version="3.3.2">
|
<PackageReference Include="Fody" Version="3.3.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
|
|
|
@ -62,8 +62,7 @@ namespace Greenshot.Addon.InternetExplorer
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
int num;
|
var res = GetAccessibleChildren(accessible, out _);
|
||||||
var res = GetAccessibleChildren(accessible, out num);
|
|
||||||
if (res == null)
|
if (res == null)
|
||||||
{
|
{
|
||||||
return new Accessible[0];
|
return new Accessible[0];
|
||||||
|
@ -72,24 +71,18 @@ namespace Greenshot.Addon.InternetExplorer
|
||||||
var list = new List<Accessible>(res.Length);
|
var list = new List<Accessible>(res.Length);
|
||||||
foreach (var obj in res)
|
foreach (var obj in res)
|
||||||
{
|
{
|
||||||
if (obj is IAccessible accessible)
|
if (obj is IAccessible localAccessible)
|
||||||
{
|
{
|
||||||
list.Add(new Accessible(accessible));
|
list.Add(new Accessible(localAccessible));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list.ToArray();
|
return list.ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private string Name
|
private string Name => accessible.get_accName(CHILDID_SELF);
|
||||||
{
|
|
||||||
get { return accessible.get_accName(CHILDID_SELF); }
|
|
||||||
}
|
|
||||||
|
|
||||||
private int ChildCount
|
private int ChildCount => accessible.accChildCount;
|
||||||
{
|
|
||||||
get { return accessible.accChildCount; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the URL for the active tab
|
/// Returns the URL for the active tab
|
||||||
|
@ -106,12 +99,18 @@ namespace Greenshot.Addon.InternetExplorer
|
||||||
{
|
{
|
||||||
var tabIndex = tab.accessible.get_accState(CHILDID_SELF);
|
var tabIndex = tab.accessible.get_accState(CHILDID_SELF);
|
||||||
|
|
||||||
if ((int) tabIndex == IE_ACTIVE_TAB)
|
if ((int) tabIndex != IE_ACTIVE_TAB)
|
||||||
{
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
var description = tab.accessible.get_accDescription(CHILDID_SELF);
|
var description = tab.accessible.get_accDescription(CHILDID_SELF);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(description))
|
if (string.IsNullOrEmpty(description))
|
||||||
{
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (description.Contains(Environment.NewLine))
|
if (description.Contains(Environment.NewLine))
|
||||||
{
|
{
|
||||||
var url = description.Substring(description.IndexOf(Environment.NewLine)).Trim();
|
var url = description.Substring(description.IndexOf(Environment.NewLine)).Trim();
|
||||||
|
@ -120,8 +119,6 @@ namespace Greenshot.Addon.InternetExplorer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -225,10 +222,16 @@ namespace Greenshot.Addon.InternetExplorer
|
||||||
{
|
{
|
||||||
var tabIndex = tab.accessible.get_accState(CHILDID_SELF);
|
var tabIndex = tab.accessible.get_accState(CHILDID_SELF);
|
||||||
var description = tab.accessible.get_accDescription(CHILDID_SELF);
|
var description = tab.accessible.get_accDescription(CHILDID_SELF);
|
||||||
if (!string.IsNullOrEmpty(description))
|
if (string.IsNullOrEmpty(description))
|
||||||
{
|
{
|
||||||
if (description.Contains(Environment.NewLine))
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!description.Contains(Environment.NewLine))
|
||||||
{
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
var url = description.Substring(description.IndexOf(Environment.NewLine)).Trim();
|
var url = description.Substring(description.IndexOf(Environment.NewLine)).Trim();
|
||||||
yield return url;
|
yield return url;
|
||||||
}
|
}
|
||||||
|
@ -236,8 +239,6 @@ namespace Greenshot.Addon.InternetExplorer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Count the tabs
|
/// Count the tabs
|
||||||
|
@ -272,15 +273,17 @@ namespace Greenshot.Addon.InternetExplorer
|
||||||
{
|
{
|
||||||
foreach (var tab in child.Children)
|
foreach (var tab in child.Children)
|
||||||
{
|
{
|
||||||
if (tab.Name == tabCaptionToActivate)
|
if (tab.Name != tabCaptionToActivate)
|
||||||
{
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
tab.Activate();
|
tab.Activate();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Close the specified tabs
|
/// Close the specified tabs
|
||||||
|
@ -294,8 +297,11 @@ namespace Greenshot.Addon.InternetExplorer
|
||||||
{
|
{
|
||||||
foreach (var tab in child.Children)
|
foreach (var tab in child.Children)
|
||||||
{
|
{
|
||||||
if (tab.Name == tabCaptionToClose)
|
if (tab.Name != tabCaptionToClose)
|
||||||
{
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var CloseTab in tab.Children)
|
foreach (var CloseTab in tab.Children)
|
||||||
{
|
{
|
||||||
CloseTab.Activate();
|
CloseTab.Activate();
|
||||||
|
@ -305,7 +311,6 @@ namespace Greenshot.Addon.InternetExplorer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Active the IE tab
|
/// Active the IE tab
|
||||||
|
|
|
@ -30,10 +30,10 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Dapplo.Windows">
|
<PackageReference Include="Dapplo.Windows">
|
||||||
<Version>0.7.26</Version>
|
<Version>0.8.3</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.Windows.Com">
|
<PackageReference Include="Dapplo.Windows.Com">
|
||||||
<Version>0.7.26</Version>
|
<Version>0.8.3</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Unofficial.Microsoft.mshtml" Version="7.0.3300" />
|
<PackageReference Include="Unofficial.Microsoft.mshtml" Version="7.0.3300" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -48,12 +48,12 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.Utils" Version="1.1.9" />
|
<PackageReference Include="Dapplo.Utils" Version="1.1.9" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
<PackageReference Include="Dapplo.Jira" Version="0.8.9" />
|
<PackageReference Include="Dapplo.Jira" Version="0.8.9" />
|
||||||
<PackageReference Include="Fody" Version="3.3.2">
|
<PackageReference Include="Fody" Version="3.3.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
#region Usings
|
#region Usings
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Dapplo.Windows.Common.Structs;
|
using Dapplo.Windows.Common.Structs;
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -29,7 +28,6 @@ using System.Threading;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Dapplo.Windows.Common.Extensions;
|
using Dapplo.Windows.Common.Extensions;
|
||||||
using Dapplo.Windows.Common.Structs;
|
using Dapplo.Windows.Common.Structs;
|
||||||
using Greenshot.Addon.LegacyEditor.Forms;
|
|
||||||
using Greenshot.Addon.LegacyEditor.Memento;
|
using Greenshot.Addon.LegacyEditor.Memento;
|
||||||
using Greenshot.Addons.Core;
|
using Greenshot.Addons.Core;
|
||||||
using Greenshot.Addons.Interfaces;
|
using Greenshot.Addons.Interfaces;
|
||||||
|
|
|
@ -101,8 +101,10 @@ namespace Greenshot.Addon.LegacyEditor.Drawing
|
||||||
Add(blurFilter);
|
Add(blurFilter);
|
||||||
break;
|
break;
|
||||||
case PreparedFilter.GRAYSCALE:
|
case PreparedFilter.GRAYSCALE:
|
||||||
AbstractFilter f = new GrayscaleFilter(this);
|
AbstractFilter f = new GrayscaleFilter(this)
|
||||||
f.Invert = true;
|
{
|
||||||
|
Invert = true
|
||||||
|
};
|
||||||
Add(f);
|
Add(f);
|
||||||
break;
|
break;
|
||||||
case PreparedFilter.MAGNIFICATION:
|
case PreparedFilter.MAGNIFICATION:
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
using System.Drawing.Text;
|
using System.Drawing.Text;
|
||||||
|
|
|
@ -123,7 +123,7 @@ namespace Greenshot.Addon.LegacyEditor.Forms
|
||||||
// Make sure the editor is placed on the same location as the last editor was on close
|
// Make sure the editor is placed on the same location as the last editor was on close
|
||||||
// But only if this still exists, else it will be reset (BUG-1812)
|
// But only if this still exists, else it will be reset (BUG-1812)
|
||||||
var editorWindowPlacement = _editorConfiguration.GetEditorPlacement();
|
var editorWindowPlacement = _editorConfiguration.GetEditorPlacement();
|
||||||
var screenbounds = WindowCapture.GetScreenBounds();
|
var screenbounds = DisplayInfo.ScreenBounds;
|
||||||
if (!screenbounds.Contains(editorWindowPlacement.NormalPosition))
|
if (!screenbounds.Contains(editorWindowPlacement.NormalPosition))
|
||||||
{
|
{
|
||||||
_editorConfiguration.ResetEditorPlacement();
|
_editorConfiguration.ResetEditorPlacement();
|
||||||
|
|
|
@ -133,11 +133,11 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="CommonServiceLocator" Version="2.0.4" />
|
<PackageReference Include="CommonServiceLocator" Version="2.0.4" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
<PackageReference Include="Dapplo.Windows.Icons" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Icons" Version="0.8.3" />
|
||||||
<PackageReference Include="Fody" Version="3.3.2">
|
<PackageReference Include="Fody" Version="3.3.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
|
|
|
@ -46,11 +46,11 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
<PackageReference Include="MahApps.Metro" Version="2.0.0-alpha0121" />
|
<PackageReference Include="MahApps.Metro" Version="2.0.0-alpha0121" />
|
||||||
<PackageReference Include="Fody" Version="3.3.2">
|
<PackageReference Include="Fody" Version="3.3.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
|
|
@ -38,9 +38,9 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
<PackageReference Include="Fody" Version="3.3.2">
|
<PackageReference Include="Fody" Version="3.3.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Greenshot.Addon.OcrCommand.Modi;
|
using Greenshot.Addon.OcrCommand.Modi;
|
||||||
|
|
||||||
|
|
|
@ -45,9 +45,9 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
<PackageReference Include="Interop.Microsoft.Office.Interop.OneNote" Version="1.1.0" />
|
<PackageReference Include="Interop.Microsoft.Office.Interop.OneNote" Version="1.1.0" />
|
||||||
<PackageReference Include="Microsoft.Office.Interop.Excel" Version="15.0.4795.1000" />
|
<PackageReference Include="Microsoft.Office.Interop.Excel" Version="15.0.4795.1000" />
|
||||||
<PackageReference Include="Microsoft.Office.Interop.Outlook" Version="15.0.4797.1003" />
|
<PackageReference Include="Microsoft.Office.Interop.Outlook" Version="15.0.4797.1003" />
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using Dapplo.Log;
|
using Dapplo.Log;
|
||||||
using Dapplo.Windows.Com;
|
using Dapplo.Windows.Com;
|
||||||
using Dapplo.Windows.Desktop;
|
using Dapplo.Windows.Desktop;
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using Dapplo.Log;
|
using Dapplo.Log;
|
||||||
using Dapplo.Windows.Com;
|
using Dapplo.Windows.Com;
|
||||||
using Greenshot.Addon.Office.Configuration;
|
using Greenshot.Addon.Office.Configuration;
|
||||||
|
|
|
@ -46,11 +46,11 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
<PackageReference Include="MahApps.Metro" Version="2.0.0-alpha0121" />
|
<PackageReference Include="MahApps.Metro" Version="2.0.0-alpha0121" />
|
||||||
<PackageReference Include="Fody" Version="3.3.2">
|
<PackageReference Include="Fody" Version="3.3.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
|
|
@ -46,10 +46,10 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
<PackageReference Include="Fody" Version="3.3.2">
|
<PackageReference Include="Fody" Version="3.3.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
|
|
|
@ -46,11 +46,11 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
<PackageReference Include="MahApps.Metro" Version="2.0.0-alpha0121" />
|
<PackageReference Include="MahApps.Metro" Version="2.0.0-alpha0121" />
|
||||||
<PackageReference Include="Fody" Version="3.3.2">
|
<PackageReference Include="Fody" Version="3.3.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
|
|
@ -28,7 +28,6 @@ using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Dapplo.HttpExtensions;
|
using Dapplo.HttpExtensions;
|
||||||
using Dapplo.HttpExtensions.ContentConverter;
|
|
||||||
using Dapplo.HttpExtensions.Factory;
|
using Dapplo.HttpExtensions.Factory;
|
||||||
using Dapplo.HttpExtensions.JsonNet;
|
using Dapplo.HttpExtensions.JsonNet;
|
||||||
using Greenshot.Addon.Tfs.Entities;
|
using Greenshot.Addon.Tfs.Entities;
|
||||||
|
|
|
@ -57,8 +57,8 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -27,7 +27,6 @@ using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Greenshot.Addons.Core;
|
|
||||||
using Greenshot.Addons.Resources;
|
using Greenshot.Addons.Resources;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -37,7 +37,6 @@ using Dapplo.Utils;
|
||||||
using Dapplo.Windows.Desktop;
|
using Dapplo.Windows.Desktop;
|
||||||
using Dapplo.Windows.Dpi;
|
using Dapplo.Windows.Dpi;
|
||||||
using Dapplo.Windows.Dpi.Forms;
|
using Dapplo.Windows.Dpi.Forms;
|
||||||
using Greenshot.Addons.Core;
|
|
||||||
using Greenshot.Addons.Resources;
|
using Greenshot.Addons.Resources;
|
||||||
using Greenshot.Gfx;
|
using Greenshot.Gfx;
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,6 @@ using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Dapplo.Log;
|
using Dapplo.Log;
|
||||||
using Greenshot.Addons.Core;
|
|
||||||
using Greenshot.Addons.Resources;
|
using Greenshot.Addons.Resources;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -53,6 +53,9 @@ namespace Greenshot.Addons.Controls
|
||||||
|
|
||||||
private IntPtr _thumbnailHandle = IntPtr.Zero;
|
private IntPtr _thumbnailHandle = IntPtr.Zero;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor for the Thumbnail form
|
||||||
|
/// </summary>
|
||||||
public ThumbnailForm()
|
public ThumbnailForm()
|
||||||
{
|
{
|
||||||
ShowInTaskbar = false;
|
ShowInTaskbar = false;
|
||||||
|
@ -139,9 +142,13 @@ namespace Greenshot.Addons.Controls
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Aligns the thumbnail form to the specified control
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="alignTo"></param>
|
||||||
public void AlignToControl(Control alignTo)
|
public void AlignToControl(Control alignTo)
|
||||||
{
|
{
|
||||||
var screenBounds = WindowCapture.GetScreenBounds();
|
var screenBounds = DisplayInfo.ScreenBounds;
|
||||||
if (screenBounds.Contains(alignTo.Left, alignTo.Top - Height))
|
if (screenBounds.Contains(alignTo.Left, alignTo.Top - Height))
|
||||||
{
|
{
|
||||||
Location = new Point(alignTo.Left + alignTo.Width / 2 - Width / 2, alignTo.Top - Height);
|
Location = new Point(alignTo.Left + alignTo.Width / 2 - Width / 2, alignTo.Top - Height);
|
||||||
|
|
|
@ -37,6 +37,7 @@ using Dapplo.Windows.Common.Structs;
|
||||||
using Dapplo.Windows.Dpi;
|
using Dapplo.Windows.Dpi;
|
||||||
using Dapplo.Windows.Dpi.Forms;
|
using Dapplo.Windows.Dpi.Forms;
|
||||||
using Dapplo.Windows.Extensions;
|
using Dapplo.Windows.Extensions;
|
||||||
|
using Dapplo.Windows.User32;
|
||||||
using Greenshot.Addons.Components;
|
using Greenshot.Addons.Components;
|
||||||
using Greenshot.Addons.Extensions;
|
using Greenshot.Addons.Extensions;
|
||||||
using Greenshot.Addons.Interfaces;
|
using Greenshot.Addons.Interfaces;
|
||||||
|
@ -422,7 +423,7 @@ namespace Greenshot.Addons.Core
|
||||||
{
|
{
|
||||||
// find a suitable location
|
// find a suitable location
|
||||||
var location = Cursor.Position;
|
var location = Cursor.Position;
|
||||||
var menuRectangle = new NativeRect(location, menu.Size).Intersect(WindowCapture.GetScreenBounds());
|
var menuRectangle = new NativeRect(location, menu.Size).Intersect(DisplayInfo.ScreenBounds);
|
||||||
if (menuRectangle.Height < menu.Height)
|
if (menuRectangle.Height < menu.Height)
|
||||||
{
|
{
|
||||||
location.Offset(-40, -(menuRectangle.Height - menu.Height));
|
location.Offset(-40, -(menuRectangle.Height - menu.Height));
|
||||||
|
|
|
@ -29,6 +29,7 @@ using System.Drawing.Imaging;
|
||||||
using Dapplo.Log;
|
using Dapplo.Log;
|
||||||
using Dapplo.Windows.Common.Extensions;
|
using Dapplo.Windows.Common.Extensions;
|
||||||
using Dapplo.Windows.Common.Structs;
|
using Dapplo.Windows.Common.Structs;
|
||||||
|
using Dapplo.Windows.User32;
|
||||||
using Greenshot.Addons.Interfaces;
|
using Greenshot.Addons.Interfaces;
|
||||||
using Greenshot.Gfx;
|
using Greenshot.Gfx;
|
||||||
|
|
||||||
|
@ -59,7 +60,7 @@ namespace Greenshot.Addons.Core
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Capture()
|
public Capture()
|
||||||
{
|
{
|
||||||
_screenBounds = WindowCapture.GetScreenBounds();
|
_screenBounds = DisplayInfo.ScreenBounds;
|
||||||
_captureDetails = new CaptureDetails();
|
_captureDetails = new CaptureDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +83,7 @@ namespace Greenshot.Addons.Core
|
||||||
{
|
{
|
||||||
if (_screenBounds == NativeRect.Empty)
|
if (_screenBounds == NativeRect.Empty)
|
||||||
{
|
{
|
||||||
_screenBounds = WindowCapture.GetScreenBounds();
|
_screenBounds = DisplayInfo.ScreenBounds;
|
||||||
}
|
}
|
||||||
return _screenBounds;
|
return _screenBounds;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Drawing;
|
|
||||||
using Dapplo.CaliburnMicro.Configuration;
|
using Dapplo.CaliburnMicro.Configuration;
|
||||||
using Dapplo.Config.Attributes;
|
using Dapplo.Config.Attributes;
|
||||||
using Dapplo.Config.Ini;
|
using Dapplo.Config.Ini;
|
||||||
|
|
|
@ -59,34 +59,6 @@ namespace Greenshot.Addons.Core
|
||||||
// TODO: Solve, was static reference!
|
// TODO: Solve, was static reference!
|
||||||
private static readonly ICoreConfiguration Configuration = new CoreConfigurationImpl();
|
private static readonly ICoreConfiguration Configuration = new CoreConfigurationImpl();
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Used to cleanup the unmanged resource in the iconInfo for the CaptureCursor method
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="hObject"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[DllImport("gdi32", SetLastError = true)]
|
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
|
||||||
private static extern bool DeleteObject(IntPtr hObject);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the bounds of all screens combined.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>A NativeRect of the bounds of the entire display area.</returns>
|
|
||||||
public static NativeRect GetScreenBounds()
|
|
||||||
{
|
|
||||||
int left = 0, top = 0, bottom = 0, right = 0;
|
|
||||||
foreach (var screen in Screen.AllScreens)
|
|
||||||
{
|
|
||||||
left = Math.Min(left, screen.Bounds.X);
|
|
||||||
top = Math.Min(top, screen.Bounds.Y);
|
|
||||||
var screenAbsRight = screen.Bounds.X + screen.Bounds.Width;
|
|
||||||
var screenAbsBottom = screen.Bounds.Y + screen.Bounds.Height;
|
|
||||||
right = Math.Max(right, screenAbsRight);
|
|
||||||
bottom = Math.Max(bottom, screenAbsBottom);
|
|
||||||
}
|
|
||||||
return new NativeRect(left, top, right, bottom);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves the cursor location safely, accounting for DPI settings in Vista/Windows 7. This implementation
|
/// Retrieves the cursor location safely, accounting for DPI settings in Vista/Windows 7. This implementation
|
||||||
/// can conveniently be used when the cursor location is needed to deal with a fullscreen bitmap.
|
/// can conveniently be used when the cursor location is needed to deal with a fullscreen bitmap.
|
||||||
|
@ -102,14 +74,14 @@ namespace Greenshot.Addons.Core
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts locationRelativeToScreenOrigin to be relative to top left corner of all screen bounds, which might
|
/// Converts locationRelativeToScreenOrigin to be relative to top left corner of all screen bounds, which might
|
||||||
/// be different in multiscreen setups. This implementation
|
/// be different in multi screen setups. This implementation
|
||||||
/// can conveniently be used when the cursor location is needed to deal with a fullscreen bitmap.
|
/// can conveniently be used when the cursor location is needed to deal with a fullscreen bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="locationRelativeToScreenOrigin">NativePoint</param>
|
/// <param name="locationRelativeToScreenOrigin">NativePoint</param>
|
||||||
/// <returns>NativePoint</returns>
|
/// <returns>NativePoint</returns>
|
||||||
public static NativePoint GetLocationRelativeToScreenBounds(NativePoint locationRelativeToScreenOrigin)
|
public static NativePoint GetLocationRelativeToScreenBounds(NativePoint locationRelativeToScreenOrigin)
|
||||||
{
|
{
|
||||||
var bounds = GetScreenBounds();
|
var bounds = DisplayInfo.ScreenBounds;
|
||||||
return locationRelativeToScreenOrigin.Offset(-bounds.X, -bounds.Y);
|
return locationRelativeToScreenOrigin.Offset(-bounds.X, -bounds.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +116,7 @@ namespace Greenshot.Addons.Core
|
||||||
using (iconInfo.ColorBitmapHandle)
|
using (iconInfo.ColorBitmapHandle)
|
||||||
{
|
{
|
||||||
var cursorLocation = User32Api.GetCursorLocation();
|
var cursorLocation = User32Api.GetCursorLocation();
|
||||||
// Allign cursor location to Bitmap coordinates (instead of Screen coordinates)
|
// Align cursor location to Bitmap coordinates (instead of Screen coordinates)
|
||||||
var x = cursorLocation.X - iconInfo.Hotspot.X - capture.ScreenBounds.X;
|
var x = cursorLocation.X - iconInfo.Hotspot.X - capture.ScreenBounds.X;
|
||||||
var y = cursorLocation.Y - iconInfo.Hotspot.Y - capture.ScreenBounds.Y;
|
var y = cursorLocation.Y - iconInfo.Hotspot.Y - capture.ScreenBounds.Y;
|
||||||
// Set the location
|
// Set the location
|
||||||
|
@ -160,10 +132,10 @@ namespace Greenshot.Addons.Core
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This method will call the CaptureRectangle with the screenbounds, therefor Capturing the whole screen.
|
/// This method will call the CaptureRectangle with the screen bounds, therefor Capturing the whole screen.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>A Capture Object with the Screen as an Image</returns>
|
/// <returns>A Capture Object with the Screen as an Image</returns>
|
||||||
public static ICapture CaptureScreen(ICapture capture)
|
public static ICapture CaptureScreen(ICapture capture = null)
|
||||||
{
|
{
|
||||||
if (capture == null)
|
if (capture == null)
|
||||||
{
|
{
|
||||||
|
@ -350,7 +322,7 @@ namespace Greenshot.Addons.Core
|
||||||
// throw exception
|
// throw exception
|
||||||
throw exceptionToThrow;
|
throw exceptionToThrow;
|
||||||
}
|
}
|
||||||
// Create BITMAPINFOHEADER for CreateDIBSection
|
// Create BitmapInfoHeader for CreateDIBSection
|
||||||
var bmi = BitmapInfoHeader.Create(captureBounds.Width, captureBounds.Height, 24);
|
var bmi = BitmapInfoHeader.Create(captureBounds.Width, captureBounds.Height, 24);
|
||||||
|
|
||||||
// TODO: Enable when the function is available again
|
// TODO: Enable when the function is available again
|
||||||
|
@ -358,9 +330,8 @@ namespace Greenshot.Addons.Core
|
||||||
Win32.SetLastError(0);
|
Win32.SetLastError(0);
|
||||||
|
|
||||||
// create a bitmap we can copy it to, using GetDeviceCaps to get the width/height
|
// create a bitmap we can copy it to, using GetDeviceCaps to get the width/height
|
||||||
IntPtr bits0; // not used for our purposes. It returns a pointer to the raw bits that make up the bitmap.
|
// the returned (out) IntPtr _ is not used for our purposes. It returns a pointer to the raw bits that make up the bitmap.
|
||||||
// TODO: Change the usage to an enum?
|
using (var safeDibSectionHandle = Gdi32Api.CreateDIBSection(desktopDcHandle, ref bmi, DibColors.PalColors, out _, IntPtr.Zero, 0))
|
||||||
using (var safeDibSectionHandle = Gdi32Api.CreateDIBSection(desktopDcHandle, ref bmi, 0, out bits0, IntPtr.Zero, 0))
|
|
||||||
{
|
{
|
||||||
if (safeDibSectionHandle.IsInvalid)
|
if (safeDibSectionHandle.IsInvalid)
|
||||||
{
|
{
|
||||||
|
@ -375,7 +346,7 @@ namespace Greenshot.Addons.Core
|
||||||
// select the bitmap object and store the old handle
|
// select the bitmap object and store the old handle
|
||||||
using (safeCompatibleDcHandle.SelectObject(safeDibSectionHandle))
|
using (safeCompatibleDcHandle.SelectObject(safeDibSectionHandle))
|
||||||
{
|
{
|
||||||
// bitblt over (make copy)
|
// bit-blt over (make copy)
|
||||||
// ReSharper disable once BitwiseOperatorOnEnumWithoutFlags
|
// ReSharper disable once BitwiseOperatorOnEnumWithoutFlags
|
||||||
Gdi32Api.BitBlt(safeCompatibleDcHandle, 0, 0, captureBounds.Width, captureBounds.Height, desktopDcHandle, captureBounds.X, captureBounds.Y,
|
Gdi32Api.BitBlt(safeCompatibleDcHandle, 0, 0, captureBounds.Width, captureBounds.Height, desktopDcHandle, captureBounds.X, captureBounds.Y,
|
||||||
RasterOperations.SourceCopy | RasterOperations.CaptureBlt);
|
RasterOperations.SourceCopy | RasterOperations.CaptureBlt);
|
||||||
|
@ -427,7 +398,7 @@ namespace Greenshot.Addons.Core
|
||||||
// For all screens copy the content to the new bitmap
|
// For all screens copy the content to the new bitmap
|
||||||
foreach (var screen in Screen.AllScreens)
|
foreach (var screen in Screen.AllScreens)
|
||||||
{
|
{
|
||||||
// Make sure the bounds are offsetted to the capture bounds
|
// Make sure the bounds are with an offset to the capture bounds
|
||||||
var screenBounds = screen.Bounds;
|
var screenBounds = screen.Bounds;
|
||||||
screenBounds.Offset(-captureBounds.X, -captureBounds.Y);
|
screenBounds.Offset(-captureBounds.X, -captureBounds.Y);
|
||||||
graphics.DrawImage(tmpBitmap, screenBounds, screenBounds.X, screenBounds.Y, screenBounds.Width, screenBounds.Height, GraphicsUnit.Pixel);
|
graphics.DrawImage(tmpBitmap, screenBounds, screenBounds.X, screenBounds.Y, screenBounds.Width, screenBounds.Height, GraphicsUnit.Pixel);
|
||||||
|
|
|
@ -44,13 +44,13 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration">
|
||||||
<Version>1.2.7</Version>
|
<Version>1.2.10</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Toasts">
|
<PackageReference Include="Dapplo.CaliburnMicro.Toasts">
|
||||||
<Version>1.2.7</Version>
|
<Version>1.2.10</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
|
||||||
<Version>1.2.7</Version>
|
<Version>1.2.10</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.HttpExtensions">
|
<PackageReference Include="Dapplo.HttpExtensions">
|
||||||
<Version>0.9.18</Version>
|
<Version>0.9.18</Version>
|
||||||
|
@ -62,10 +62,10 @@
|
||||||
<Version>0.9.18</Version>
|
<Version>0.9.18</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard">
|
<PackageReference Include="Dapplo.Windows.Clipboard">
|
||||||
<Version>0.7.26</Version>
|
<Version>0.8.3</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Dapplo.Windows.Icons">
|
<PackageReference Include="Dapplo.Windows.Icons">
|
||||||
<Version>0.7.26</Version>
|
<Version>0.8.3</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Fody" Version="3.3.2">
|
<PackageReference Include="Fody" Version="3.3.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
|
|
@ -40,7 +40,6 @@ using Dapplo.Windows.DesktopWindowsManager;
|
||||||
using Dapplo.Windows.DesktopWindowsManager.Structs;
|
using Dapplo.Windows.DesktopWindowsManager.Structs;
|
||||||
using Dapplo.Windows.Gdi32;
|
using Dapplo.Windows.Gdi32;
|
||||||
using Dapplo.Windows.User32;
|
using Dapplo.Windows.User32;
|
||||||
using Dapplo.Windows.User32.Structs;
|
|
||||||
using Greenshot.Core.Configuration;
|
using Greenshot.Core.Configuration;
|
||||||
using Greenshot.Core.Enums;
|
using Greenshot.Core.Enums;
|
||||||
using Greenshot.Core.Interfaces;
|
using Greenshot.Core.Interfaces;
|
||||||
|
@ -178,7 +177,7 @@ namespace Greenshot.Core.Extensions
|
||||||
using (var workingArea = new Region())
|
using (var workingArea = new Region())
|
||||||
{
|
{
|
||||||
// Find the screen where the window is and check if it fits
|
// Find the screen where the window is and check if it fits
|
||||||
foreach (var displayInfo in User32Api.AllDisplays())
|
foreach (var displayInfo in DisplayInfo.AllDisplayInfos)
|
||||||
{
|
{
|
||||||
workingArea.Union(displayInfo.WorkingArea);
|
workingArea.Union(displayInfo.WorkingArea);
|
||||||
}
|
}
|
||||||
|
@ -187,7 +186,7 @@ namespace Greenshot.Core.Extensions
|
||||||
if (!workingArea.AreRectangleCornersVisisble(windowRectangle))
|
if (!workingArea.AreRectangleCornersVisisble(windowRectangle))
|
||||||
{
|
{
|
||||||
// If none found we find the biggest screen
|
// If none found we find the biggest screen
|
||||||
foreach (var displayInfo in User32Api.AllDisplays())
|
foreach (var displayInfo in DisplayInfo.AllDisplayInfos)
|
||||||
{
|
{
|
||||||
var newWindowRectangle = new NativeRect(displayInfo.WorkingArea.Location, windowRectangle.Size);
|
var newWindowRectangle = new NativeRect(displayInfo.WorkingArea.Location, windowRectangle.Size);
|
||||||
if (!workingArea.AreRectangleCornersVisisble(newWindowRectangle))
|
if (!workingArea.AreRectangleCornersVisisble(newWindowRectangle))
|
||||||
|
@ -261,7 +260,7 @@ namespace Greenshot.Core.Extensions
|
||||||
tempFormShown = true;
|
tempFormShown = true;
|
||||||
|
|
||||||
// Intersect with screen
|
// Intersect with screen
|
||||||
captureRectangle = captureRectangle.Intersect(DisplayInfo.GetAllScreenBounds());
|
captureRectangle = captureRectangle.Intersect(DisplayInfo.ScreenBounds);
|
||||||
|
|
||||||
// Check if we make a transparent capture
|
// Check if we make a transparent capture
|
||||||
if (captureConfiguration.WindowCaptureMode == WindowCaptureModes.AeroTransparent)
|
if (captureConfiguration.WindowCaptureMode == WindowCaptureModes.AeroTransparent)
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Dapplo.Windows.Icons">
|
<PackageReference Include="Dapplo.Windows.Icons">
|
||||||
<Version>0.7.26</Version>
|
<Version>0.8.3</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,6 @@ using Dapplo.Windows.Gdi32.Enums;
|
||||||
using Dapplo.Windows.Gdi32.SafeHandles;
|
using Dapplo.Windows.Gdi32.SafeHandles;
|
||||||
using Dapplo.Windows.Gdi32.Structs;
|
using Dapplo.Windows.Gdi32.Structs;
|
||||||
using Dapplo.Windows.User32;
|
using Dapplo.Windows.User32;
|
||||||
using Dapplo.Windows.User32.Structs;
|
|
||||||
using Greenshot.Core.Enums;
|
using Greenshot.Core.Enums;
|
||||||
using Greenshot.Core.Interfaces;
|
using Greenshot.Core.Interfaces;
|
||||||
using Greenshot.Gfx.Extensions;
|
using Greenshot.Gfx.Extensions;
|
||||||
|
@ -52,7 +51,7 @@ namespace Greenshot.Core.Sources
|
||||||
{
|
{
|
||||||
public ValueTask<ICaptureElement<BitmapSource>> Import(CancellationToken cancellationToken = default)
|
public ValueTask<ICaptureElement<BitmapSource>> Import(CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
var screenbounds = DisplayInfo.GetAllScreenBounds();
|
var screenbounds = DisplayInfo.ScreenBounds;
|
||||||
var result = CaptureRectangle(screenbounds);
|
var result = CaptureRectangle(screenbounds);
|
||||||
return new ValueTask<ICaptureElement<BitmapSource>>(result);
|
return new ValueTask<ICaptureElement<BitmapSource>>(result);
|
||||||
}
|
}
|
||||||
|
@ -145,7 +144,7 @@ namespace Greenshot.Core.Sources
|
||||||
|
|
||||||
// Collect all screens inside this capture
|
// Collect all screens inside this capture
|
||||||
var displaysInsideCapture = new List<DisplayInfo>();
|
var displaysInsideCapture = new List<DisplayInfo>();
|
||||||
foreach (var displayInfo in User32Api.AllDisplays())
|
foreach (var displayInfo in DisplayInfo.AllDisplayInfos)
|
||||||
{
|
{
|
||||||
if (displayInfo.Bounds.IntersectsWith(captureBounds))
|
if (displayInfo.Bounds.IntersectsWith(captureBounds))
|
||||||
{
|
{
|
||||||
|
@ -171,7 +170,7 @@ namespace Greenshot.Core.Sources
|
||||||
if (offscreenContent)
|
if (offscreenContent)
|
||||||
{
|
{
|
||||||
var modifiedImage = new WriteableBitmap(capturedBitmapSource.PixelWidth, capturedBitmapSource.PixelHeight, capturedBitmapSource.DpiX, capturedBitmapSource.DpiY, PixelFormats.Bgr32, capturedBitmapSource.Palette);
|
var modifiedImage = new WriteableBitmap(capturedBitmapSource.PixelWidth, capturedBitmapSource.PixelHeight, capturedBitmapSource.DpiX, capturedBitmapSource.DpiY, PixelFormats.Bgr32, capturedBitmapSource.Palette);
|
||||||
foreach (var displayInfo in User32Api.AllDisplays())
|
foreach (var displayInfo in DisplayInfo.AllDisplayInfos)
|
||||||
{
|
{
|
||||||
modifiedImage.CopyPixels(capturedBitmapSource, displayInfo.Bounds);
|
modifiedImage.CopyPixels(capturedBitmapSource, displayInfo.Bounds);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations">
|
||||||
<Version>1.2.7</Version>
|
<Version>1.2.10</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Svg">
|
<PackageReference Include="Svg">
|
||||||
<Version>2.3.0</Version>
|
<Version>2.3.0</Version>
|
||||||
|
|
29
src/Greenshot.PerformanceTests/CapturePerformance.cs
Normal file
29
src/Greenshot.PerformanceTests/CapturePerformance.cs
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
using System;
|
||||||
|
using BenchmarkDotNet.Attributes;
|
||||||
|
using Greenshot.Addons.Core;
|
||||||
|
|
||||||
|
namespace Greenshot.PerformanceTests
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This defines the benchmarks which can be done
|
||||||
|
/// </summary>
|
||||||
|
[MinColumn, MaxColumn, MemoryDiagnoser]
|
||||||
|
public class CapturePerformance
|
||||||
|
{
|
||||||
|
[Benchmark]
|
||||||
|
public void Capture()
|
||||||
|
{
|
||||||
|
using (var capture = WindowCapture.CaptureScreen())
|
||||||
|
{
|
||||||
|
if (capture.Bitmap == null)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
if (capture.Bitmap.Width <= 0 || capture.Bitmap.Height <= 0)
|
||||||
|
{
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,7 +16,8 @@ namespace Greenshot.PerformanceTests
|
||||||
{
|
{
|
||||||
var job = Job.Default.With(Platform.X64);
|
var job = Job.Default.With(Platform.X64);
|
||||||
var config = DefaultConfig.Instance.With(job).KeepBenchmarkFiles(true);
|
var config = DefaultConfig.Instance.With(job).KeepBenchmarkFiles(true);
|
||||||
BenchmarkRunner.Run<GfxPerformanceShort>(config);
|
//BenchmarkRunner.Run<GfxPerformanceShort>(config);
|
||||||
|
BenchmarkRunner.Run<CapturePerformance>(config);
|
||||||
Console.ReadLine();
|
Console.ReadLine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="BenchmarkDotNet" Version="0.11.3" />
|
<PackageReference Include="BenchmarkDotNet" Version="0.11.3" />
|
||||||
<PackageReference Include="CommandLineParser" Version="2.3.0" />
|
<PackageReference Include="CommandLineParser" Version="2.3.0" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.Log.XUnit" Version="1.3.11" />
|
<PackageReference Include="Dapplo.Log.XUnit" Version="1.3.11" />
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="2.6.2">
|
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="2.6.2">
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using Dapplo.CaliburnMicro.Metro;
|
|
||||||
using Dapplo.CaliburnMicro.Metro.Configuration;
|
using Dapplo.CaliburnMicro.Metro.Configuration;
|
||||||
using Dapplo.Config.Ini;
|
using Dapplo.Config.Ini;
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using Dapplo.CaliburnMicro.Metro;
|
using Dapplo.CaliburnMicro.Metro.Configuration;
|
||||||
using Dapplo.Config.Ini;
|
using Dapplo.Config.Ini;
|
||||||
|
|
||||||
namespace Greenshot.Configuration.Impl
|
namespace Greenshot.Configuration.Impl
|
||||||
|
|
|
@ -39,7 +39,6 @@ using Dapplo.Windows.Common.Extensions;
|
||||||
using Dapplo.Windows.Common.Structs;
|
using Dapplo.Windows.Common.Structs;
|
||||||
using Dapplo.Windows.User32;
|
using Dapplo.Windows.User32;
|
||||||
using Dapplo.Windows.User32.Enums;
|
using Dapplo.Windows.User32.Enums;
|
||||||
using Dapplo.Windows.User32.Structs;
|
|
||||||
using Greenshot.Addons.Animation;
|
using Greenshot.Addons.Animation;
|
||||||
using Greenshot.Addons.Controls;
|
using Greenshot.Addons.Controls;
|
||||||
using Greenshot.Addons.Core;
|
using Greenshot.Addons.Core;
|
||||||
|
@ -639,7 +638,7 @@ namespace Greenshot.Forms
|
||||||
}
|
}
|
||||||
else if (UsedCaptureMode != CaptureMode.Window)
|
else if (UsedCaptureMode != CaptureMode.Window)
|
||||||
{
|
{
|
||||||
var allScreenBounds = WindowCapture.GetScreenBounds();
|
var allScreenBounds = DisplayInfo.ScreenBounds;
|
||||||
|
|
||||||
allScreenBounds = allScreenBounds.MoveTo(WindowCapture.GetLocationRelativeToScreenBounds(allScreenBounds.Location));
|
allScreenBounds = allScreenBounds.MoveTo(WindowCapture.GetLocationRelativeToScreenBounds(allScreenBounds.Location));
|
||||||
if (verticalMove)
|
if (verticalMove)
|
||||||
|
|
|
@ -24,11 +24,9 @@
|
||||||
#region Usings
|
#region Usings
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Dapplo.Log;
|
using Dapplo.Log;
|
||||||
using Greenshot.Addons.Core;
|
|
||||||
using Greenshot.Addons.Resources;
|
using Greenshot.Addons.Resources;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -60,7 +60,7 @@ using Greenshot.Ui.Configuration.ViewModels;
|
||||||
using Message = System.Windows.Forms.Message;
|
using Message = System.Windows.Forms.Message;
|
||||||
using Screen = System.Windows.Forms.Screen;
|
using Screen = System.Windows.Forms.Screen;
|
||||||
using Dapplo.Config.Ini;
|
using Dapplo.Config.Ini;
|
||||||
using Dapplo.Addons;
|
using Dapplo.Windows.User32;
|
||||||
using Greenshot.Addons.Resources;
|
using Greenshot.Addons.Resources;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -457,7 +457,7 @@ namespace Greenshot.Forms
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CaptureIE()
|
private void CaptureIe()
|
||||||
{
|
{
|
||||||
if (_coreConfiguration.IECapture)
|
if (_coreConfiguration.IECapture)
|
||||||
{
|
{
|
||||||
|
@ -597,28 +597,28 @@ namespace Greenshot.Forms
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var allScreensBounds = WindowCapture.GetScreenBounds();
|
var allScreensBounds = DisplayInfo.ScreenBounds;
|
||||||
|
|
||||||
var captureScreenItem = new ToolStripMenuItem(_greenshotLanguage.ContextmenuCapturefullscreenAll);
|
var captureScreenItem = new ToolStripMenuItem(_greenshotLanguage.ContextmenuCapturefullscreenAll);
|
||||||
captureScreenItem.Click += (o, args) => BeginInvoke((MethodInvoker) (() => CaptureHelper.CaptureFullscreen(false, ScreenCaptureMode.FullScreen)));
|
captureScreenItem.Click += (o, args) => BeginInvoke((MethodInvoker) (() => CaptureHelper.CaptureFullscreen(false, ScreenCaptureMode.FullScreen)));
|
||||||
captureScreenMenuItem.DropDownItems.Add(captureScreenItem);
|
captureScreenMenuItem.DropDownItems.Add(captureScreenItem);
|
||||||
foreach (var screen in Screen.AllScreens)
|
foreach (var displayInfo in DisplayInfo.AllDisplayInfos)
|
||||||
{
|
{
|
||||||
var screenToCapture = screen;
|
var screenToCapture = displayInfo;
|
||||||
var deviceAlignment = "";
|
var deviceAlignment = "";
|
||||||
if (screen.Bounds.Top == allScreensBounds.Top && screen.Bounds.Bottom != allScreensBounds.Bottom)
|
if (displayInfo.Bounds.Top == allScreensBounds.Top && displayInfo.Bounds.Bottom != allScreensBounds.Bottom)
|
||||||
{
|
{
|
||||||
deviceAlignment += " " + _greenshotLanguage.ContextmenuCapturefullscreenTop;
|
deviceAlignment += " " + _greenshotLanguage.ContextmenuCapturefullscreenTop;
|
||||||
}
|
}
|
||||||
else if (screen.Bounds.Top != allScreensBounds.Top && screen.Bounds.Bottom == allScreensBounds.Bottom)
|
else if (displayInfo.Bounds.Top != allScreensBounds.Top && displayInfo.Bounds.Bottom == allScreensBounds.Bottom)
|
||||||
{
|
{
|
||||||
deviceAlignment += " " + _greenshotLanguage.ContextmenuCapturefullscreenBottom;
|
deviceAlignment += " " + _greenshotLanguage.ContextmenuCapturefullscreenBottom;
|
||||||
}
|
}
|
||||||
if (screen.Bounds.Left == allScreensBounds.Left && screen.Bounds.Right != allScreensBounds.Right)
|
if (displayInfo.Bounds.Left == allScreensBounds.Left && displayInfo.Bounds.Right != allScreensBounds.Right)
|
||||||
{
|
{
|
||||||
deviceAlignment += " " + _greenshotLanguage.ContextmenuCapturefullscreenLeft;
|
deviceAlignment += " " + _greenshotLanguage.ContextmenuCapturefullscreenLeft;
|
||||||
}
|
}
|
||||||
else if (screen.Bounds.Left != allScreensBounds.Left && screen.Bounds.Right == allScreensBounds.Right)
|
else if (displayInfo.Bounds.Left != allScreensBounds.Left && displayInfo.Bounds.Right == allScreensBounds.Right)
|
||||||
{
|
{
|
||||||
deviceAlignment += " " + _greenshotLanguage.ContextmenuCapturefullscreenRight;
|
deviceAlignment += " " + _greenshotLanguage.ContextmenuCapturefullscreenRight;
|
||||||
}
|
}
|
||||||
|
@ -765,7 +765,7 @@ namespace Greenshot.Forms
|
||||||
|
|
||||||
private void Contextmenu_captureie_Click(object sender, EventArgs e)
|
private void Contextmenu_captureie_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
CaptureIE();
|
CaptureIe();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Contextmenu_captureiefromlist_Click(object sender, EventArgs e)
|
private void Contextmenu_captureiefromlist_Click(object sender, EventArgs e)
|
||||||
|
|
|
@ -79,18 +79,18 @@
|
||||||
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
<PackageReference Include="AutoProperties.Fody" Version="1.19.0" />
|
||||||
<PackageReference Include="CommandLineParser" Version="2.3.0" />
|
<PackageReference Include="CommandLineParser" Version="2.3.0" />
|
||||||
<PackageReference Include="CommonServiceLocator" Version="2.0.4" />
|
<PackageReference Include="CommonServiceLocator" Version="2.0.4" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Dapp" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Dapp" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Configuration" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Metro" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Metro" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Toasts" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Toasts" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.7" />
|
<PackageReference Include="Dapplo.CaliburnMicro.Translations" Version="1.2.10" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
<PackageReference Include="Dapplo.HttpExtensions.OAuth" Version="0.9.18" />
|
||||||
<PackageReference Include="Dapplo.Log.LogFile" Version="1.3.11" />
|
<PackageReference Include="Dapplo.Log.LogFile" Version="1.3.11" />
|
||||||
<PackageReference Include="Dapplo.Log.Loggers" Version="1.3.11" />
|
<PackageReference Include="Dapplo.Log.Loggers" Version="1.3.11" />
|
||||||
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Clipboard" Version="0.8.3" />
|
||||||
<PackageReference Include="Dapplo.Windows.Icons" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Icons" Version="0.8.3" />
|
||||||
<PackageReference Include="Dapplo.Windows.Multimedia" Version="0.7.26" />
|
<PackageReference Include="Dapplo.Windows.Multimedia" Version="0.8.3" />
|
||||||
<PackageReference Include="Fody" Version="3.3.2">
|
<PackageReference Include="Fody" Version="3.3.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
|
|
|
@ -28,7 +28,6 @@ using System.Diagnostics;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using Dapplo.HttpExtensions;
|
using Dapplo.HttpExtensions;
|
||||||
using Dapplo.Log;
|
using Dapplo.Log;
|
||||||
using Greenshot.Addons.Core;
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -369,13 +369,15 @@ namespace Greenshot.Helpers
|
||||||
var mouseLocation = User32Api.GetCursorLocation();
|
var mouseLocation = User32Api.GetCursorLocation();
|
||||||
foreach (var screen in Screen.AllScreens)
|
foreach (var screen in Screen.AllScreens)
|
||||||
{
|
{
|
||||||
if (screen.Bounds.Contains(mouseLocation))
|
if (!screen.Bounds.Contains(mouseLocation))
|
||||||
{
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
_capture = WindowCapture.CaptureRectangle(_capture, screen.Bounds);
|
_capture = WindowCapture.CaptureRectangle(_capture, screen.Bounds);
|
||||||
captureTaken = true;
|
captureTaken = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case ScreenCaptureMode.Fixed:
|
case ScreenCaptureMode.Fixed:
|
||||||
if (CoreConfig.ScreenToCapture > 0 && CoreConfig.ScreenToCapture <= Screen.AllScreens.Length)
|
if (CoreConfig.ScreenToCapture > 0 && CoreConfig.ScreenToCapture <= Screen.AllScreens.Length)
|
||||||
|
|
|
@ -34,14 +34,11 @@ using Dapplo.Addons.Bootstrapper;
|
||||||
using Dapplo.CaliburnMicro.Dapp;
|
using Dapplo.CaliburnMicro.Dapp;
|
||||||
using Dapplo.Config.Ini.Converters;
|
using Dapplo.Config.Ini.Converters;
|
||||||
using Dapplo.Config.Language;
|
using Dapplo.Config.Language;
|
||||||
using Dapplo.Log;
|
|
||||||
using Dapplo.Log.Loggers;
|
|
||||||
using Dapplo.Utils;
|
using Dapplo.Utils;
|
||||||
using Dapplo.Windows.Common.Structs;
|
using Dapplo.Windows.Common.Structs;
|
||||||
using Dapplo.Windows.Dpi.Forms;
|
using Dapplo.Windows.Dpi.Forms;
|
||||||
using Dapplo.Windows.Kernel32;
|
using Dapplo.Windows.Kernel32;
|
||||||
using Greenshot.Addons;
|
using Greenshot.Addons;
|
||||||
using Greenshot.Addons.Core;
|
|
||||||
using Greenshot.Addons.Resources;
|
using Greenshot.Addons.Resources;
|
||||||
using Greenshot.Ui.Misc.ViewModels;
|
using Greenshot.Ui.Misc.ViewModels;
|
||||||
|
|
||||||
|
|
|
@ -26,10 +26,10 @@ using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reactive.Disposables;
|
using System.Reactive.Disposables;
|
||||||
using Caliburn.Micro;
|
|
||||||
using Dapplo.CaliburnMicro.Configuration;
|
using Dapplo.CaliburnMicro.Configuration;
|
||||||
using Dapplo.CaliburnMicro.Extensions;
|
using Dapplo.CaliburnMicro.Extensions;
|
||||||
using Dapplo.CaliburnMicro.Metro;
|
using Dapplo.CaliburnMicro.Metro;
|
||||||
|
using Dapplo.CaliburnMicro.Metro.Configuration;
|
||||||
using Dapplo.Utils.Extensions;
|
using Dapplo.Utils.Extensions;
|
||||||
using Greenshot.Addons;
|
using Greenshot.Addons;
|
||||||
using Greenshot.Addons.Core;
|
using Greenshot.Addons.Core;
|
||||||
|
|
|
@ -27,7 +27,6 @@ using System.Windows.Media;
|
||||||
using Dapplo.CaliburnMicro.Toasts.ViewModels;
|
using Dapplo.CaliburnMicro.Toasts.ViewModels;
|
||||||
using Dapplo.Log;
|
using Dapplo.Log;
|
||||||
using Greenshot.Addons;
|
using Greenshot.Addons;
|
||||||
using Greenshot.Addons.Core;
|
|
||||||
using Greenshot.Addons.Resources;
|
using Greenshot.Addons.Resources;
|
||||||
|
|
||||||
namespace Greenshot.Ui.Notifications.ViewModels
|
namespace Greenshot.Ui.Notifications.ViewModels
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue