November 20th, 2004, 10:57 PM
Screen Shot Question
I'm looking for some help getting python to take a screenshot. I searched online for something, but couldn't find anything. I checked the PIL as well. I basically want python to do the following:
1. Notice movement on the screen
2. take a screen shot
3. Pass it on to a few if/else statements
4. Click on the screen a particular button.
1,2, and 4 I am unsure how to impliment, but using the PIL I can figure out 3.
November 21st, 2004, 12:13 PM
I think the better way of doing this is not by taking screenshots (since those often don't include the cursor and presumably you want to watch for cursor movement), but rather hooking into whatever window system the user is using. Whether it be the Win32 system or the X Window System or Aqua (or whatever the Mac OS windowing system is).
Originally Posted by Noah_C
November 21st, 2004, 01:04 PM
Well, I basically want to be able to play perfect blackjack in windows. So I basically would have it do the following steps.
1. Take screen shot
2. know that from (x,y) to (x,y) by (x,y) to (x,y) is card1, and then do that for all cards displayed.
3. Pass that information on to some programming logic
4. Respond by clicking a button in the program
Is the win32 route still the right route to take ?
Thank you for your suggestion.
November 21st, 2004, 03:23 PM
Yup, Mac OS X's Native Window System is called Aqua. But there's also a Mac port/application called X11 which is used to run X Window programs inside Mac OS X . Tend to be a little crappy looking though.
Originally Posted by Strike
November 23rd, 2004, 06:51 PM
I found what I'm looking for.... PIL Handbook
the Imagegrab.grab is what is needed, but I'm not sure how to use it. why won't the following code work ?
ImageGrab.grab(x0, y0, x1, y1) = im
November 24th, 2004, 04:36 AM
Doesn't this require image recognition?
How will your program know what cards are dealt, are face up, in the pile etc?
hmmm ... You image grab assignment is a*** about face.
Last edited by Grim Archon; November 24th, 2004 at 04:48 AM.