c ++中控制台中的颜色 [英] color in console in c++

查看:99
本文介绍了c ++中控制台中的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在c ++的控制台中的颜色我需要在方形圆三角形幼崽的控制台中画画或者我需要的任何东西我该怎么办。

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.

推荐答案

既然你已经在这里发布我假设你在谈论 Windows控制台 [ ^ ]



您使用 FillConsoleOutputAttribute [ ^ ]设置控制台上字符单元格的颜色信息。您使用控制台字体的字符进行绘制。



如果这不是您要查找的内容,您可以查看伴随源代码的DeviceContextExample < a href =http://www.codeproject.com/Articles/471662/Windows-Development-in-Cplusplus-working-with-menu>使用C ++进行Windows开发,使用菜单 [ ^ ]



代码比我在文章中记载的要多一些。



祝你好运

Espen Harlinn
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


这篇关于c ++中控制台中的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆