avc,
Оказывается можно еще проще:
System.Drawing.Icon ico = Autodesk.AutoCAD.Internal.Utils.GetAcadResourceIcon("имя ресурса");
Для проверки:
public void GetIconWithId() // This method can have any name
{
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
System.Drawing.Icon ico = Autodesk.AutoCAD.Internal.Utils.GetAcadResourceIcon("RCDATA_32_BLOCK");
ed.WriteMessage("Icon size = {0}", ico.Size);
using (System.Windows.Forms.Form f = new System.Windows.Forms.Form()
{
Name = "Test", Text = "Test",
MinimumSize = new System.Drawing.Size(32, 32),
FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow
})
{
System.Windows.Forms.PictureBox box = new System.Windows.Forms.PictureBox()
{
Name = "box",
Dock = System.Windows.Forms.DockStyle.Fill,
SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage,
Image = ico.ToBitmap()
};
f.Controls.Add(box);
f.ShowDialog();
}
}