I am capturing a screen shot, but then the image was already


image,   how do I .load it ?

it's not image.load()




import time
import ImageGrab  # Part of PIL
from ctypes import *

class RECT(Structure):
 _fields_ = [
   ('left', c_ulong),
   ('top', c_ulong),
   ('right', c_ulong),
   ('bottom', c_ulong)
   ]


GetForegroundWindow = windll.user32.GetForegroundWindow
GetWindowRect = windll.user32.GetWindowRect


rect = RECT()
foreground_window = GetForegroundWindow()
GetWindowRect(foreground_window, byref(rect))
image = ImageGrab.grab((rect.left, rect.top, rect.right, rect.bottom))



print time.time()

pix = image.load()
print pix[x, y]

x = 0
y = 0
for x in xrange(1,1024,1):
 for y in xrange(1,768,1):
   print pix[10,10]
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to