我需要一些绘图帮助! [英] I need some help for drawing!
问题描述
PLS我需要在C#上绘制一些帮助
1.什么应用程序? (控制台,Win表格或其他任何东西)
2.如何在2分之间写一条线?
3.如何写一个圆圈?
4.如何制作像立方体或球体这样的3D东西?
我需要这个!请一些帮助!
我问的很多! Sry!
:)
PLS I NEED SOME HELP WITH THE DRAWING ON C#
1. What Application? (Console, Win Forms or anything else)
2. How to write a line between 2 points?
3. How to write a circle?
4. How to do a 3D thing like cube or sphere?
I need this! Pls some help!
I am asking much! Sry!
:)
推荐答案
控制台应用程序不适合此类任务。
您可以使用Windows Forms $轻松满足积分
2
和3
c $ c>(例如,参见使用C#在WinForms中使用图形绘图 [ ^ ])。
对于点4
(3D
形状),您可以考虑使用XNA
(例如,参见绘制3D基元使用列表或条带 [ ^ ]。。
Console applications are not suited for such tasks.
You may easily satisfy points2
and3
usingWindows Forms
(see, for instance "Drawing with Graphics in WinForms using C#"[^]).
For point4
(3D
shapes) you may consider usingXNA
(see, for instance, "Drawing 3D Primitives using Lists or Strips"[^]).
你不能使用控制台应用程序 - 它们是基于文本的,并且绘制线条意味着将星星放在正确的位置 - 繁琐且很少有效(谷歌为ASCII艺术,你会发现一些例外)。
So Winforms, WPF,或XNA。
最简单的是Winforms:
在表单中添加一个面板,并处理它的Paint事件。
在处理程序中,添加以下内容:
You can''t use a console app - they are text based, and drawing lines means putting stars in the right place - tedious and rarely effective (google for "ASCII Art" and you''ll find some exceptions).
So Winforms, WPF, or XNA.
The simplest is Winforms:
Add a panel to a form, and handle it''s Paint Event.
In the handler, add the following:
Graphics g = e.Graphics;
然后,您可以使用图形上下文直接在面板表面绘制:
You can then use the graphics context to draw directly on the panel surface:
Point p1 = new Point(10, 10);
Point p2 = new Point(100, 200);
g.DrawLine(Pens.Red, p1, p2);
g.DrawEllipse(Pens.Green, new Rectangle(p1, new Size(75, 75)));
将画一条红线和一个绿色圆圈。
绘制3D物体通常需要做很多工作,而且我建议您在考虑转向3D之前先获得2D的良好基础。
Will draw a Red line, and a Green circle.
Drawing 3D objects is generally a lot more work, and I would suggest that you get a good grounding in 2D first, before you think of moving to 3D.
这篇关于我需要一些绘图帮助!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!