1

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'
Ankur Ankan
  • 2,953
  • 2
  • 23
  • 38
user2487237
  • 11
  • 1
  • 2

1 Answers1

0

If you're not a programmer, I'm afraid you're out of luck on this site. Here you can get the kind of answers that'll help you help yourself, but people don't like to write your code for you.

That said, here's a question that might get you started: Is there a faster alternative to GDI GetPixel()?

Hope you'll be able to use it.

Community
  • 1
  • 1
alexis
  • 48,685
  • 16
  • 101
  • 161