QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: Zeppelin on September 06, 2018, 01:39:47 am
-
Why doesn't QB64 allow for reading pixels (getting RGB values) outside of the program window?
There are several other languages that allow this type of data collection why not QB64.
Thanks
Zeppelin
-
Technically you can, if you do a screen copy and read the POINT from that handle. I've used such method more than once for automating certain tasks, and letting the computer play through some repetitive game parts.
-
_SCREENIMAGE is the command your looking for.
-
Allows. Even in two ways. One is backwards compatible with Quick Basic, using POINT, the other is very fast with MEM. You can read the color values on any program screen and on the desktop. The snapshot of the workspace do _SCREENIMAGE (it does not work in Linux), and the motion on virtual screens in turn allows _DEST and _SOURCE so the user sees SCREEN 0 while the program reads an image.
PRINT "You are on text screen"
PRINT "Reading color values used on desktop. Press key..."
_MEMGET m
, m.OFFSET
+ all_pixels
, kolor
_MEMPUT N
, N.OFFSET
+ all_pixels
, kolor
PRINT "MEM output. Press any key for do the same using POINT and PSET..."
PRINT "Press key for show image draw by PSET" PRINT "Press key for end"