Share via


ImageThemingUtilities.GetOrCreateThemedBitmapSource Method

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.

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

Syntax

'Declaration
Public Shared Function GetOrCreateThemedBitmapSource ( _
    inputImage As BitmapSource, _
    backgroundColor As Color, _
    isEnabled As Boolean, _
    grayscaleBiasColor As Color _
) As BitmapSource
public static BitmapSource GetOrCreateThemedBitmapSource(
    BitmapSource inputImage,
    Color backgroundColor,
    bool isEnabled,
    Color grayscaleBiasColor
)
public:
static BitmapSource^ GetOrCreateThemedBitmapSource(
    BitmapSource^ inputImage, 
    Color backgroundColor, 
    bool isEnabled, 
    Color grayscaleBiasColor
)
static member GetOrCreateThemedBitmapSource : 
        inputImage:BitmapSource * 
        backgroundColor:Color * 
        isEnabled:bool * 
        grayscaleBiasColor:Color -> BitmapSource
public static function GetOrCreateThemedBitmapSource(
    inputImage : BitmapSource, 
    backgroundColor : Color, 
    isEnabled : boolean, 
    grayscaleBiasColor : Color
) : BitmapSource

Parameters

  • inputImage
    Type: BitmapSource

    The input BitmapSource.

  • backgroundColor
    Type: Color

    The color which the halo color should be targeted to match within the bitmap.

  • isEnabled
    Type: Boolean

    True if the bitmap should be rendered enabled, false if it should be disabled (grayscaled).

  • grayscaleBiasColor
    Type: Color

    The color used for biasing grayscale if the image is disabled.

Return Value

Type: BitmapSource
A new BitmapSource with the requested transformations applied.

.NET Framework Security

See Also

Reference

ImageThemingUtilities Class

Microsoft.VisualStudio.PlatformUI Namespace