简单说:
我想实现火焰切割的动态仿真。
首先根据加工零件绘制加工图形,然后根据返回数据动态仿真
如图
现在我是这么做的。
在定时器里panel1.refrsh();
private void panel1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
g.DrawImage(bmp, 20, 20);
p2.X = (int)((Parameter.GInfo.X - drawImage.xMin) * drawImage.ScaleFactor + 20);
p2.Y = (int)(drawImage.Height - (Parameter.GInfo.Y - drawImage.yMin) * drawImage.ScaleFactor + 20);
Graphics gg = Graphics.FromImage(bmpp);
gg.DrawLine(drawPen, p1.X, p1.Y, p2.X, p2.Y);
g.DrawEllipse(pennn, Convert.ToInt32(p2.X - 3), Convert.ToInt32(p2.Y - 3), 6, 6);
g.FillEllipse(new SolidBrush(Color.Chartreuse), Convert.ToInt32(p2.X - 3),
Convert.ToInt32(p2.Y - 3), 6, 6);
p1 = p2;
g.DrawImage(bmpp, 0, 0);
}
这样会一直闪。
应该怎么做,详细点,别光说个双缓冲区完了。具体怎么实现,panel怎么不能setstyle.