mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-29 17:02:05 +13:00
Removed Windows 8 check in IsBlurPossible because it works in 8.1 but need to check in 8.0
This commit is contained in:
parent
2ce83a7ba8
commit
9fb95d19b9
4 changed files with 11 additions and 16 deletions
|
@ -226,7 +226,7 @@
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Core\LOG.cs" />
|
<Compile Include="Helpers\LOG.cs" />
|
||||||
<Compile Include="UnmanagedHelpers\DWM.cs" />
|
<Compile Include="UnmanagedHelpers\DWM.cs" />
|
||||||
<Compile Include="UnmanagedHelpers\Enumerations.cs" />
|
<Compile Include="UnmanagedHelpers\Enumerations.cs" />
|
||||||
<Compile Include="UnmanagedHelpers\GDI32.cs" />
|
<Compile Include="UnmanagedHelpers\GDI32.cs" />
|
||||||
|
|
|
@ -182,18 +182,13 @@ private static IntPtr GetNativeImageAttributes(ImageAttributes imageAttributes)
|
||||||
/// Returns if a GDIPlus blur can be made for the supplied radius.
|
/// Returns if a GDIPlus blur can be made for the supplied radius.
|
||||||
/// This accounts for the "bug" I reported here: http://social.technet.microsoft.com/Forums/en/w8itprogeneral/thread/99ddbe9d-556d-475a-8bab-84e25aa13a2c
|
/// This accounts for the "bug" I reported here: http://social.technet.microsoft.com/Forums/en/w8itprogeneral/thread/99ddbe9d-556d-475a-8bab-84e25aa13a2c
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="radius"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static bool IsBlurPossible(int radius)
|
public static bool IsBlurPossible(int radius)
|
||||||
{
|
{
|
||||||
if (Environment.OSVersion.Version.Major < 6)
|
if (Environment.OSVersion.Version.Major < 6)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if ((Environment.OSVersion.Version.Major >= 6 && Environment.OSVersion.Version.Minor >= 2) && radius < 20)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -725,28 +725,28 @@ public static string HtmlEncode(string text)
|
||||||
return result.ToString();
|
return result.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Point GetPosition(PositionType positionType, int offset, Size img, Size img2, int add = 0)
|
public static Point GetPosition(PositionType positionType, int offset, Size img, Size img2)
|
||||||
{
|
{
|
||||||
switch (positionType)
|
switch (positionType)
|
||||||
{
|
{
|
||||||
case PositionType.Top_Left:
|
case PositionType.Top_Left:
|
||||||
return new Point(offset, offset);
|
return new Point(offset, offset);
|
||||||
case PositionType.Top:
|
case PositionType.Top:
|
||||||
return new Point(img.Width / 2 - img2.Width / 2 - add, offset);
|
return new Point(img.Width / 2 - img2.Width / 2, offset);
|
||||||
case PositionType.Top_Right:
|
case PositionType.Top_Right:
|
||||||
return new Point(img.Width - img2.Width - offset - add, offset);
|
return new Point(img.Width - img2.Width - offset, offset);
|
||||||
case PositionType.Left:
|
case PositionType.Left:
|
||||||
return new Point(offset, img.Height / 2 - img2.Height / 2 - add);
|
return new Point(offset, img.Height / 2 - img2.Height / 2);
|
||||||
case PositionType.Center:
|
case PositionType.Center:
|
||||||
return new Point(img.Width / 2 - img2.Width / 2 - add, img.Height / 2 - img2.Height / 2 - add);
|
return new Point(img.Width / 2 - img2.Width / 2, img.Height / 2 - img2.Height / 2);
|
||||||
case PositionType.Right:
|
case PositionType.Right:
|
||||||
return new Point(img.Width - img2.Width - offset - add, img.Height / 2 - img2.Height / 2 - add);
|
return new Point(img.Width - img2.Width - offset, img.Height / 2 - img2.Height / 2);
|
||||||
case PositionType.Bottom_Left:
|
case PositionType.Bottom_Left:
|
||||||
return new Point(offset, img.Height - img2.Height - offset - add);
|
return new Point(offset, img.Height - img2.Height - offset);
|
||||||
case PositionType.Bottom:
|
case PositionType.Bottom:
|
||||||
return new Point(img.Width / 2 - img2.Width / 2 - add, img.Height - img2.Height - offset - add);
|
return new Point(img.Width / 2 - img2.Width / 2, img.Height - img2.Height - offset);
|
||||||
case PositionType.Bottom_Right:
|
case PositionType.Bottom_Right:
|
||||||
return new Point(img.Width - img2.Width - offset - add, img.Height - img2.Height - offset - add);
|
return new Point(img.Width - img2.Width - offset, img.Height - img2.Height - offset);
|
||||||
default:
|
default:
|
||||||
return Point.Empty;
|
return Point.Empty;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue