VB里,在picturebox画曲线,把它autoredraw设为true,picturebox老闪烁,怎么办?
以下是代码,希望大家帮我看看,怎没办?先谢谢大家Picture1.Scale(0,Picture1.ScaleHeight)-(Picture1.ScaleWidth,0...
以下是代码,希望大家帮我看看,怎没办?先谢谢大家
Picture1.Scale (0, Picture1.ScaleHeight)-(Picture1.ScaleWidth, 0)
Line1(0).X1 = 0 '画横网格
Line1(0).X2 = Picture1.Width
Line1(0).Y1 = Picture1.Height / 22 - 15
Line1(0).Y2 = Picture1.Height / 22 - 15
For i = 1 To 20
Load Line1(i)
'Line1(i).BorderWidth = 1
Line1(i).X1 = 0
Line1(i).X2 = Picture1.Width
Line1(i).Y1 = (i + 1) * Picture1.Height / 22 - 15
Line1(i).Y2 = (i + 1) * Picture1.Height / 22 - 15
Line1(i).Visible = -1
Next i
Line2(0).X1 = Picture1.Width / 50 - 15 '画纵网格
Line2(0).X2 = Picture1.Width / 50 - 15
Line2(0).Y1 = 0
Line2(0).Y2 = Picture1.Height
For j = 1 To 51
Load Line2(j)
'Line2(j).BorderWidth = 1
Line2(j).X1 = (j + 1) * Picture1.Width / 50 - 15
Line2(j).X2 = (j + 1) * Picture1.Width / 50 - 15
Line2(j).Y1 = Line2(j - 1).Y1
Line2(j).Y2 = Line2(j - 1).Y2
Line2(j).Visible = -1
Next j
‘画实时曲线,当横坐标(时间)超过1小时,坐标值自动再加1小时,如此循环
Picture1.Scale (TimNO1A_QX_XH * 3 * 3600, 11)-((TimNO1A_QX_XH + 1) * 3 * 3600, 0)
Picture1.DrawWidth = 1
TimNO1A_QX_count = TimNO1A_QX_count + 1
NO1_DataSaveName_Count = NO1_DataSaveName_Count + 1
x_tim = TimNO1A_QX_count
y_NO1 = Val(Text1.Text)
y_NO2 = Val(Text12.Text)
y_NO3 = Val(Text18.Text)
Text23.Text = TimNO1A_QX_count
Text22.Text = TimNO1B_QX_count
Picture1.PSet (x_tim, y_NO1), RGB(255, 0, 0)
Picture1.PSet (x_tim, y_NO2), RGB(0, 255, 0)
Picture1.PSet (x_tim, y_NO3), RGB(0, 0, 255)
If x_tim >= (TimNO1A_QX_XH + 1) * 3 * 3600 Then
Label44(0).Caption = t2
Label45.Caption = t3
Label44(1).Caption = L3
Label44(2).Caption = L4
Label44(3).Caption = L5
Label44(4).Caption = L6
TimNO1_Cls_Tim
TimNO1B_QX_count = TimNO1A_QX_count
TimNO1B_QX_XH = TimNO1A_QX_XH
TimNO1A_QX.Enabled = False
TimNO1B_QX.Enabled = True
End If
End Sub
Private Sub TimNO1B_QX_Timer()
Dim x_tim As Single
Dim y_NO1 As Single
Dim y_NO2 As Single
Dim y_NO3 As Single
Picture1.Scale (TimNO1B_QX_XH * 3 * 3600, 11)-((TimNO1B_QX_XH + 1) * 3 * 3600, 0)
Picture1.DrawWidth = 1
TimNO1B_QX_count = TimNO1B_QX_count + 1
x_tim = TimNO1B_QX_count
y_NO1 = Val(Text1.Text)
y_NO2 = Val(Text12.Text)
y_NO3 = Val(Text18.Text)
Picture1.PSet (x_tim, y_NO1), RGB(255, 0, 0)
Picture1.PSet (x_tim, y_NO2), RGB(0, 255, 0)
Picture1.PSet (x_tim, y_NO3), RGB(0, 0, 255)
If TimNO1B_QX_count >= (TimNO1B_QX_XH + 1) * 3 * 3600 Then
TimNO1_Cls_Tim
TimNO1B_QX.Enabled = False
TimNO1A_QX.Enabled = True
End If
End Sub
Private Sub TimNO1_Cls_Tim()
Picture1.Cls
TimNO1_Cls.Enabled = False
TimNO1A_QX_XH = TimNO1A_QX_XH + 1
End Sub 展开
Picture1.Scale (0, Picture1.ScaleHeight)-(Picture1.ScaleWidth, 0)
Line1(0).X1 = 0 '画横网格
Line1(0).X2 = Picture1.Width
Line1(0).Y1 = Picture1.Height / 22 - 15
Line1(0).Y2 = Picture1.Height / 22 - 15
For i = 1 To 20
Load Line1(i)
'Line1(i).BorderWidth = 1
Line1(i).X1 = 0
Line1(i).X2 = Picture1.Width
Line1(i).Y1 = (i + 1) * Picture1.Height / 22 - 15
Line1(i).Y2 = (i + 1) * Picture1.Height / 22 - 15
Line1(i).Visible = -1
Next i
Line2(0).X1 = Picture1.Width / 50 - 15 '画纵网格
Line2(0).X2 = Picture1.Width / 50 - 15
Line2(0).Y1 = 0
Line2(0).Y2 = Picture1.Height
For j = 1 To 51
Load Line2(j)
'Line2(j).BorderWidth = 1
Line2(j).X1 = (j + 1) * Picture1.Width / 50 - 15
Line2(j).X2 = (j + 1) * Picture1.Width / 50 - 15
Line2(j).Y1 = Line2(j - 1).Y1
Line2(j).Y2 = Line2(j - 1).Y2
Line2(j).Visible = -1
Next j
‘画实时曲线,当横坐标(时间)超过1小时,坐标值自动再加1小时,如此循环
Picture1.Scale (TimNO1A_QX_XH * 3 * 3600, 11)-((TimNO1A_QX_XH + 1) * 3 * 3600, 0)
Picture1.DrawWidth = 1
TimNO1A_QX_count = TimNO1A_QX_count + 1
NO1_DataSaveName_Count = NO1_DataSaveName_Count + 1
x_tim = TimNO1A_QX_count
y_NO1 = Val(Text1.Text)
y_NO2 = Val(Text12.Text)
y_NO3 = Val(Text18.Text)
Text23.Text = TimNO1A_QX_count
Text22.Text = TimNO1B_QX_count
Picture1.PSet (x_tim, y_NO1), RGB(255, 0, 0)
Picture1.PSet (x_tim, y_NO2), RGB(0, 255, 0)
Picture1.PSet (x_tim, y_NO3), RGB(0, 0, 255)
If x_tim >= (TimNO1A_QX_XH + 1) * 3 * 3600 Then
Label44(0).Caption = t2
Label45.Caption = t3
Label44(1).Caption = L3
Label44(2).Caption = L4
Label44(3).Caption = L5
Label44(4).Caption = L6
TimNO1_Cls_Tim
TimNO1B_QX_count = TimNO1A_QX_count
TimNO1B_QX_XH = TimNO1A_QX_XH
TimNO1A_QX.Enabled = False
TimNO1B_QX.Enabled = True
End If
End Sub
Private Sub TimNO1B_QX_Timer()
Dim x_tim As Single
Dim y_NO1 As Single
Dim y_NO2 As Single
Dim y_NO3 As Single
Picture1.Scale (TimNO1B_QX_XH * 3 * 3600, 11)-((TimNO1B_QX_XH + 1) * 3 * 3600, 0)
Picture1.DrawWidth = 1
TimNO1B_QX_count = TimNO1B_QX_count + 1
x_tim = TimNO1B_QX_count
y_NO1 = Val(Text1.Text)
y_NO2 = Val(Text12.Text)
y_NO3 = Val(Text18.Text)
Picture1.PSet (x_tim, y_NO1), RGB(255, 0, 0)
Picture1.PSet (x_tim, y_NO2), RGB(0, 255, 0)
Picture1.PSet (x_tim, y_NO3), RGB(0, 0, 255)
If TimNO1B_QX_count >= (TimNO1B_QX_XH + 1) * 3 * 3600 Then
TimNO1_Cls_Tim
TimNO1B_QX.Enabled = False
TimNO1A_QX.Enabled = True
End If
End Sub
Private Sub TimNO1_Cls_Tim()
Picture1.Cls
TimNO1_Cls.Enabled = False
TimNO1A_QX_XH = TimNO1A_QX_XH + 1
End Sub 展开
若以下回答无法解决问题,邀请你更新回答
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询