I am trying to read a graphic clock from my screen, but it's too slow. The part of the code posted is only for one number of 10 , and 6 positions. self.pp is to add an offset.
Is there a faster way to do this, where I can use all the coordinates (they took some time to find =)
BTW, I'm not a programmer!
from ctypes import windll
dc= windll.user32.GetDC(0)
def getpixel(self,x,y):
return windll.gdi32.GetPixel(dc,x,y)
if ( # look for the number 0
self.getpixel(1803+self.pp,27) == 16777215
and self.getpixel(1804+self.pp,37) == 16777215
and self.getpixel(1798+self.pp,33) == 16777215
and self.getpixel(1799+self.pp,36) == 16777215
and self.getpixel(1809+self.pp,31) == 16514043
and self.getpixel(1810+self.pp,32) == 0
):
pos1 = '0'