关于vb.net能画实时线吗的信息

vb.net Access数据库,按时绘制一天的数据的曲线,即24小时趋势曲线1、2,有多少数据就画多少曲线 , 前或后没有就断开呗,前后都没有就画横线 。
3,数据库按时间排序,选出最新时间值 , 然后根据这个值
,通过类似 select * from table where date#2010-8-20# and date#2007-8-23# 这样的语句选出往前两天的数据 。
vb.net 绘制实时温度曲线这个要用GDI 画 。要看你.net版本 。
以下是VS2005中的一段代码 。
Me.PictureBox1.Height = 450
Me.PictureBox1.Width = 880
Dim gr As Graphics '定义画布
Dim bp As New Bitmap(880, 450) '定义位图,并进行赋值
Dim p As New Pen(Color.Black) '定义画笔
p.Width = 2 '宽度2
p.DashStyle = Drawing2D.DashStyle.Solid '样式直线
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) '绘制横坐标
VB.NET 实时曲线拖一个PictureBox1控件 创建一个Paint事件 。在事件中加入Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint' Create pens.Dim redPen As New Pen(Color.Red, 3)Dim greenPen As New Pen(Color.Green, 3)' Create points that define curve.Dim point1 As New Point(50, 50)Dim point2 As New Point(100, 25)Dim point3 As New Point(200, 5)Dim point4 As New Point(250, 50)Dim point5 As New Point(300, 100)Dim point6 As New Point(350, 200)Dim point7 As New Point(250, 250)Dim curvePoints As Point() = {point1, point2, point3, point4, _point5, point6, point7}' Draw lines between original points to screen.e.Graphics.DrawLines(redPen, curvePoints)' Draw curve to screen.e.Graphics.DrawCurve(greenPen, curvePoints)End Sub得到数据后,改point的数据 。然后PictureBox1.Refresh()就行了
如何在VB中作实时曲线?最方便的方法是在vb中引用mschart部件 选择vb中的菜单:工程--部件---浏览将mschart20.ocx选中(必须是企业版才有该控件)
mschart控件最重要的属性就是data属性,给你一段代码参考就明白了:
ms是该控件的名字 datax 为一维数组 你可以修改datax的值然后再次运行代码
ms.ColumnCount = 1
ms.RowLabelCount = 0
ms.RowCount = UBound(datax) - LBound(datax)1
ms.Column = 1
For i = LBound(datax)1 To UBound(datax)1
ms.row = i
ms.Data = https://www.04ip.com/post/Val(datax(i - 1))
'DoEvents
Next
我这里刚好有一个实时曲线绘制的毕业设计,用vb做的不过要收费的,有意思可以打我电话:09918376733 上述代码就是从我的程序中摘录的,该包包是用vb做的,可以动态显示文本数据的曲线.
在程序运行时,你可以修改数组内容,然后在运行上述代码即可
vb.net实现实时数据采集曲线,有什么方法 , 或是书籍呢?简单说下思路吧,具体的代码可以查资料
首先要会画曲线图,有三种方法:
1、用mschar控件(vb6的);2、用水晶报表;3、用word图表
x轴为时间,y轴为数据
要实现实时数据刷新,只要用 定时器 定时刷新曲线图的数据就可以了(x、y的数据重写)
VB.NET怎么应用GDI画串口通讯数据的实时曲线拖一个PictureBox1控件
创建一个Paint事件 。在事件中加入
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
' Create pens.
Dim redPen As New Pen(Color.Red, 3)
【关于vb.net能画实时线吗的信息】Dim greenPen As New Pen(Color.Green, 3)
' Create points that define curve.
Dim point1 As New Point(50, 50)
Dim point2 As New Point(100, 25)
Dim point3 As New Point(200, 5)
Dim point4 As New Point(250, 50)
Dim point5 As New Point(300, 100)
Dim point6 As New Point(350, 200)
Dim point7 As New Point(250, 250)
Dim curvePoints As Point() = {point1, point2, point3, point4, _
point5, point6, point7}
' Draw lines between original points to screen.
e.Graphics.DrawLines(redPen, curvePoints)
' Draw curve to screen.
e.Graphics.DrawCurve(greenPen, curvePoints)
End Sub
得到数据后,改point的数据 。然后PictureBox1.Refresh()就行了
关于vb.net能画实时线吗和的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

    推荐阅读