Can't go between text and graphics screens with PCOPY, but you could make a hack...
_COPYIMAGE??? No dammit, do it the hard way!!!
Pete
Lay off the weed and learn to read!
Pete :D
Who needs more?
Hey just look at our avatar choices! ;-))
*counts colors in Bplus avatar*
1... 2... 3... 4... .... ....?
Yep need those 16m colors!
But not sure how to get the colors from screen 0 to translate back in a 32 bit screen mode.
Quick run down of the process:
USE SCREEN(), POINT (), or _MEMIMAGE to get the color and character of each block on the text screen.
Create a graphic screen of WIDTH * _FONTWIDTH, HEIGHT * _FONTHEIGHT size
Now just set foreground, background color and PRINT each character, in place, on your graphical screen.
I kind of meant with the PEEK method where it just returns 0-255 for the color value. And even simpler, Screen 0 having a base of 0-15 colors.
It still returns a value from 0 to 255. 4 bits are foreground color, 3 bits are background, and the last bit toggles blinking on and off. You’ll need to MOD and \ your return value to get the colors used. ;)
But no way to directly translate the base(foreground) color to 32bit mode.
which seems odd since we can ,sort of, use 32bit colors in screen 0
COLOR _RGB(255,0,0)
least I believe _RGB() finds the nearest color in the available palette. But we cant reverse the process, presumably cause 32bit modes have no palette to compare from. However QB45 did have a base palette to work with, so maybe we could add that under the hood and pull the RGB values off of that internal palette?
It would make it easier to translate old QB45 code to QB64 if someone wanted to make use of a larger screen but didn't want to have to rewrite everything. Just change the SCREEN line but not have to worry about going through the code and changing all the COLOR statements. Yes probably a nitch scenario.
An augmentation of the COLOR statement, if used in 32bit mode to automatically choose from the palette if a value 0-255 is used?
Hey everybody, cover your eyes. Pete's FLASHING again!Code: QB64: [Select]
x0$ = "": x1$ = "" COLOR f, b ' Flashing 'PRINT ASC(MID$(x1$, i, 1)) MOD 16 + 16, ASC(MID$(x1$, i, 1)) \ 16 - 8 ' Non-Flashing
Just to prove there is a way in SCREEN 0 to differentiate flashing from non-flashing characters. I apologize in advance if I'm off on any of the color parameters. I didn't want to spend much time on this, so I didn't check it for accuracy. It's just to demonstrate the method I'd use to detect flashing colors on the screen, and preserve them, which PCOPY will not do on its own.
Just hold a key down to "flash" through all the color combos. When f > 15 "Pete..." will flash. The second line "Pete..." will flash as well, which is possible only because of the conditional color algorithm. Let me know if it needs any tweaking or if anything was missed. I may have actually made something like this 20+ years ago for a screen saver routine.
Pete
Code: QB64: [Select]
msg$ = "Cobalt's Sofa Kingdom :D"
Pete