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

Update quickstart.rst to include region and title Locate plus mention ImageNotFoundException #847

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ On Linux, you must run `sudo apt-get install scrot` to use the screenshot featur
<PIL.Image.Image image mode=RGB size=1920x1080 at 0x24C3EF0>
>>> pyautogui.screenshot('foo.png') # returns a Pillow/PIL Image object, and saves it to a file
<PIL.Image.Image image mode=RGB size=1920x1080 at 0x31AA198>
>>> pag.screenshot(region=(0, 100, 300, 200)) # returns a Pillow/PIL Image object of the screen region (x, y, w, h)
<PIL.Image.Image image mode=RGB size=300x200>

Locate Image on Screen Functions
--------------------------------

If you have an image file of something you want to click on, you can find it on the screen with `locateOnScreen()`.

Expand All @@ -144,7 +149,7 @@ The `locateCenterOnScreen()` function just returns the XY coordinates of the mid
>>> pyautogui.locateCenterOnScreen('looksLikeThis.png') # returns center x and y
(898, 423)

These functions return `None` if the image couldn't be found on the screen.
These functions raise `ImageNotFoundException` if the image couldn't be found on the screen.

Note: The locate functions are slow and can take a full second or two.