vb 6.0 实时水情显示系统问题
我现想做一个河流断面的实时水情显示系统1 画一个简易河流断面
2 显示河流水位
3 显示警戒水位
4 河流水位以下用蓝色来表示
请问如何来实现,用哪些图表控件
vb 图表显示 --------------------编程问答-------------------- 自己用 PictureBox 或 Form 中 Line 一下可不可以,唉,“图表”、“控件”。 --------------------编程问答-------------------- Shape控件、Line控件等等。 --------------------编程问答--------------------
'窗体上加一个 PictureBox、一个 Timer 控件
Option Explicit
Private Const GRAPH_WIDTH As Long = 200
Private Const GRAPH_HEIGHT As Long = 100
Private Const WARNING_LEVEL As Long = 90
Private picRiverbed As IPictureDisp
Private Sub Form_Load()
Set picRiverbed = LoadPicture(App.Path & "\Riverbed.bmp")
Me.ScaleMode = vbPixels
With Picture1
.ScaleMode = vbPixels
.Move 8, 8, GRAPH_WIDTH + (.Width - .ScaleWidth), GRAPH_HEIGHT + (.Height - .ScaleHeight)
.AutoRedraw = True
.BackColor = vbBlack
End With
Randomize
Timer1.Interval = 500
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim lWaterLevel As Long
lWaterLevel = Int(Rnd() * 80) + 20
Picture1.Cls
Picture1.Line (0, GRAPH_HEIGHT - lWaterLevel)-(GRAPH_WIDTH, GRAPH_HEIGHT), vbBlue, BF
Picture1.Line (0, GRAPH_HEIGHT - WARNING_LEVEL)-(GRAPH_WIDTH, GRAPH_HEIGHT - WARNING_LEVEL), vbRed
Picture1.PaintPicture picRiverbed, 0, 0, , , , , , , vbSrcPaint
End Sub
河床用二色位图(Riverbed.bmp)——CSDN 不能上传 BMP
运行结果如下
--------------------编程问答-------------------- Tiger_Zhao 相当专业。 --------------------编程问答-------------------- 除
补充:VB , 控件