DisplayMagician/HeliosDisplayManagement.ShellExtension/Shield.cs
2018-10-20 03:57:25 +03:30

31 lines
775 B
C#

using System.Drawing;
using System.Windows.Forms;
namespace HeliosDisplayManagement.ShellExtension
{
public static class Shield
{
private static Bitmap _smallIcon;
public static Bitmap SmallIcon
{
get
{
if (_smallIcon != null)
{
return _smallIcon;
}
var iconSize = SystemInformation.SmallIconSize;
_smallIcon = new Bitmap(iconSize.Width, iconSize.Height);
using (var g = Graphics.FromImage(_smallIcon))
{
g.DrawIcon(SystemIcons.Shield, new Rectangle(Point.Empty, iconSize));
}
return _smallIcon;
}
}
}
}