public static ImageSource ConvertCore(ImageSource inputImage, Color backgroundColor, bool isEnabled, bool isHighContrast, object parameter) { if (!(inputImage is BitmapSource inputImage1) || backgroundColor.A == 0 & isEnabled) { return(inputImage); } var biasColor = GrayscaleBitmapSourceConverter.GetBiasColor(parameter); return(ImageThemingUtilities.GetOrCreateThemedBitmapSource(inputImage1, backgroundColor, isEnabled, biasColor, isHighContrast)); }
public static ImageSource ThemeImage(DependencyObject owner, BitmapSource source) { Color background = ImageThemingUtilities.GetImageBackgroundColor(owner); return(ImageThemingUtilities.GetOrCreateThemedBitmapSource(source, background, true, Colors.Black, false)); }