-
I want to use pillow in win10 to capture a rectangle part of screen selected by mouse, any sample code? |
Beta Was this translation helpful? Give feedback.
Answered by
radarhere
Nov 9, 2023
Replies: 1 comment
-
You won't be able to use Pillow to get the mouse co-ordinates. You can use ImageGrab.grab to capture part of the screen once you have the coordinates. from PIL import ImageGrab
ImageGrab.grab((0, 0, 1, 1)) See https://pillow.readthedocs.io/en/stable/reference/ImageGrab.html#PIL.ImageGrab.grab for more info |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
radarhere
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You won't be able to use Pillow to get the mouse co-ordinates.
You can use ImageGrab.grab to capture part of the screen once you have the coordinates.
See https://pillow.readthedocs.io/en/stable/reference/ImageGrab.html#PIL.ImageGrab.grab for more info