コード例 #1
0
        private void addIconToCache(Color color)
        {
            if (_iconCache.ContainsKey(color))
            {
                return;
            }

            Bitmap imageWithoutBorder = WinFormsHelpers.ReplaceColorInBitmap(
                Properties.Resources.gitlab_icon_stub_16x16, Color.Green, color);
            Icon iconWithoutBorder = WinFormsHelpers.ConvertToIco(imageWithoutBorder, 16);

            Bitmap imageWithBorder = WinFormsHelpers.ReplaceColorInBitmap(
                Properties.Resources.gitlab_icon_stub_16x16_border, Color.Green, color);
            Icon iconWithBorder = WinFormsHelpers.ConvertToIco(imageWithBorder, 16);

            _iconCache.Add(color, new IconGroup(iconWithoutBorder, iconWithBorder));
        }