Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature suggestion] Add an auto magnification #56

Open
popyoung opened this issue Dec 10, 2022 · 3 comments
Open

[Feature suggestion] Add an auto magnification #56

popyoung opened this issue Dec 10, 2022 · 3 comments

Comments

@popyoung
Copy link

Sometimes the target is too small on the screen and I can't capture it accurately. Maybe it is a good idea to add a magnified image based on what is around the cursor when users are capturing the screen.

@ianzhao05
Copy link
Owner

Thank you for the suggestion. I will consider working on it once I have a bit more time.

@K53N0
Copy link

K53N0 commented Dec 16, 2022

Hey man @ianzhao05, I kinda found an easy way for this (for windows) by using the Magnify.exe in Windows32.

So, after the already existing imports in textshot.py, I basically added the following code:

import pyautogui
pyautogui.hotkey('win', '=')

and added pyautogui.hotkey('win', 'esc') in the mouseReleaseEvent method (before the if statement) for the OneTimeSnipper class.

    def mouseReleaseEvent(self, event):
        pyautogui.hotkey('win', 'esc')
        if self.start == self.end:
            return super().mouseReleaseEvent(event)

So basically what this does is open the default windows magnifying glass after the script has been run, and closes it before the script ends. Of course one would need to pip install pyautogui for this to work.

And you can set the default settings for Magnify.exe under Start > Ease of Access > Magnifying Glass.
In particular the most important setting is the Magnifier view. I set this to Lens mode, size 10, 10.
Default zoom level can be changed based on one's preference.

I know this isn't the most sophisticated method but I'm new to programming and it worked for me, so I dropped by since the tool is so useful and I wanted to contribute in some way.

@ianzhao05
Copy link
Owner

Hey @K53N0 that's awesome, thanks for sharing! That could definitely be a solution for Windows. Unfortunately, I am trying as much as possible to have it work cross platform, which probably means implementing magnification within the script itself. However, your way is a great workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants