textshot
textshot copied to clipboard
[Feature suggestion] Add an auto magnification
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.
Thank you for the suggestion. I will consider working on it once I have a bit more time.
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.
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.