WinMagnification
Python wrapper for Windows Magnification API
pip install WinMagnification
Covered functions:
- MagInitialize
- MagUninitialize
- MagGetFullscreenColorEffect
- MagSetFullscreenColorEffect
- MagSetFullscreenTransform
- MagGetFullscreenTransform
- MagSetColorEffect
- MagGetColorEffect
- MagSetWindowTransform
- MagGetWindowTransform
- MagSetWindowSource
- MagGetWindowSource
- MagSetWindowFilterList
- MagGetWindowFilterList
- MagGetInputTransform
- MagSetInputTransform
- MagShowSystemCursor
You may use old-style function names:
import win_magnification as mag
import win_magnification.old as old_mag
old_mag.MagInitialize()
old_mag.MagSetFullscreenColorEffect(mag.const.COLOR_INVERSION_EFFECT)
old_mag.MagSetFullscreenColorEffect(mag.const.DEFAULT_COLOR_EFFECT)
old_mag.MagUninitialize()
Or you may use more pythonic function names:
import win_magnification as mag
mag.initialize()
mag.set_fullscreen_color_effect(mag.const.COLOR_INVERSION_EFFECT)
mag.reset_fullscreen_color_effect()
mag.finalize()
Or... you can even use Object-Oriented wrapper:
import win_magnification as mag
api = mag.WinMagnificationAPI()
api.fullscreen.color_effect.raw = mag.const.COLOR_INVERSION_EFFECT
api.fullscreen.color_effect.reset()
Restrictions
There are 3.5 groups of functions:
- Fullscreen (nothing required, call and chill) have limited functional, but simple:
- get/set_fullscreen_color_effect
- get/set_fullscreen_transform
- get_input_transform
- Window (requires window creation as shown in example),
more powerful, but requires such things like custom window creation (hello from pywin32),
UiAccess (Hard to obtain) if you need your magnifier above everything, but you can simulate all fullscreen functions too:
- get/set_color_effect
- get/set_transform
- get/set_source
- get/set_filters (supports exclusion only, looks like excluded windows never exist for magnifier)
- UiAccess required:
- set_input_transform
- Other:
- initialize
- finalize
- set_cursor_visibility (cursor stay hidden until active)
Known alternatives
I can't actually use this lib, I don't know why, it just does nothing and imports nothing. Also, it doesn't support fullscreen* functions
Known issues
Working from different threads is pain, and I'm trying to solve/restrict this somehow
PyWin32 Integration?
This package uses ctypes only, so no pywin32 required. But, well, you can use pywin32 for creating magnifier windows and so on (see example)
Metadata
Release files for WinMagnification 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| WinMagnification-0.1.0.tar.gz | 21.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| WinMagnification-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 48.4 kB
Release files / WinMagnification-0.1.0.tar.gz
| Download URL | WinMagnification-0.1.0.tar.gz |
|---|---|
| Size | 21.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05868a6c2400fc96755c139ff43f2b18ba499032f229380c8165f22abbc7426e
|
|
BLAKE2b-256 checksum How to use checksums |
2dd43ccd9255cc2e197eccda9b655dd9c48d5c367c7206b65cfab945f03e6027
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / WinMagnification-0.1.0-py3-none-any.whl
| Download URL | WinMagnification-0.1.0-py3-none-any.whl |
|---|---|
| Size | 26.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
387d510eb4cdbadd7c70756969f2618c418982392ad36385d1e06ff1e34e0ce6
|
|
BLAKE2b-256 checksum How to use checksums |
63334e22e05e76af831a8a87d383fe6715eebcd0af03c6e559aa75eb2fe92115
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|