关于用timer画动态图闪烁的问题
我用timer画一个动态图,但是每次都闪烁,而且程序有点卡,即使在timer里图形都不是一次性出来,都是一点点的显示,请教各位了,我的源码:(mdata 是我从硬件得到的动态数据)
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Timer1.Enabled = False
Dim pen As System.Drawing.Pen
pen = System.Drawing.Pens.Red
PictureBox1.Refresh()
Dim xunit As Single
Dim yunit As Single
xunit = PictureBox1.ClientRectangle.Width / 3648
yunit = PictureBox1.ClientRectangle.Height / 65535
For i = 0 To 3647 Step 1
PictureBox1.CreateGraphics.DrawLine(pen, xunit * i, 541 - yunit * Mdata(i), xunit * (i + 1), 541 - yunit * Mdata(i + 1))
Next
Timer1.Enabled = True
End Sub