Show HN: I made an open source desktop magnifier for demo and presentations (github.com)
I wanted a cool magnifier for my presentations, but couldn't find one (the default windows one was not really usable for my case)
So I built one using Vue and Tauri (weird stack for such a tool, huh?). It was a pretty fun little project, hope you guys can have some use.
Here's how it works:
- When you press the shortcut, it takes a screenshot and store it in a temp folder
- It then displays an HTML window and passes the screenshot URL to it
- The HTML window has no "decorations" (top bar) and only contains an empty div
- This div uses the screenshot as a background and updates the background position based on the cursor location
- The window location is also updated according to the cursor location using a requestAnimationFrame (so that it does not get triggered too often)
- The wheel event impacts the size of the window, as well as a transform:scale on the background.
3 comments
[ 3.6 ms ] story [ 15.3 ms ] threadWhy would you store the screenshot to disk, just grab what ever the compositor gives you and render it on a texture, skipping the whole disk write usage
https://blogs.windows.com/windowsdeveloper/2019/09/16/new-wa...
It's similar for both macOS and X11 (haven't looked at wayland yet)
I'm not sure why this would be so inefficient, as the screenshot is only taken once when the magnifier is activated. In fact, I don't think we care about efficiency at all for this kind of little tool.
But thanks a lot for the link, that's super interesting, and they included a "ExcludeFromCapture" which would have been very convenient! I'll have a look how if I can integrate this into a Tauri backend!