从起点/终点开始划线 [英] drwing line by start/end point

查看:157
本文介绍了从起点/终点开始划线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





Icant在起点/终点徘徊线



你可以帮我吗



按开始/结束点划线?





谢谢! [已删除电子邮件地址]

Hi

Icant drwing line by start/end point

can u help me for

drwing line by start/end point ?


Thanks ! [Email address removed]

推荐答案

您好,



如果您使用的是Windows窗体,请使用 Graphics.DrawLine 方法:

http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawline.aspx [ ^ ]

你可以画一条线表单 >绘制事件 [ ^ ]:

Hi,

If you use Windows Forms, then use the Graphics.DrawLine method:
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawline.aspx[^]
You can draw a line on your Form in the Paint event[^]:
// in constructor
public Form1()
{
    InitializeComponent();
    this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);
}
// Form1_Paint event handler:
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
    Graphics g = e.Graphics;
    g.DrawLine(Pens.Black, x1, y1, x2, y2);
}



如果你使用WPF,那么使用 System.Windows.Shapes.Line

http://msdn.microsoft.com/en- us / library / system.windows.shapes.line.aspx [ ^ ]

http://msdn.microsoft.com/en-us/library/ms742122.aspx [ ^ ]



错误修正[/编辑]


If you use WPF, then use System.Windows.Shapes.Line:
http://msdn.microsoft.com/en-us/library/system.windows.shapes.line.aspx[^]
http://msdn.microsoft.com/en-us/library/ms742122.aspx[^]

Error fixed[/Edit]


这篇关于从起点/终点开始划线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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