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: BitmapSourceThe input BitmapSource.
backgroundColor
Type: ColorThe color which the halo color should be targeted to match within the bitmap.
isEnabled
Type: BooleanTrue if the bitmap should be rendered enabled, false if it should be disabled (grayscaled).
grayscaleBiasColor
Type: ColorThe 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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.