Re: How to read rectangular part of screen, pixel-by-pixel?
- Posted by jimcbrown (admin) Jun 22, 2013
- 1478 views
I looked for information on the functions GetDC and GetColor.
It turned out that I stated the problem incorrectly. On another forum I was advised to make a screenshot of the entire screen, then read the desired pixels from array.
GetDC is the correct function to do this.
You can BitBlt from the value returned by GetDC to a screen buffer created by CreateCompatibleDC - color.exw does this. You should be able to read the values from there.
How to do so in Euphoria? I not understand, what is Device Contest. How to use it?
gbonvehi's example shows how to use this quite well, imho. He copies the pixels one by one instead of copying it to an array, but otherwise does what you ask... it should be simple to modify his example to, for example, save the screenshot into an image file on disk instead of copying the screenshot to another window.