MagSetWindowTransform function (magnification.h)

Sets the transformation matrix for a magnifier control.

Syntax

BOOL MagSetWindowTransform(
  [in]  HWND          hwnd,
  [out] PMAGTRANSFORM pTransform
);

Parameters

[in] hwnd

Type: HWND

The magnification window.

[out] pTransform

Type: PMAGTRANSFORM

A transformation matrix.

Return value

Type: BOOL

Returns TRUE if successful, or FALSE otherwise.

Remarks

The transformation matrix specifies the magnification factor that the magnifier control applies to the contents of the source rectangle.

Examples

The following example shows how to set the magnification factor for a magnifier control.

// Description:
//   Sets the magnification factor for a magnifier control.
// Parameters:
//   hwndMag - Handle of the magnifier control.
//   magFactor - New magnification factor.
//
BOOL SetMagnificationFactor(HWND hwndMag, float magFactor)
{
    MAGTRANSFORM matrix;
    memset(&matrix, 0, sizeof(matrix));
    matrix.v[0][0] = magFactor;
    matrix.v[1][1] = magFactor;
    matrix.v[2][2] = 1.0f;

    return MagSetWindowTransform(hwndMag, &matrix);  
}

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header magnification.h
Library Magnification.lib
DLL Magnification.dll

See also

MagGetWindowTransform