如何在控制台中绘制圆. [英] How to draw a circle in a Console.

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

问题描述



如何在控制台窗口中绘制形状(圆形).

Hi,

How can I Draw a shape (Circle) in a Console window.

Console.Write("Something"); //To write something

Console.???; //To Draw a circle

推荐答案

那真的不是那么容易:控制台应用程序不是面向图形的-它们是基于字符的,并且您的输出仅限于可以打印到屏幕上的字符-没有DrawLine或DrawElipse函数. >
如果您真的要这样做,那么,最好的办法就是在Google上搜索"ASCII艺术圈",然后看看您得到了什么.但是请记住,控制台一次只能显示多少行是有限的,因此您的垂直分辨率永远都不会很好.

我建议您改用WinForms应用程序.
That is really not that easy: Console applications are not Graphics oriented - they are character based, and your outputs are limited to the characters you can print to the screen - there are no DrawLine or DrawElipse functions.

If you really, really want to do this,. then your best best is to google for "ASCII art circle" and see what you get. But do remember that the console is limited in how many lines it can display at one time, so your vertical resolution is never going to be much good.

I would recommend that you use a WinForms application instead.


其他人提到了它-控制台不是用于绘图的-但是我想知道我能做些什么:这是我想出的.

Others mentioned it - Console is not for drawing - But I was curiose what I could do: here is what I came up with.

Console.WriteLine(@"    -     ");
Console.WriteLine(@"  /   \   ");
Console.WriteLine(@" |     |  ");
Console.WriteLine(@"  \   /   ");
Console.WriteLine(@"    -     ");



抱歉,您的问题不是关键任务".



Sorry for kind of "fun" answer - but your question is for shure nothing mission critical.


这篇关于如何在控制台中绘制圆.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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