ImageThemingUtilities::GetOrCreateThemedBitmapSource Method (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.
Assembly: Microsoft.VisualStudio.Imaging (in Microsoft.VisualStudio.Imaging.dll)
public: static BitmapSource^ GetOrCreateThemedBitmapSource( BitmapSource^ inputImage, Color backgroundColor, bool isEnabled, Color grayscaleBiasColor )
Parameters
- inputImage
-
Type:
System.Windows.Media.Imaging::BitmapSource^
The input BitmapSource.
- backgroundColor
-
Type:
System.Windows.Media::Color
The color which the halo color should be targeted to match within the bitmap.
- isEnabled
-
Type:
System::Boolean
True if the bitmap should be rendered enabled, false if it should be disabled (grayscaled).
- grayscaleBiasColor
-
Type:
System.Windows.Media::Color
The color used for biasing grayscale if the image is disabled.
Return Value
Type: System.Windows.Media.Imaging::BitmapSource^A new BitmapSource with the requested transformations applied.