View Feed
group-icon
Coffee Room
Discuss anything here - everything that you wish to discuss with fellow engineers.
12890 Members
Join this group to post and comment.
enthudrives
enthudrives • May 16, 2009

Decorate output in C

When we execute a C program, the output is printed on the black screen by default. I want this output to be decorated. I want it on a well designed background. How to do it?
RajdeepCE
RajdeepCE • May 16, 2009
I dont think so that we can change the default output screen of our compiler. May be we can just change the colour but cant replace by wallpaper or any other graphics.
enthudrives
enthudrives • May 16, 2009
I came to know that the most popular Mario game was designed using C++. Then how was it done?
RajdeepCE
RajdeepCE • May 17, 2009
Yes we can make graphics with c++ by using standard header file .. But it is very slow when we load graphics while using common c++ programs, cause it takes more time to load graphics compare to simple I/O. And there is one more problem with that if we dont use properly than the our text output will be overwritten by the graphic you just loaded. So buddy just leave the thought of decorating output if you want to make your program effective & fast.
enthudrives
enthudrives • May 17, 2009
Consider that my code is "If user enters 1. The output is ONE"
I want the user to enter the input and get the output on a screen which looks like a notebook or slate.

I cant leave this idea.
P.S:This is just an example. I know it sounds childish
RajdeepCE
RajdeepCE • May 17, 2009
Hey buddy, you just said to make a output window like notepad in c++. Its a tough task. Cause I have already learnt " Computer Graphics " subject. And whenever we loads the graphics it overwrites the text already printed. And if we write text after loading the graphics, the text will be written in next frame, that means that your text will appear at below the screen. There is some other method in C++ to load text with graphics, but I dont know too much about it. I am also learning on GUI in C/C++, lets hope we both found some solution here.
yamrajbhalla
yamrajbhalla • May 17, 2009
bro the ide that when u type 1 it prints out one is nt easy bt a lil bit big programm
like u hve to use
logic
like for 1=one upto ten than 11==eleven and 12=tewlev etc bt afert that twenty +1,thrity +1 and so on

i think u ll be able to think about the logic
enthudrives
enthudrives • May 17, 2009
@Rajdeep
I hope some day or the other, someone who knows about it will reply here. Until then, let us keep thinking. 😉
@Yamraj
What? Is it not easy? Cant get you man..
RajdeepCE
RajdeepCE • May 17, 2009
Hey yamrajbhalla, its not just about converting number in words. Its about showing the output in new graphics background instead of original default black screen.
itskay007
itskay007 • May 19, 2009
not just in c++, you can give a background in c as well..
using textbackground function in conio.h
jst run a loop, give a background to every character till the end of the screen
then go back to the first position using gotoxy();
soniyo
soniyo • Mar 2, 2013
to change background follow these steps:-
goto file->dosshell->type color fc_>press enter->type exit;
fc change your font color into red and background into white.
soniyo
soniyo • Mar 2, 2013
to change background follow these steps:-
goto file->dosshell->type color fc->press enter->type exit;
fc change your font color into red and background into white.
soniyo
soniyo • Mar 2, 2013
to change background follow these steps:-
goto file->dosshell->type color fc->press enter->type exit;
fc change your font color into red and background into white.
soniyo
soniyo • Mar 2, 2013
to change background follow these steps:-
goto file->dosshell->type color fc->press enter->type exit;
fc change your font color into red and background into white.
soniyo
soniyo • Mar 2, 2013
enthudrives
When we execute a C program, the output is printed on the black screen by default. I want this output to be decorated. I want it on a well designed background. How to do it?
to change background follow these steps:-
goto file->dosshell->type color fc_>press enter->type exit;
fc change your font color into red and background into white.
instead of doing the things manually like soniyo said, you can let your program change the color.. using system("color hex"); where hex means a hexadecimal number..
rahul69
rahul69 • Mar 11, 2013
enthudrives
When we execute a C program, the output is printed on the black screen by default. I want this output to be decorated. I want it on a well designed background. How to do it?
There are multiple ways to do it, you can do whichever suits your purpose:
  1. You can use Windows Programming to create a window and display the output as desired, without having to print it inside a console
  2. You can use some API like Opengl to give the desired color and decoration.
Hope it helps!😀

Share this content on your social channels -