如何使用c#在Windows窗体中绘制线条 [英] how do I draw lines in windows form using c#

查看:131
本文介绍了如何使用c#在Windows窗体中绘制线条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Windows窗体应用程序中绘制给出任何等式的不等式图。谢谢。我只需要想法和逻辑就可以了。

I need it in a windows form application to plot graph of inequalities given any equation. Thanks. I just need the idea and logic to do it.

推荐答案

请不要尝试使用解决方案1;在几乎所有情况下,它都行不通;无论如何,它没有给你一个如何让它工作的正确的想法。



请看我过去的答案:

什么样的俏皮方法是Paint? (DataGridViewImageCell.Paint(...)) [ ^ ],

在面板上捕获绘图 [ ^ ],

如何加速我的vb.net应用程序? [ ^ ],

用C#.net鼠标滚轮缩放图像 [ ^ ],

mdi子窗体之间的绘制线 [ ^ ]。



除此之外,您可以使用Microsoft图表:

http://msdn.microsoft.com/en-us/library/system.windows.forms.datavisualization.charting.chart%28v=vs.110%29.aspx [ ^ ](对于.NET v.4.0-4.5)。



对于.NET 3.5,您可以下载Microsoft Chart Controls对于Microsoft .NET Framework 3.5:

http://www.microsoft.com/en-us/download/details.aspx?id=14422 [ ^ ]。



-SA
Please don't try to use Solution 1; in almost all cases, it won't work; anyway, it does not give you a right idea on how to make it working.

Please see my past answers:
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[^],
capture the drawing on a panel[^],
How to speed up my vb.net application?[^],
Zoom image in C# .net mouse wheel[^],
Drawing Lines between mdi child forms[^].

Besides, you can use Microsoft Charts:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datavisualization.charting.chart%28v=vs.110%29.aspx[^] (for .NET v.4.0-4.5).

For .NET 3.5, you can download Microsoft Chart Controls for Microsoft .NET Framework 3.5:
http://www.microsoft.com/en-us/download/details.aspx?id=14422[^].

—SA


Graphics gdi = this.CreateGraphics();
            gdi.DrawLine(Pens.Red, new Point(0, 0), new Point(100, 100));


这篇关于如何使用c#在Windows窗体中绘制线条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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