Example #1
0
        public static FDImage GetGray(string data)
        {
            Image image     = (mainForm != null) ? mainForm.FindImage(data) : new Bitmap(16, 16);
            Image converted = ImageKonverter.ImageToGrayscale(image);

            imageList.Images.Add(converted);
            return(new FDImage(converted, imageList.Images.Count - 1));
        }
Example #2
0
        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);
            }
        }