I have seen some programs that used colors beyond &H8 for its background like the old Norton Utilities that used &HF. How can I do this programmatically?
Can I do this strictly QB or with the aid of ASSEMBLY? Can you provide a code?
Background Colors in Text Mode
- DDastardly71
- Coder
- Posts: 22
- Joined: Fri Oct 17, 2008 6:56 pm
- Location: U.S.A.
-
- Veteran
- Posts: 703
- Joined: Sun Nov 14, 2004 7:36 am
- Contact:
You can use extra colors by setting blinking mode off which turns intensity on. which allows colors 9 through 15 to be used as background color.
Here's a link to a microsoft article on the subject with sample QB code (which works with pds, vb-dos and qb 4.5
http://support.microsoft.com/kb/50945
Here's a link to a microsoft article on the subject with sample QB code (which works with pds, vb-dos and qb 4.5
http://support.microsoft.com/kb/50945
When God created light, so too was born, the first Shadow!
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
- DDastardly71
- Coder
- Posts: 22
- Joined: Fri Oct 17, 2008 6:56 pm
- Location: U.S.A.
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
SCREEN 0 is the only mode with high intensity blinking colors above 15 that does not need Interrupt code.
By default when running full-screen, this makes the foreground blink rather than making the background brighter.
(But this also happens if you use CALL INTERRUPTX.) You can also:
T% = INP(&H3DA) 'read first (discarded)
OUT &H3C0, &H10
T% = INP(&H3C1) 'use in final setting
OUT &H3C0, &H10
OUT &H3C1, T% AND NOT 8
to switch from flashing to background-intensity mode.
By default when running full-screen, this makes the foreground blink rather than making the background brighter.
(But this also happens if you use CALL INTERRUPTX.) You can also:
T% = INP(&H3DA) 'read first (discarded)
OUT &H3C0, &H10
T% = INP(&H3C1) 'use in final setting
OUT &H3C0, &H10
OUT &H3C1, T% AND NOT 8
to switch from flashing to background-intensity mode.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
- DDastardly71
- Coder
- Posts: 22
- Joined: Fri Oct 17, 2008 6:56 pm
- Location: U.S.A.
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
That should work, but you have to use CLS to spread the background over the screen. That is one problem with screen 0. The background will only show up under PRINTs otherwise.
COLOR 0, 15: CLS
PRINT "Hello"
It should NOT blink as only the forecolors above 15 blink! Just add 16 to a normal color. If you want to stop the blinking, add my code above at the beginning of the program. The background CANNOT BLINK!
COLOR 0, 15: CLS
PRINT "Hello"
It should NOT blink as only the forecolors above 15 blink! Just add 16 to a normal color. If you want to stop the blinking, add my code above at the beginning of the program. The background CANNOT BLINK!
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
-
- Veteran
- Posts: 111
- Joined: Sat Feb 21, 2009 8:19 am
- Location: New York, U.S.
The COLOR command takes the blinking option in the foreground color parameter as Foreground Color + 16. To have a high-intensity background, add 16 to the foreground color and use Color AND 7 as the background color.COLOR 0, 15: CLS
Joseph Rose, a.k.a. Harry Potter
Creating magic in the computer community...or at least striving to!
Creating magic in the computer community...or at least striving to!