这个要用GDI+画.要看你.net版本.
Dim gr As Graphics '定义画布
Dim p As New Pen(Color.Black) '定义画笔
PictureBox1.Image = bp
gr = Graphics.FromImage(PictureBox1.Image)
gr.FillRectangle(Brushes.White, New Rectangle(0, 0, PictureBox1.Width, PictureBox1.Height))
gr.DrawLine(p, a, b, a, .Height - b) '绘制纵坐标
gr.DrawLine(p, a, .Height - b, .Width - a, .Height - b) '绘制横坐标
简单说下思路吧,具体的代码可以查资料
首先要会画曲线图,有三种方法:
x轴为时间,y轴为数据
要实现实时数据刷新,只要用 定时器 定时刷新曲线图的数据就可以了(x、y的数据重写)
您好,您是想问vb.net连续绘制曲线图不消失怎么办?b.net连续绘制曲线图不消失的解决办法如下:
①.、首先必须创建bitmap,关联到picturebox1.image上.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Timer1.Enabled = True
Next
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Static j As Long
j = j + 1
PictureBox1.Image = x_y(PictureBox1, j)
Private Function x_y(ByVal pic As PictureBox, ByVal x As Long) As Bitmap
Dim b As New Bitmap(pic.Width, pic.Height)
Dim g As Graphics = Graphics.FromImage(b)
Dim c
Dim j
g.Clear(Color.YellowGreen)
Dim p As New Pen(Color.WhiteSmoke)
Dim i As Double
Dim bs As New SolidBrush(Color.Red)
Dim po As New Point
po.X = 0
g.DrawString(Math.Round(i, 1), Me.Font, bs, po.X, po.Y)
Dim p1 As New Pen(Color.Blue)
End If
For i = 0 To Points1.Count - 1
g.DrawCurve(Pens.Red, Points1)
'For i = 0 To Points1.Count - 1
'g.DrawString(Math.Sin(i), Me.Font, Brushes.Red, Points1(i))
'Next
Return b
End Function
以上就是土嘎嘎小编为大家整理的关于vb.net实时曲线的信息相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!