- Right-click on window: exit
- Middle-mouse click on window: change mode (1: RGB, 2: pixels, 3: pixels with borders)
- Mousewheel on window: zoom (3 levels)
- Move around the window by click-dragging it
https://gist.github.com/mmozeiko/7f3162ec2988e81e56d5c4e22cde9977
You can source SDK dirs with:
.\msvc\setup_ps.ps1
cl .\rgb_magnifier.c /Wall /O2 /Oi- /GS- /GR- /EHsc /Gy /Os /MD /link /entry:Main /subsystem:windows /nodefaultlib /opt:ref /opt:icf /nologo /emitpogophaseinfo /nocoffgrpinfo /emittoolversioninfo:no /RELEASE user32.lib kernel32.lib gdi32.lib /out:rgb_magnifier.exe
Note: /Oi- mandatory for /O2 and avoiding the CRT memset.
cl .\rgb_magnifier.c /O2 /Oi- /MD /GS- /Zi /link /entry:Main /subsystem:windows /nodefaultlib /DEBUG:FULL user32.lib kernel32.lib gdi32.lib /out:rgb_magnifier.exe
MIT
This uses WinGDI which is the simplest way to get screen pixels. BitBlt (>30%), GetDIBits, SetDIBits are the main bottlenecks. Executable size should be 8KiB.


