win_magnification.old

@MaxBQb

Aug 11, 2023

Functions with winapi-style names

MagInitialize() None

Creates and initializes the magnifier run-time objects.

Raises
MagUninitialize() None

Destroys the magnifier run-time objects.

Raises
MagGetFullscreenColorEffect() types.ColorMatrix

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

Returns

The color transformation matrix, or the identity matrix (COLOR_NO_EFFECT) if no color effect has been set.

Return type

ColorMatrix

Raises
MagSetFullscreenColorEffect(effect: types.ColorMatrix) None

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

Parameters

effect (ColorMatrix) – The new color transformation matrix.

Raises
MagSetFullscreenTransform(scale: float, offset: Tuple[int, int]) None

Changes the magnification settings for the full-screen magnifier.

Parameters
  • scale – The new magnification factor for the full-screen magnifier. 1.0 <= scale <= 4096.0. If this value is 1.0, the screen content is not magnified and no offsets are applied.

  • offset – The offset is relative to the upper-left corner of the primary monitor, in unmagnified coordinates. -262144 <= (x, y) <= 262144.

Raises
MagGetFullscreenTransform() types.FullscreenTransform

Retrieves the magnification settings for the full-screen magnifier.

Returns

Tuple of current magnification factor and offset

Return type

FullscreenTransformRaw

Raises
MagSetColorEffect(hwnd: int, effect: Optional[types.ColorMatrix]) None

Sets the color transformation matrix for a magnifier control.

Parameters
  • hwnd – The handle of the magnification window.

  • effect (ColorMatrix) – The color transformation matrix, or None to remove the current color effect, if any.

Raises

OSError – On fail

MagGetColorEffect(hwnd: int) types.ColorMatrix

Gets the color transformation matrix for a magnifier control.

Parameters

hwnd – The handle of the magnification window.

Returns

Current color transformation matrix.

Return type

ColorMatrix

Raises

OSError – On fail

MagSetWindowTransform(hwnd: int, matrix: types.TransformationMatrix) None

Sets the transformation matrix for a magnifier control.

Parameters
  • hwnd – The handle of the magnification window.

  • matrix (TransformationMatrix) – A 3x3 matrix of the magnification transformation

Raises

OSError – On fail

MagGetWindowTransform(hwnd: int) types.TransformationMatrix

Use to get the magnification transformation matrix on the window provided by the window handle

Parameters

hwnd – The handle of the magnification window.

Returns

A 3x3 matrix of the magnification transformation.

Return type

TransformationMatrix

Raises

OSError – On fail

MagSetWindowSource(hwnd: int, rectangle: types.Rectangle) None

Sets the source rectangle for the magnification window.

Parameters
  • hwnd – The handle of the magnification window.

  • rectangle (RectangleRaw) – Magnification rectangle

Raises

OSError – On fail

MagGetWindowSource(hwnd: int) types.Rectangle

Gets the rectangle of the area that is being magnified.

Parameters

hwnd – The handle of the magnification window.

Returns

Magnification rectangle

Return type

RectangleRaw

Raises

OSError – On fail

MagSetWindowFilterList(root_hwnd: int, *hwnds: int, exclude=True) None
Sets the list of windows to be magnified or the list of windows to be excluded from magnification.
The magnification filter mode can be one of the following values:
exclude = False |=> INCLUDE (This value is not supported on Windows 7 or newer).
exclude = True |=> EXCLUDE (Magnifier acts as windows from list aren’t exist at all)
Parameters
  • root_hwnd – The handle of the magnification window.

  • exclude – The magnification filter mode.

  • hwnds – List of window handles.

Raises

OSError – On fail

MagGetWindowFilterList(hwnd: int) Tuple[bool, Tuple[int]]

Retrieves the list of windows that are magnified or excluded from magnification.

Parameters

hwnd – The handle of the magnification window.

Returns

The filter mode and the list of window handles.

Raises
MagGetInputTransform() types.InputTransform

Retrieves the current input transformation for pen and touch input, represented as a source rectangle and a destination rectangle.

Returns

Tuple of is_enabled, source and destination

Return type

InputTransformRaw

Raises

OSError – On fail

MagSetInputTransform(is_enabled: bool, source: types.Rectangle, destination: types.Rectangle) None
Sets the current active input transformation for pen and touch input, represented as a source rectangle and a destination rectangle.
Requires the calling process to have UIAccess privileges.
Parameters
  • is_enabled – True to enable input transformation, or False to disable it.

  • source (RectangleRaw) – The new source rectangle, in unmagnified screen coordinates, that defines the area of the screen to magnify. This parameter is ignored if is_enabled is False.

  • destination (RectangleRaw) – The new destination rectangle, in unmagnified screen coordinates, that defines the area of the screen where the magnified screen content is displayed. Pen and touch input in this rectangle is mapped to the source rectangle. This parameter is ignored if is_enabled is False.

Raises

OSError – On fail

MagShowSystemCursor(show_cursor: bool)

Shows or hides the system cursor.

Note

Invisibility applies until cursor moves

Parameters

show_cursor – True to show the system cursor, or False to hide it.

Raises

OSError – On fail