怎么样加快picturebox的绘图速度?
系统平台是WINCE 5.0
开发工具 VB.NET 2008
我自定义在Picturebox上建立一个坐标系,然后再这个坐标系上根据采集的数据绘制波形曲线如下图所示
我采集数据点大概有6000point
下面是我的程序段
其中点的计算是放在线程里的
'放在线程里计算的
For iCount = 0 To UBound(volArr)
Drawpoints(iCount).X = iCount / k * 58 * 10 + Org_x
Drawpoints(iCount).Y = Org_Y - volArr(iCount) * 31
Next
lbl_Xyplot.Text = CStr(Environment.TickCount - starttime) '绘制坐标轴耗时 显示43ms
If Not volArr Is Nothing Then
linepen.Width = 2
linepen.Color = Color.Green
xyplot.DrawLines(linepen, Drawpoints) '绘制波形
lbl_WAVE.Text = CStr(Environment.TickCount - starttime) '显示波形耗时 显示5183ms
volArr = Nothing
RecDataArr = Nothing
End If
'PictureBox重绘过程
Private Sub PictureBox1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
xyplot = e.Graphics '生成XYplot
DrawXYPlotCanvas()
End Sub