예제 #1
0
파일: Icons.cs 프로젝트: benny-yau/.NET-RCP
        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");
        }
예제 #2
0
파일: Icons.cs 프로젝트: benny-yau/.NET-RCP
        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);
            }
        }