Ejemplo n.º 1
0
        public Image GetIcon(string id)
        {
            if (!Icons.ContainsKey(id))
            {
                Icons.Add(id, null);
            }

            if (Icons[id] == null)
            {
                var img = SkinEngine.GetDefaultIcon(id);
                using (var mstr = new System.IO.MemoryStream())
                {
                    img.Save(mstr, System.Drawing.Imaging.ImageFormat.Png);
                    Icons[id] = mstr.ToArray();
                }
                return(img);
            }
            else
            {
                using (var sr = new System.IO.MemoryStream(Icons[id]))
                {
                    return(Image.FromStream(sr));
                }
            }
        }
Ejemplo n.º 2
0
 public void ResetToDefaults()
 {
     currentPage = 0;
     foreach (var key in Icons.Keys)
     {
         var img = SkinEngine.GetDefaultIcon(key);
         using (var ms = new System.IO.MemoryStream())
         {
             img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
             Icons[key] = ms.ToArray();
         }
     }
     SetupUI();
 }