ImageThemingUtilities Class

 

Contains utility methods for grayscaling and transforming color spaces within images.

Namespace:   Microsoft.VisualStudio.PlatformUI
Assembly:  Microsoft.VisualStudio.Imaging (in Microsoft.VisualStudio.Imaging.dll)

System.Object
  Microsoft.VisualStudio.PlatformUI.ImageThemingUtilities

public static class ImageThemingUtilities

NameDescription
System_CAPS_pubpropertySystem_CAPS_staticImageBackgroundColor

Gets or sets the color used for image theming. The target color is used to map the "halo" color in an image with the target background color. It should be attached on the same UIElement that the gackground color is set on when images are drawn directly on that Background. The reasons why the background is not used directly:

1. Backgrounds that are set to Transparent would require a visual tree walk to find the real background.

2. The background is a Brush, not a Color, which would require interpretation to arrive at a Color instead.

3. The ultimate background the image is drawn on may not be the desired image to use for theming, for example when a selection brush is conditionally shown in a TreeView.

System_CAPS_pubpropertySystem_CAPS_staticThemeScrollBars

Controls whether the ScrollBars of this element and its descendants have themed scrollbars. It is attached to FrameworkElement

True - ScrollBars are themed

False - ScrollBars are not themed

null - ScrollBar theme state is inherited

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticClearOptOutPixel(Byte*, Int32, Int32, Boolean)

System_CAPS_pubmethodSystem_CAPS_staticClearOptOutPixel(Byte[], Int32, Int32, Boolean)

System_CAPS_pubmethodSystem_CAPS_staticClearWeakImageCache()

System_CAPS_pubmethodSystem_CAPS_staticGetImageBackgroundColor(DependencyObject)

Gets the ImageBackgroundColor property.

System_CAPS_pubmethodSystem_CAPS_staticGetOrCreateThemedBitmapSource(BitmapSource, Color, Boolean, Color)

Converts an input BitmapSource into an BitmapSource that blends in with the target background. This converter performs two conversions.

1. The luminosity of the image is transformed so that the constant "halo" luminosity blends in with the background. This has the effect of eliminating the halo visually. The "halo" luminosity is an immutable constant, and is not calculated from the input image.

2. The image is converted to grayscale if the isEnabled parameter is false. This uses the "biasColor" to determine how to transform the image to grayscale.

System_CAPS_pubmethodSystem_CAPS_staticGetOrCreateThemedBitmapSource(BitmapSource, Color, Boolean, Color, Boolean)

System_CAPS_pubmethodSystem_CAPS_staticGetThemedBitmap(Bitmap, Color)

Creates a new Bitmap, based on the input one, but the new one blends in with the target background.

System_CAPS_pubmethodSystem_CAPS_staticGetThemedBitmap(Bitmap, Color, Boolean)

System_CAPS_pubmethodSystem_CAPS_staticGetThemedBitmap(Bitmap, UInt32)

Creates a new Bitmap, based on the input one, but the new one blends in with the target background.

System_CAPS_pubmethodSystem_CAPS_staticGetThemedBitmap(Bitmap, UInt32, Boolean)

System_CAPS_pubmethodSystem_CAPS_staticGetThemeScrollBars(DependencyObject)

Gets the ThemeScrollbarsProperty value.

System_CAPS_pubmethodSystem_CAPS_staticGrayscaleDIBits(Byte[], Int32, Color)

Transforms a BGRA32 device-independent bitmap to grayscale.

System_CAPS_pubmethodSystem_CAPS_staticIsDark(Color)

System_CAPS_pubmethodSystem_CAPS_staticIsLight(Color)

System_CAPS_pubmethodSystem_CAPS_staticIsOptOutPixelSet(Byte*, Int32, Int32, Boolean)

System_CAPS_pubmethodSystem_CAPS_staticIsOptOutPixelSet(Byte[], Int32, Int32, Boolean)

System_CAPS_pubmethodSystem_CAPS_staticModifyBitmap(BitmapSource, ImageThemingUtilities.ModifyPixelCallback)

System_CAPS_pubmethodSystem_CAPS_staticSetImageBackgroundColor(DependencyObject, Color)

Sets the ImageBackgroundColor property.

System_CAPS_pubmethodSystem_CAPS_staticSetOptOutPixel(BitmapSource)

System_CAPS_pubmethodSystem_CAPS_staticSetOptOutPixel(Byte*, Int32, Int32, Boolean)

System_CAPS_pubmethodSystem_CAPS_staticSetOptOutPixel(Byte[], Int32, Int32, Boolean)

System_CAPS_pubmethodSystem_CAPS_staticSetThemeScrollBars(DependencyObject, Nullable<Boolean>)

Sets the ThemeScrollbarsProperty value.

System_CAPS_pubmethodSystem_CAPS_staticThemeDIBits(Int32, Byte[], Int32, Int32, Boolean, UInt32)

System_CAPS_pubmethodSystem_CAPS_staticThemeDIBits(Int32, Byte[], Int32, Int32, Boolean, UInt32, Boolean)

System_CAPS_pubmethodSystem_CAPS_staticThemePixel(Byte, Byte, Byte, HslColor)

System_CAPS_pubmethodSystem_CAPS_staticThemePixel(Byte, Byte, Byte, HslColor, Boolean)

NameDescription
System_CAPS_pubfieldSystem_CAPS_staticImageBackgroundColorProperty

Gets or sets the color used for image theming. The target color is used to map the "halo" color in an image with the target background color. It should be attached on the same UIElement that the gackground color is set on when images are drawn directly on that Background. The reasons why the background is not used directly:

1. Backgrounds that are set to Transparent would require a visual tree walk to find the real background.

2. The background is a Brush, not a Color, which would require interpretation to arrive at a Color instead.

3. The ultimate background the image is drawn on may not be the desired image to use for theming, for example when a selection brush is conditionally shown in a TreeView.

System_CAPS_pubfieldSystem_CAPS_staticThemeScrollBarsProperty

Controls whether the ScrollBars of this element and its descendants have themed scrollbars. It is attached to FrameworkElement

True - ScrollBars are themed

False - ScrollBars are not themed

null - ScrollBar theme state is inherited

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: