我用VB写了一个画线的程序,请问怎么显示画曲线过程
程序如下:
Timer1.Interval = 10000 '100毫秒
Timer1.Enabled = True
Picture1.CurrentX = pen(1).PenPointx
Picture1.CurrentY = pen(1).PenPointy
For temp1 = 1 To pointcount - 1
Timer1_Timer
Next temp1
Private Sub Timer1_Timer()
If (pen(temp1).PenPointx = -1 And pen(temp1).PenPointy = -1) Then
Picture1.CurrentX = pen(temp1 + 1).PenPointx * (1 / 2)
Picture1.CurrentY = pen(temp1 + 1).PenPointy * (1 / 2)
Else
Picture1.Line -(pen(temp1).PenPointx * (1 / 2), pen(temp1).PenPointy * (1 / 2))
End If
If (temp1 Mod 6 = 0) Then
Timer1.Interval = 0
Timer1.Enabled = False
End If
'这行写上画到一定长度停止timer1的判断代码
End Sub
我是想每画6个点,就触发一次
Timer1.Interval设这么大了,怎么还是没效果?
Timer1.Interval = 10000 '100毫秒
Timer1.Enabled = True
Picture1.CurrentX = pen(1).PenPointx
Picture1.CurrentY = pen(1).PenPointy
For temp1 = 1 To pointcount - 1
Timer1_Timer
Next temp1
Private Sub Timer1_Timer()
If (pen(temp1).PenPointx = -1 And pen(temp1).PenPointy = -1) Then
Picture1.CurrentX = pen(temp1 + 1).PenPointx * (1 / 2)
Picture1.CurrentY = pen(temp1 + 1).PenPointy * (1 / 2)
Else
Picture1.Line -(pen(temp1).PenPointx * (1 / 2), pen(temp1).PenPointy * (1 / 2))
End If
If (temp1 Mod 6 = 0) Then
Timer1.Interval = 0
Timer1.Enabled = False
End If
'这行写上画到一定长度停止timer1的判断代码
End Sub
我是想每画6个点,就触发一次
Timer1.Interval设这么大了,怎么还是没效果?
...全文
相关推荐
一个在VB中利用picture控件画曲线的程序
通过随机数函数产生数据,每0.5秒采集一次数据,用picture控件将数据画在界面上。
VB实现串口通信与实时动态曲线显示
VB的集成开发环境(IDE)是为开发者提供的一套工具集,用于编写、调试和运行VB应用程序。IDE包括一个代码编辑器、图形用户界面(GUI)设计工具、项目管理器和调试工具。在早期版本中,VB IDE是作为Visual Studio套件的一部分提供的,但在后续版本中,微软将VB的开发环境独立出来。IDE的布局非常直观,主要分为几个区域:工具箱(Toolbox)、窗体设计视图(Form Designer)、属性窗口(Properties Window)和代码编辑器(Code Editor)。
VB画曲线控件
一个VB可以画曲线的控件,支持任意大小的缩放,包含例程。
vb画曲线很实用的小程序
很实用的小程序,很强大,自己觉得不错,给大家分享
用vb画曲线
描述vb画曲线的函数参数含义及画各种曲线方法。


