110,539
社区成员
发帖
与我相关
我的任务
分享
//dbPointModulusX X轴上当前刷新到的坐标 dbModulus 根据分辨率算得的一个系数值
dbPointModulusX += dbModulus;
if (dbPointModulusX >= this.panShow.Width)
{
dbPointModulusX = 0;
pLastA.X = (int)dbPointModulusX;
pLastA.Y = this.panShow.Height / 2;
}
Graphics g = Graphics.FromImage(BitBackDraw);
//设置高质量插值法
g.InterpolationMode = InterpolationMode.Default;
//设置高质量,低速度呈现平滑程度
g.SmoothingMode = SmoothingMode.Default;
//断开效果
Rectangle rect1 = new Rectangle((int)dbPointModulusX, 0, 2, this.panShow.Height);
g.FillRectangle(new SolidBrush(Color.Black), rect1);
//将背景图截2个像素的宽度放到画波形的位图上
g.DrawImage(BitBackImage, new Rectangle((int)dbPointModulusX, 0, 2, BitBackDraw.Height), new Rectangle((int)dbPointModulusX, 0, 2, BitBackImage.Height), GraphicsUnit.Pixel);
Point pNewA = new Point();
pNewA.X = (int)dbPointModulusX;
pNewA.Y =this.panShow.Height / 2;
Pen pen = new Pen(Color.Green, 2);
Point[] points = new Point[2] { pLastA, pNewA };
g.DrawLines(pen, points);
pLastA.X = pNewA.X;
pLastA.Y = pNewA.Y;
g = this.panShow.CreateGraphics();
g.DrawImage(BitBackDraw, 0, 0);
g.Dispose();