mirror of
https://github.com/ShareX/ShareX.git
synced 2024-06-28 11:10:23 +12: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
|
@ -226,7 +226,7 @@
|
|||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Core\LOG.cs" />
|
||||
<Compile Include="Helpers\LOG.cs" />
|
||||
<Compile Include="UnmanagedHelpers\DWM.cs" />
|
||||
<Compile Include="UnmanagedHelpers\Enumerations.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.
|
||||
/// This accounts for the "bug" I reported here: http://social.technet.microsoft.com/Forums/en/w8itprogeneral/thread/99ddbe9d-556d-475a-8bab-84e25aa13a2c
|
||||
/// </summary>
|
||||
/// <param name="radius"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsBlurPossible(int radius)
|
||||
{
|
||||
if (Environment.OSVersion.Version.Major < 6)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if ((Environment.OSVersion.Version.Major >= 6 && Environment.OSVersion.Version.Minor >= 2) && radius < 20)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -725,28 +725,28 @@ public static string HtmlEncode(string text)
|
|||
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)
|
||||
{
|
||||
case PositionType.Top_Left:
|
||||
return new Point(offset, offset);
|
||||
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:
|
||||
return new Point(img.Width - img2.Width - offset - add, offset);
|
||||
return new Point(img.Width - img2.Width - offset, offset);
|
||||
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:
|
||||
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:
|
||||
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:
|
||||
return new Point(offset, img.Height - img2.Height - offset - add);
|
||||
return new Point(offset, img.Height - img2.Height - offset);
|
||||
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:
|
||||
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:
|
||||
return Point.Empty;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue