Question

Custom ShaderEffect for QAT button images (Office2016 theme)

Posted 2 months ago by Avatar Gergely Bacsó

Hi,

is there a way to add my own shader effect to QAT button images or customize the appearance of these buttons
when using the Office 2016 themes?

I don't want the white mask, but something else...

Thank you,
Gergely


Comments (4)

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA

Hello,

I believe you can disable that effect by setting the attached ImageSourceContentConverter.CanConvertToMonochrome property to false on the image.  There isn't a way to intercept that behavior otherwise with custom logic though.


Actipro Software Support
Posted 2 months ago by Gergely Bacsó

Hi,

could you provide some sample code?
I tried to set this property everywhere but had no luck.

It seems when a button is added to the QAT above, it's ImageSourceSmall is automatically replaced with a WriteableBitmap, which is I suppose the monochrome image. I couldn't prevent this behavior. And since there is no original bitmap on the button, I can only show the monochrome one.

Thanks.

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA

Hello,

If you want it disabled on a specific image, you could load the image like this:

var newImage = new BitmapImage(new Uri("pack://application:,,,/SampleBrowser;component/Resources/Images/New16.png", UriKind.RelativeOrAbsolute));
ImageSourceContentConverter.SetCanConvertToMonochrome(newImage, false);

If you want it disabled on all images, you can set this in your application's Resources:

<system:Boolean x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarUseAccentBooleanKey}">False</system:Boolean>

Actipro Software Support
Posted 2 months ago by Gergely Bacsó

Thank you!

Information The latest build of this product (2018.1 build 0673) was released 1 month ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.