locked
[VS2012] IGlyphService only returns "Light" theme glyphs. RRS feed

  • Question

  • Hi,

    I am currently playing with the Roslyn CTP and creating some extensions for VS2012(RTM).  I am using the IGlyphService to get the glyphs for the completion list.  But as the title says the IGlyphService ony returns glyphs that are for the "Light" theme.  They look kind of horrible on a dark background.  Is there any other way to get the glyphs that are theme appropriate?

    Cheers,

    Dan.

    
    Sunday, October 28, 2012 11:16 PM

Answers

  • That's because there is only one image, icons have their luminosity inverted under the dark theme. The shell uses either this class or this class to do so, depending on the scenario. If you are displaying the images yourself you would need to use these converters as well.

    Ryan

    • Marked as answer by Daniel Keenan Monday, October 29, 2012 11:39 AM
    Sunday, October 28, 2012 11:26 PM

All replies

  • That's because there is only one image, icons have their luminosity inverted under the dark theme. The shell uses either this class or this class to do so, depending on the scenario. If you are displaying the images yourself you would need to use these converters as well.

    Ryan

    • Marked as answer by Daniel Keenan Monday, October 29, 2012 11:39 AM
    Sunday, October 28, 2012 11:26 PM
  • Cool, Thanks.

    For anyone who is interested this is what I used:

     //...
    [Import]
    public IGlyphService glyphService;
    private ThemedImageSourceConverter imageSourceConverter = new ThemedImageSourceConverter();
    //...
    var image = (CroppedBitmap)glyphService.GetGlyph(glyph, item);
    var backgroundColor = Color.FromArgb(255, 37, 37, 38);
    var convertedImage = (BitmapSource)imageSourceConverter.Convert(new object[] { image, backgroundColor, true }, typeof(ImageSource), null, Thread.CurrentThread.CurrentCulture);




    Monday, October 29, 2012 11:42 AM