Home > Back-end >  C language console print below content
C language console print below content

Time:10-19

CodePudding user response:

C + + console to display graphical interface? Impossible!
You can try the following function
 void set_color (int cor) {
SetConsoleTextAttribute (GetStdHandle (STD_OUTPUT_HANDLE), cor);
/*
Words
1 dark blue
Dark green,
23 teal
4 deep red
5 deep pink
6 yellow
7 deep white
8 gray
9 the light blue
10 pale green
11 light cyan
12 shallow red
13 pale pink
14 buff
15 light white

Background
1 ~ 15 black
16 ~ 31 dark blue
32 ~ 47 dark green
48 ~ 63 teal
64 ~ 79 crimson
From 80 to 95 deep pink
From 96 to 111 deep yellow
From 112 to 127 deep white
128 ~ 143 gray
Light blue 144 ~ 159
160 ~ 175 light green
176 ~ 191 shallow blue
192 ~ 207 shallow red
208 ~ 223 light pink
224 ~ 239 buff
240 ~ 255 light white
*/
}

You can try this, you can display colors (foreground and background, can be adjusted at any time, without full screen tone)
  • Related