【发布时间】:2012-03-17 13:29:27
【问题描述】:
和this一模一样,但是没有形式上的限制,我需要能够得到矩形坐标。
感谢每一点帮助!
【问题讨论】:
-
可能是this 之类的?
标签: c# select desktop capture area
和this一模一样,但是没有形式上的限制,我需要能够得到矩形坐标。
感谢每一点帮助!
【问题讨论】:
标签: c# select desktop capture area
我希望您能够按照链接中给出的代码绘制矩形。 Draw Rectangle
现在,您想要获取坐标 X、Y、左、右。 在 Form1_Move 中添加以下新行。
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Rect = new Rectangle(Rect.Left, Rect.Top, e.X - Rect.Left, e.Y - Rect.Top);
label3.Text = Rect.Left.ToString();
label4.Text = Rect.Top.ToString();
label1.Text = e.X.ToString();
label2.Text = e.Y.ToString();
}
this.Invalidate();
}
【讨论】: