Here’s how to draw an icon in a control utilizing the icon’s built-in alpha channel.
private void cmdEmail_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
System.Drawing.Icon icon;
icon = new Icon(
GetType().Module.Assembly.GetManifestResourceStream(
"ActiveSolution.Lernia.SFI.WinClient.Images.mail.ico"),
16, 16);
e.Graphics.DrawIcon(icon,0,0);
}
The name of the icon resource is easily found using ildasm. Double-click on the “M A N I F E S T” node and look for the icon in the window that opens.
