Udostępnij za pośrednictwem


ThemedImageConverter Class

Definition

Converts an input ImageSource into an Image control whose Source blends in with the target background.
This converter performs two conversions.
If the inputs are a source BitmapSource, the target background color, and a bool indicating whether or not the image should have an enabled appearance, based on these inputs, the following transformations are performed:

  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 parameter (optional), which should be a "biasColor" used during grayscale transformation. If the parameter is not specified, White is used as the bias color. If the input cannot be converted to a BitmapSource, no image manipulation is performed and the ImageSource is used directly as the Source of the resulting Image control.
public ref class ThemedImageConverter sealed : Microsoft::VisualStudio::PlatformUI::MultiValueConverter<System::Windows::Media::ImageSource ^, System::Windows::Media::Color, bool, System::Windows::Controls::Image ^>
public ref class ThemedImageConverter sealed : Microsoft::VisualStudio::PlatformUI::MultiValueConverter<System::Windows::Media::ImageSource ^, System::Windows::Media::Color, bool, System::Windows::Controls::Image ^>
class ThemedImageConverter sealed : Microsoft::VisualStudio::PlatformUI::MultiValueConverter<System::Windows::Media::ImageSource, System::Windows::Media::Color, bool, System::Windows::Controls::Image const &>
public sealed class ThemedImageConverter : Microsoft.VisualStudio.PlatformUI.MultiValueConverter<System.Windows.Media.ImageSource,System.Windows.Media.Color,bool,System.Windows.Controls.Image>
type ThemedImageConverter = class
    inherit MultiValueConverter<ImageSource, Color, bool, Image>
Public NotInheritable Class ThemedImageConverter
Inherits MultiValueConverter(Of ImageSource, Color, Boolean, Image)
Inheritance

Remarks

This converter performs two conversions:

If the inputs are a source BitmapSource, the target background color, and a bool indicating whether or not he image should have an enabled appearance, based on these inputs, the following transformations are performed:

  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 parameter (optional), which should be a biasColor used during grayscale transformation. If the parameter is not specified, White is used as the bias color.

If the input cannot be converted to a BitmapSource, no image manipulation is performed and the ImageSource is used directly as the Source of the resulting Image control.

Constructors

ThemedImageConverter()

Microsoft internal use only.

Methods

CheckValue<T>(Object[], Int32, String)

Validates that values[index] is of type T

(Inherited from MultiValueConverterBase<TTarget>)
Convert(Object[], Type, Object, CultureInfo)

Microsoft internal use only.

(Inherited from MultiValueConverter<T1,T2,T3,TTarget>)
Convert(T1, T2, T3, Object, CultureInfo)

Microsoft internal use only.

(Inherited from MultiValueConverter<T1,T2,T3,TTarget>)
ConvertBack(Object, Type[], Object, CultureInfo)

Microsoft internal use only.

(Inherited from MultiValueConverter<T1,T2,T3,TTarget>)
ConvertBack(TTarget, T1, T2, T3, Object, CultureInfo)

Microsoft internal use only.

(Inherited from MultiValueConverter<T1,T2,T3,TTarget>)
ConvertBackCore(Object, Type[], Object, CultureInfo) (Inherited from MultiValueConverter<T1,T2,T3,TTarget>)
ConvertCore(Object[], Type, Object, CultureInfo) (Inherited from MultiValueConverter<T1,T2,T3,TTarget>)
MakeConverterFunctionNotDefinedException(String)

An exception thrown when the converter function isn’t defined.

(Inherited from MultiValueConverterBase<TTarget>)
ValidateConvertBackParameters(Object, Type[])

Validates the parameters passed to IMultiValueConverter.ConvertBack

(Inherited from MultiValueConverterBase<TTarget>)
ValidateConvertParameters(Object[], Type)

Validates the parameters passed to IMultiValueConverter.Convert

(Inherited from MultiValueConverterBase<TTarget>)

Applies to