The reason this doesn't work on graphic screens is rather simple -- SCREEN has to do OCR to try ang get those characters back from a graphical screen.
On SCREEN 0, character data is stored *perfectly* in two bytes for each character on the screen. One is COLOR, the other is the ASCII character stored on the screen.
On any other graphic screen there's no information recorded anywhere which records those characters on the screen. They're just colored *pixels*. PICTURES of characters, if you want, and QB64PE tries very pitifully to see if the character you have on the screen happens to match the font for that screen.
What it does is basically grab a fontwidth by fontheight square at the location you specify. Then it looks for what might be the first color and what might be the second. Got more colors than two? It BLAHs out instantly and says, "I have no idea how the hell a three color picture can be a character!"
It wants a foreground and a background color -- two colors.
Then it compares that foreground color with the current font and looks for the closest match.
Then it returns some garbage and says, "Ehh! I guess this is your character?!"
And.... It's occasionally right. In some cases.
BUT -- it's *always* wrong in others.
Quick -- someone tell me what the difference is in a CHR$(0) printed, a CHR$(32) printed, and a CHR$(255) printed. One is a null character, the other is a plain space, and the last is a non-breaking space.
For OCR (Object Character Recognition), tell me how the hell those three things *LOOK* different.
Show Content
SpoilerThey don't
In *NO* graphic screen will you ever get back the character you expect if you're dealing with various blank spaces. You'll also probably not get back a lot of information properly as fonts can be the cut off and not display fully due to clipping or other issues. If you're off by a single pixel, that changes the closest possible match for your character, so it's going to be wrong. If there's a stray color or line or pixel that was plotted by something else on the screen... It's going to screw up the results. If you have more than two colors, that's going to screw up the results.
It's not very good OCR at all, and IMHO it shouldn't even work *at all* for anything other than SCREEN 0. I don't think QB45 promised anything with SCREEN giving you back characters in non-text mode. Did it even attempt to do it, or just toss an error? I don't recall.
The reason why it *sometimes* works with SCREEN 12 and 256 color modes is you're not dealing with any blending or alpha or mixing of colors. A 32-bit screen has a transparent background by default. It deals with alpha colors. It does automatic blending. It has so many extra hoops that other screens *don't* have, AFAIK it just craps out and says, "Hahahaha!! Good luck with that!", and tosses a CHR$(219) for anything and everything without even trying to sort out all the mess that could be going on with the pixels on that screen.
Fonts have to match.
There can't be any more than two colors.
Pixel position has to be perfect.
There can't be any stray lines, points, or imperfections on the screen.
You have to sacrifice three pygmies and dance naked under the harvest moon.
No blending can have happened.
No alpha can be in use.
Characters can't look the same (such as the three various different spaces in CHR$ 0, 32, 255.)
So, with allllll those restrictions in mind, you can *TRY* to use SCREEN to get back characters from a non-text screen.
Just don't be surprised when it fails or gives false results.