Windows 11 - Accessibility Color Filters

2024-01-23T20:14:59.81+00:00

Hi, Does everyone have a sample using C# for Windows 11 Accessibility Color Filters? Im making one sample, but, Im newbie at Windows SDK. Regards, Igor.

Universal Windows Platform (UWP)
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,989 questions
0 comments No comments
{count} votes

Accepted answer
  1. Junjie Zhu - MSFT 16,701 Reputation points Microsoft Vendor
    2024-01-24T06:05:18.9533333+00:00

    Hello @Igor Felipe Pereira Gutierrez (CC0) ,

    Welcome to Microsoft Q&A!

    It is recommended to use Win32 api MagSetFullscreenColorEffect, here is a grayscale example. You can also modify the matrix to achieve multiple colors.

    //​using static Vanara.PInvoke.Magnification;
    //using static Vanara.PInvoke.User32; 
    
     float redScale = 0.2126f, greenScale = 0.7152f, blueScale = 0.0722f;
    
     var magEffectInvert = new MAGCOLOREFFECT(new[,] { // MagEffectInvert
    		 { redScale,   redScale,   redScale,   0.0f,  0.0f, },
             { greenScale, greenScale, greenScale, 0.0f,  0.0f, },
             { blueScale,  blueScale,  blueScale,  0.0f,  0.0f, },
             { 0.0f,       0.0f,       0.0f,       1.0f,  0.0f, },
             { 0.0f,       0.0f,       0.0f,       0.0f,  1.0f }
             });
    
    
     MagInitialize();
     MagSetFullscreenColorEffect(magEffectInvert);   
    

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. 2024-01-24T12:06:56.4466667+00:00

    Hey, here is an sample I made:

    It's a simple WPF, with Button to make Screen in Black and White. I'm working it, to be complete done. https://github.com/acigorgutierrezdc/Wsbwog-WPF-PM Thank's, Igor Felipe Pereira Gutierrez.

    0 comments No comments