当然,在很多情况下,只需要考虑 默认坐标系统并应用你可能需要的任何转换 。 您应该查看上面的MSDN文档,并尝试实现您需要的。一旦你这样做了,如果你有更具体的 问题,请随时问这些。 PeteIn what context do you want to draw this? Should it be a new Controlclass? Do you just want to draw into a Form?Generally speaking, you draw either handling the Paint method for aControl instance (which can be a control contained by a form or a formitself), or you implement a class that inherits Control and in which youoverride the OnPaint method (this is particularly convenient for drawinginto forms, since you''re usually creating a new derived class anyway).In the Paint method, you can get a Graphics instance from thePaintEventArgs parameter and use that instance to draw. The Graphicsclass has a variety of methods on it useful for drawing, includingDrawLine, DrawLines, FillRectangle, FillEllipse, and DrawString (to namea few that could be useful for what you''re describing).As far as the coordinate system goes, by default the coordinate systemhas the origin at the top-left of the Control''s client area. However,you can change this by creating a transformation matrix and applying itto the Graphics instance before drawing (see the Matrix class and theGraphics.Transform property). Using this, you can do a variety ofthings, including moving the origin to any other position and changingthe direction of the axes.Of course, in many cases it suffices to simply take into account thedefault coordinate system and apply whatever conversion you might needexplicitly.You should take a look at the MSDN docs for the above and try toimplement what you need. Once you''ve done so, if you have more specificquestions, please feel free to ask those as well.Pete 你想在什么情况下画这个?它应该是一个新的Control 级吗?你只想画一张表格吗?In what context do you want to draw this? Should it be a new Controlclass? Do you just want to draw into a Form? 表格中的是。yes into a form. 如果工作,下一步是我想实现最短路。 我可以到达每一点。 示例1到4是可能的 2到4是可能的。 你有一个例子吗? 问候Petraif working, the next step is I want to implement the shortest way.I can arrive every point.Example 1 to 4 is possible2 to 4 is alo possible.Do you have a example?Regards Petra 我不明白你的意思。什么到达每一点是什么意思? 按最短的方式,你的意思是代码最少吗?最快的 代码?自己做最少量的实际编程?某种与你的数据相关的计算? 你为我写的内容有太多可能的解释 能够搞清楚。请更具体(如果可能的话, 或许可以让某人帮你翻译...我尽量不要给b $ b麻烦人们他们的英语技能,但是这种情况似乎可以创造一个真正的沟通障碍。 PeteI don''t understand what you mean. What does "arrive every point" mean?By "shortest way", do you mean the least amount of code? The fastestcode? Doing the least amount of actual programming yourself? Some sortof calculation related to your data?There are too many possible interpretations of what you wrote for me tobe able to figure it out. Please be more specific (and if possible,perhaps get someone to help you with the translation...I try not tohassle people about their English skills, but in this case it seems tobe creating a genuine communication barrier).Pete 这篇关于C# - 坐标系,绘图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-28 23:14