leng-yue / py-scrcpy-client

An easy to use python scrcpy client
https://leng-yue.github.io/py-scrcpy-client/
MIT License
257 stars 67 forks source link

Get color and/or text present in the screen #63

Open leksuss opened 1 month ago

leksuss commented 1 month ago

I can't find it in documentation. Is there any way to get pixel color based on it coordinates? Also, can I check some text string presence in the screen?

tokoroten commented 4 weeks ago

hi @leksuss

https://github.com/leng-yue/py-scrcpy-client/blob/main/scrcpy/core.py#L239C25-L239C40 For your first question, you can use client.last_frame[y, x].

The client.last_frame represents the Android screen. You can perform OCR on this image using any OCR software.