You are here:

C/Any special tricks for textcolor & textbackground?

Advertisement


Question
1. With the "textbackground" function, how do I get all 16 background colors, instead of 8 background colors?
2. With the "textbackground" function, how can I get the 8 high intensity background colors, instead of the 8 low intensity background colors?
3. With the "textbackground" function, how can I set it back to the regular 8 low intensity background colors, instead of the 8 high intensity background colors?
4. Besides the "textattr" function, "textbackground" function, or "textcolor" function how can I get a bordered-colored frame over the screen? In GW-BASIC the command "COLOR ,,4" puts a red bordered-colored frame over the screen. How can I do that in Turbo-C, instead?
5. Does the "int86" function deal with colors?
Could you please E-Mail me back at joshblaize@juno.com ?


Answer
1. Its not possible with that function because its deniced in such a way !
2. same !
4. Possible but with little pain !

5. Its just an interrupt generating function , ROM-BIOS fuctions didn't have separate routine for that task!

Here i give you some code  , i think it will help you !

/*
Create a window border in a 80 x 50 mode
if your computer support typical 80 x 25 just change the last argument
in the window() function.
*/

#include <conio.h>
void main()
{
textbackground(RED);
window(1 , 1 ,80 , 50);
clrscr();
textbackground(BLACK);
window(2 , 2 , 79 , 49);
clrscr();
getch();
}  

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Prince M. Premnath

Expertise


I'm sure that I can solve any doubts in Turbo C ,Graphics Programing ,Mouse, Hardware Programming ,File System ,Interrupts, BIOS handling , TSR Programming , General Concepts in C Language, handling inline Assembly statements

Experience

Research over 6+ Years

Organizations
CG-VAK Softwares and Exports Limited

Education/Credentials
Masters in Computer Applications

©2012 About.com, a part of The New York Times Company. All rights reserved.