Using directives matter

This commit is contained in:
Travis Nickles 2017-08-26 00:49:39 -05:00
parent 51ba40541a
commit 150476d6aa

View File

@ -15,6 +15,7 @@ using System.Globalization;
using Microsoft.Win32.TaskScheduler; using Microsoft.Win32.TaskScheduler;
using System.Security.Principal; using System.Security.Principal;
using System.Threading; using System.Threading;
using System.Drawing.Drawing2D;
using static DS4Windows.Global; using static DS4Windows.Global;
namespace DS4Windows namespace DS4Windows
@ -449,19 +450,17 @@ namespace DS4Windows
hoverTextDict[StartWindowsCheckBox] = Properties.Resources.RunAtStartup; hoverTextDict[StartWindowsCheckBox] = Properties.Resources.RunAtStartup;
} }
private Image AddUACShieldToImage(Image image) private void AddUACShieldToImage(Image image)
{ {
Bitmap shield = SystemIcons.Shield.ToBitmap(); Bitmap shield = SystemIcons.Shield.ToBitmap();
shield.MakeTransparent(); shield.MakeTransparent();
Graphics g = Graphics.FromImage(image); Graphics g = Graphics.FromImage(image);
g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver; g.CompositingMode = CompositingMode.SourceOver;
double aspectRatio = shield.Width / (double)shield.Height; double aspectRatio = shield.Width / (double)shield.Height;
int finalWidth = Convert.ToInt32(image.Height * aspectRatio); int finalWidth = Convert.ToInt32(image.Height * aspectRatio);
int finalHeight = Convert.ToInt32(image.Width / aspectRatio); int finalHeight = Convert.ToInt32(image.Width / aspectRatio);
g.DrawImage(shield, new Rectangle(0, 0, finalWidth, finalHeight)); g.DrawImage(shield, new Rectangle(0, 0, finalWidth, finalHeight));
return image;
} }
private void blankControllerTab() private void blankControllerTab()