BrightIdeasSoftware.Utilities.ImagelistAdd.AddEmbeddedResource C# (CSharp) Метод

AddEmbeddedResource() публичный статический Метод

Adds a 32bit alphablended icon or image to an existing imagelist from an embedded image or icon.
public static AddEmbeddedResource ( string resourceName, ImageList destinationImagelist ) : void
resourceName string
destinationImagelist System.Windows.Forms.ImageList
Результат void
        public static void AddEmbeddedResource(string resourceName, ImageList destinationImagelist)
        {
            Bitmap bm = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName));

            if (bm.RawFormat.Guid == ImageFormat.Icon.Guid) {
                Icon icn = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName));
                destinationImagelist.Images.Add(Icon.FromHandle(icn.Handle));
                icn.Dispose();
            } else {
                AddFromImage(bm, destinationImagelist);
            }
            bm.Dispose();
        }