HI all
I want to Programm something that reads out the Top screen and analyse it ( in real I want to find a chess board )
I can get the primary screen in a DC
now i must find a rectangle in it
therefor I need the point(X,Y) colors of the DC but
I cant find a function for this.
The sense of the Project is to let 2 Chess Programms play against each other over IP.
Can someone give me a hint
Use Point with a DC
Maybe a better way to achieve this is to break the board down into a simple 2d array (x,y) 'Dim'ed from a Structure describing that square (empty/what piece is there). Then just communicate this array between programs and let the AI use the opponents array for making descisions. Then display the results to the screen in a nicely drawn chess board. Maybe a little easier than trying to find out what is being displayed on the screen, etc.The sense of the Project is to let 2 Chess Programms play against each other over IP.

Isn't there some API call to get the width and height of a DC?! I would assume there is some anyways.. then you'd be able to grab it as an image, and transmit this as a file over the network.. I think?!? 

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
To retrieve a colour at the given coord (WinAPI):
To retrieve the width and height of the device context use (WinAPI):
Get a Good WinAPI reference and all can be found, try here:
http://www.garyw.uklinux.net/PB/WIN32.zip
or
http://www.mentalis.org/agnet/apiguide.shtml
Code: Select all
RGBValue = GetPixel_(HDC, XPos, YPos);
Code: Select all
GetBoundsRect_(HDC, Bounds.RECT, #NULL)
Debug Bounds\Right
Debug Bounds\Bottom
http://www.garyw.uklinux.net/PB/WIN32.zip
or
http://www.mentalis.org/agnet/apiguide.shtml