Click here to Skip to main content
15,886,017 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
color in console in c++ i need draw in console like square circle triangle cub or any thing i need how can i do it.
Posted
Updated 15-Jan-18 11:47am

1 solution

Since you've posted this here I assume you are talking about the Windows Console [^]

You use the FillConsoleOutputAttribute[^] to set the color info for a character cell on the console. You the draw using the characters of the console font.

In case this was not what you where looking for, you could check out the DeviceContextExample accompanying the source code for Windows Development in C++, working with menus[^]

There is a wee bit more to the code than I've documented in the article.

Good luck
Espen Harlinn
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 11-Jun-13 19:52pm    
How come I missed some of those questions? My 5.
—SA
Espen Harlinn 12-Jun-13 15:50pm    
Thank you, Sergey :-D

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900