DisplayMagician/HeliosPlus.ShellExtension/Shield.cs
2020-05-15 23:25:14 +12:00

31 lines
762 B
C#

using System.Drawing;
using System.Windows.Forms;
namespace HeliosPlus.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;
}
}
}
}