Export (0) Print
Expand All

MagSetFullscreenColorEffect function

Changes the color transformation matrix associated with the full-screen magnifier.

Syntax


BOOL WINAPI MagSetFullscreenColorEffect(
  _In_  PMAGCOLOREFFECT pEffect
);

Parameters

pEffect [in]

Type: PMAGCOLOREFFECT

The new color transformation matrix. This parameter must not be NULL.

Return value

Type: BOOL

Returns TRUE if successful, or FALSE otherwise.

Remarks

The full-screen magnifier uses the color transformation matrix to apply a color effect to the entire desktop. If the function is called multiple times, the most recent color transform is used.

Examples

The following example defines two color transformation matrices for use with MagSetFullscreenColorEffect. The g_MagEffectGrayscale matrix converts the screen colors to grayscale. The g_MagEffectIdentity matrix is the identity matrix, which restores the original screen colors.


// Initialize color transformation matrices used to apply grayscale and to 
// restore the original screen color.
MAGCOLOREFFECT g_MagEffectGrayscale = {0.3f,  0.3f,  0.3f,  0.0f,  0.0f,
                                       0.6f,  0.6f,  0.6f,  0.0f,  0.0f,
                                       0.1f,  0.1f,  0.1f,  0.0f,  0.0f,
                                       0.0f,  0.0f,  0.0f,  1.0f,  0.0f,
                                       0.0f,  0.0f,  0.0f,  0.0f,  1.0f};

MAGCOLOREFFECT g_MagEffectIdentity = {1.0f,  0.0f,  0.0f,  0.0f,  0.0f,
                                      0.0f,  1.0f,  0.0f,  0.0f,  0.0f,
                                      0.0f,  0.0f,  1.0f,  0.0f,  0.0f,
                                      0.0f,  0.0f,  0.0f,  1.0f,  0.0f,
                                      0.0f,  0.0f,  0.0f,  0.0f,  1.0f};

BOOL SetColorGrayscale(__in BOOL fGrayscaleOn)
{
    // Apply the color matrix required to either apply grayscale to the screen 
    // colors or to show the regular colors.
    PMAGCOLOREFFECT pEffect = 
                (fGrayscaleOn ? &g_MagEffectGrayscale : &g_MagEffectIdentity);

    return MagSetFullscreenColorEffect(pEffect);
}


Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

Magnification.h

Library

Magnification.lib

DLL

Magnification.dll

See also

MagGetFullscreenColorEffect

 

 

Community Additions

ADD
Show:
© 2014 Microsoft