Share via


ImageThemingUtilities Class

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

Inheritance Hierarchy

Object
  Microsoft.VisualStudio.PlatformUI.ImageThemingUtilities

Namespace:  Microsoft.VisualStudio.PlatformUI
Assembly:  Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)

Syntax

'Declaration
Public NotInheritable Class ImageThemingUtilities
public static class ImageThemingUtilities
public ref class ImageThemingUtilities abstract sealed
[<AbstractClass>]
[<Sealed>]
type ImageThemingUtilities =  class end
public final class ImageThemingUtilities

The ImageThemingUtilities type exposes the following members.

Attached Properties

  Name Description
Public attached property ImageBackgroundColor 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.
Public attached property ThemeScrollBars Controls whether the ScrollBars of this element and its descendants have themed scrollbars. It is attached to FrameworkElementTrue - ScrollBars are themedFalse - ScrollBars are not themednull - ScrollBar theme state is inherited

Top

Methods

  Name Description
Public methodStatic member GetImageBackgroundColor Gets the ImageBackgroundColor property.
Public methodStatic member GetOrCreateThemedBitmapSource 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.
Public methodStatic member GetThemedBitmap(Bitmap, Color) Creates a new Bitmap, based on the input one, but the new one blends in with the target background.
Public methodStatic member GetThemedBitmap(Bitmap, UInt32) Creates a new Bitmap, based on the input one, but the new one blends in with the target background.
Public methodStatic member GetThemeScrollBars Gets the ThemeScrollbarsProperty value.
Public methodStatic member GrayscaleDIBits Transforms a BGRA32 device-independent bitmap to grayscale.
Public methodStatic member SetImageBackgroundColor Sets the ImageBackgroundColor property.
Public methodStatic member SetThemeScrollBars Sets the ThemeScrollbarsProperty value.

Top

Fields

  Name Description
Public fieldStatic member ImageBackgroundColorProperty 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.
Public fieldStatic member ThemeScrollBarsProperty Controls whether the ScrollBars of this element and its descendants have themed scrollbars. It is attached to FrameworkElementTrue - ScrollBars are themedFalse - ScrollBars are not themednull - ScrollBar theme state is inherited

Top

Thread Safety

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

See Also

Reference

Microsoft.VisualStudio.PlatformUI Namespace