DisplayMagician/HeliosPlus.ShellExtension/Shield.cs

31 lines
762 B
C#
Raw Normal View History

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)
2018-10-20 00:27:25 +00:00
{
return _smallIcon;
2018-10-20 00:27:25 +00:00
}
var iconSize = SystemInformation.SmallIconSize;
_smallIcon = new Bitmap(iconSize.Width, iconSize.Height);
2018-10-20 00:27:25 +00:00
using (var g = Graphics.FromImage(_smallIcon))
{
g.DrawIcon(SystemIcons.Shield, new Rectangle(Point.Empty, iconSize));
}
2018-10-20 00:27:25 +00:00
return _smallIcon;
}
}
}
}