public static void Initialize(IMainForm mainForm) { Icons.mainForm = mainForm; imageList = new ImageList(); imageList.ColorDepth = ColorDepth.Depth32Bit; imageList.ImageSize = new Size(16, 16); imageList.TransparentColor = Color.Transparent; Properties = Get("242"); FileExplorer = Get("209"); }
public static FDImage ExtractIconIfNecessary(string file) { string extension = Path.GetExtension(file); if (extensionIcons.ContainsKey(extension)) { return(extensionIcons[extension]); } else { Icon icon = IconExtractor.GetFileIcon(file, true); Image image = ImageKonverter.ImageResize(icon.ToBitmap(), 16, 16); icon.Dispose(); imageList.Images.Add(image); int index = imageList.Images.Count - 1; // of the icon we just added FDImage fdImage = new FDImage(image, index); extensionIcons.Add(extension, fdImage); return(fdImage); } }