private float x3 = 0;
private float y3 = 0;
private float x4 = 0;
private float y4 = 0;
private bool ZedGraphControl4_MouseDownEvent(ZedGraph.ZedGraphControl sender, MouseEventArgs e)
{
x3 = e.X;
y3 = e.Y;
return default(bool);
}
private bool ZedGraphControl4_MouseUpEvent(ZedGraph.ZedGraphControl sender, MouseEventArgs e)
{
x4 = e.X - x3;
y4 = e.Y - y3;
Graphics g;
g = zedGraphControl4.CreateGraphics();
Pen pen = new Pen(Color.Red, 1);
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDot;
g.DrawRectangle(pen, x3, y3, x4, y4);///四點畫出框
return default(bool);
}
private bool ZedGraphControl4_MouseMoveEvent(ZedGraph.ZedGraphControl sender, MouseEventArgs e)
{
float x5 = e.X - x3;
float y5 = e.Y - y3;
Graphics g;
g = zedGraphControl4.CreateGraphics();
Pen pen = new Pen(Color.Red, 1);
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDot;
g.DrawRectangle(pen, x3, y3, x5, y5);///畫框程序怎么實作?
return default(bool);
}
uj5u.com熱心網友回復:
小白求教,根據已有代碼怎么實作畫框程序?還有滑鼠坐標怎么綁zedGraph創建的坐標系uj5u.com熱心網友回復:
TRACKER 示例:闡釋各種 CRectTracker 樣式和選項https://docs.microsoft.com/zh-cn/previous-versions/visualstudio/visual-studio-2008/ms177537(v=vs.90)
uj5u.com熱心網友回復:
看不懂啊老師,我這例子可不可以簡單加段代碼實作呢?
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/255683.html
標籤:C語言
上一篇:關于求反三角函式函式。
