#๐ Draw a rectangle on my screen
20 messages ยท Page 1 of 1 (latest)
@inland sundial
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
What exactly are you trying to do?
I'm making an application where the user has to choose an area of his screen to capture by a screenshot with two clicks and I'd like that after these 2 clicks the area is surrounded by a rectangle.
You could probably do this with pyqt
draw a fully transparent widget on screen to detect clicks
then 2 clicks to set the bounds of the rectangle
OK thx i will try
for instance you could use the pynput library which is rather straight forward to get the mouse click coordinates
and open a transparent window using pyQt (as fashoomp said) at the coordinates you get
as for "drawing a rectangle" on your screen, that would require first to open a transparent window on your full screen and then draw a rectangle inside it
might be another way to do that actually since the mouse getter can be managed by Qt itself
there's no need to use pynput in that case, you could record the coordinates using qt
no, but the transparent window would be there to capture your input
sort of like how the windows snipping tool works
ah yes, i didn't understand your first message
i just said the same thing on the second part of mine ๐
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.