1问题
首先面板控件的pnlData_Paint(object sender, PaintEventArgs e)中是
以鼠标移动取了坐标而用DrawLine画了四线,刚好成十字形
那变量是从鼠标移动事件中赋值
二次作图
private void btnCurveMake_Click(object sender, EventArgs e)
{
Bitmap memBitmap = new Bitmap(this.pnlData.Width,this.pnlData.Height);
Graphics g = Graphics.FromImage(memBitmap);
this.drawTupu(g);
pnlData.BackgroundImage = memBitmap;
}
drawTupu()方法画了图谱
为了十字坐标能随着鼠标移动而动,那么用了 pnlData.Refresh();
可是这第二次的图不要刷新,而且当十字中心点在图谱上要读数
首先面板控件的pnlData_Paint(object sender, PaintEventArgs e)中是
以鼠标移动取了坐标而用DrawLine画了四线,刚好成十字形
那变量是从鼠标移动事件中赋值
二次作图
private void btnCurveMake_Click(object sender, EventArgs e)
{
Bitmap memBitmap = new Bitmap(this.pnlData.Width,this.pnlData.Height);
Graphics g = Graphics.FromImage(memBitmap);
this.drawTupu(g);
pnlData.BackgroundImage = memBitmap;
}
drawTupu()方法画了图谱
为了十字坐标能随着鼠标移动而动,那么用了 pnlData.Refresh();
可是这第二次的图不要刷新,而且当十字中心点在图谱上要读数
解决方案 »
- C# 百分求助,关于UDP发送速度的提高,遇到效率瓶颈了无法突破。
- winfrom中控制右键菜单的显示项目
- net socket通信
- 一道经典软件工程题目,求解。
- 为什么Constraints.Count=0?
- Winform form中控件的相对位置,最大化,最小化时
- 有人知道怎么在c#中用string变量的地址?
- Windows下的反向代理设计
- 请教大家一个很简单的页面数据装载问题,急啊,在线等
- 100分求一例!!!(ADO.net)最先答对得分,不够再加
- 如何写javascript脚本来验证TextBox的输入值是否为空
- 高手进来, printDocument1_PrintPage预览换页问题,谢谢
public void MouseEnvents(MouseEventArgs e)
{
if (e.X != currentPoint.X | | e.Y != currentPoint.Y)
{
currentPoint = new Point(e.X, e.Y);
this.Invalidate(true);
}
}
public void Piants(Pen pen1,Pen pen2,PaintEventArgs e)
{
e.Graphics.DrawLine(pen1, 0, currentPoint.Y, this.Width, currentPoint.Y); //绘制横线
e.Graphics.DrawLine(pen2, currentPoint.X, 0, currentPoint.X, this.Height); //会制纵线
}////调用
private void Form1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
MouseEnvents(e);
this.Invalidate(true);
}
protected override void OnPaint(PaintEventArgs e)
{
Piants(pen,pen,e);
}
这个标记就值,虽然不是我要的答案