📄 form6.frm
字号:
VERSION 5.00
Begin VB.Form Form6
BackColor = &H00FFFFFF&
Caption = "动画显示机构运动"
ClientHeight = 9090
ClientLeft = 60
ClientTop = 345
ClientWidth = 8295
LinkTopic = "Form6"
ScaleHeight = 9090
ScaleWidth = 8295
StartUpPosition = 1 '所有者中心
WindowState = 2 'Maximized
Begin VB.HScrollBar HScroll1
Height = 255
LargeChange = 30
Left = 12600
Max = 300
Min = 1
SmallChange = 5
TabIndex = 2
Top = 5400
Value = 50
Width = 2175
End
Begin VB.HScrollBar HScroll3
Height = 255
Left = 12600
Max = 3000
TabIndex = 11
Top = 7320
Value = 1500
Width = 2175
End
Begin VB.Frame Frame1
BackColor = &H00FFFFFF&
Caption = "位置调节"
Height = 2175
Left = 12360
TabIndex = 15
Top = 6960
Width = 2655
Begin VB.HScrollBar HScroll5
Height = 255
Left = 240
Max = 10000
Min = 100
TabIndex = 17
Top = 1560
Value = 500
Width = 2175
End
Begin VB.HScrollBar HScroll4
Height = 255
Left = 240
Max = 3000
TabIndex = 16
Top = 960
Value = 1500
Width = 2175
End
End
Begin VB.HScrollBar HScroll2
Height = 255
Left = 12600
Max = 5000
Min = 10
TabIndex = 9
Top = 6000
Value = 200
Width = 2175
End
Begin VB.PictureBox Picture1
BackColor = &H00FFFFFF&
FillColor = &H00FFFFFF&
Height = 10000
Left = 120
ScaleHeight = 13260
ScaleMode = 0 'User
ScaleWidth = 9945
TabIndex = 8
Top = 120
Width = 10000
End
Begin VB.CommandButton Command4
Caption = "退出"
Enabled = 0 'False
Height = 375
Left = 14160
TabIndex = 6
Top = 10200
Width = 975
End
Begin VB.CommandButton Command3
BackColor = &H8000000A&
Caption = "继续"
Enabled = 0 'False
Height = 375
Left = 14160
TabIndex = 5
Top = 9720
Visible = 0 'False
Width = 975
End
Begin VB.TextBox Text1
Alignment = 1 'Right Justify
BackColor = &H00FFFFFF&
Height = 270
Left = 11520
TabIndex = 4
Text = "0.05"
Top = 9360
Width = 495
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 500
Left = 10560
Top = 5040
End
Begin VB.CommandButton Command2
Caption = "暂停"
Enabled = 0 'False
Height = 375
Left = 14160
TabIndex = 1
Top = 9720
Visible = 0 'False
Width = 975
End
Begin VB.CommandButton Command1
Caption = "播放"
Height = 375
Left = 14160
TabIndex = 0
Top = 9720
Width = 975
End
Begin VB.Frame 速度调节
BackColor = &H00FFFFFF&
Caption = "速度调节"
Height = 1575
Left = 12360
TabIndex = 13
Top = 5040
Width = 2655
End
Begin VB.Label Label5
BackColor = &H00FFFFFF&
Caption = "左边距: 下边距: 比例:"
Height = 1695
Left = 11400
TabIndex = 12
Top = 7320
Width = 855
End
Begin VB.Label Label4
BackColor = &H80000009&
Caption = "步进调节: 刷新时间:"
Height = 855
Left = 11400
TabIndex = 14
Top = 5400
Width = 975
End
Begin VB.Label Label3
Alignment = 1 'Right Justify
BackColor = &H00FFFFFF&
Caption = "200"
Height = 255
Left = 13200
TabIndex = 10
Top = 9360
Width = 375
End
Begin VB.Label Label2
Alignment = 1 'Right Justify
BackColor = &H00FFFFFF&
Caption = "1"
Height = 255
Left = 14640
TabIndex = 7
Top = 9360
Width = 495
End
Begin VB.Label Label1
BackColor = &H00FFFFFF&
Caption = "刷新时间: 秒 比例: 计算点数:"
Height = 255
Left = 10680
TabIndex = 3
Top = 9360
Width = 3855
End
End
Attribute VB_Name = "Form6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command2_Click() '暂停建
Me.Timer1.Enabled = False '刷新停止
Me.Command2.Enabled = False '按键对换
Me.Command3.Enabled = True
Me.Command2.Visible = False
Me.Command3.Visible = True
End Sub
Private Sub Command3_Click() '继续按键
Me.Timer1.Enabled = True
Me.Command2.Enabled = True
Me.Command3.Enabled = False
Me.Command2.Visible = True
Me.Command3.Visible = False
End Sub
Private Sub Command1_Click() '播放按键
Me.Command2.Enabled = True
Me.Command4.Enabled = True
Me.Command1.Enabled = False
Me.Command1.Visible = False
Me.Command2.Visible = True
linkages.getvalue '取得值,准备计算
Me.Timer1.Enabled = True '计时间开始
End Sub
Private Sub Command4_Click() '退出按键
Unload Me
End Sub
Private Sub Form_Load()
Picture1.DrawWidth = 2
Me.HScroll1.Value = linkages.Text9.Text * 10
End Sub
Private Sub HScroll2_Change() '调节刷新时间
Me.Text1.Text = Me.HScroll2.Value / 5000
End Sub
Private Sub HScroll5_Change() '比例
Me.Label3.Caption = Me.HScroll5.Value / 500
End Sub
Private Sub Text1_Change()
Me.Timer1.Interval = Me.Text1.Text * 10000
End Sub
Private Sub Timer1_Timer()
Me.Timer1.Interval = Me.Text1.Text * 1000
Me.Label2.Caption = Me.Label2.Caption + 1
Me.Picture1.Cls '对上次的图进行擦除
linkages.BJ = (Me.HScroll1.Value / 180) * 3.14159265358979
linkages.jisuan '计算
Dim Left, Button, r1, r2, r3, r4, bili, tRAB As Double
bili = Me.HScroll5.Value / 100
Left = Me.HScroll3.Value / 10 - 150
Button = Me.HScroll4.Value / 10 - 150
Picture1.Scale (-150, 150)-(150, -150)
'画两个圆
'如果是rab为负——————————————————————————————————————————
If linkages.RAB < 0 Then
tRAB = -linkages.RAB
r3 = linkages.L5 / (4 + 2 / tRAB)
r1 = 2 * r3
r2 = r1 / tRAB
Me.Picture1.Circle (Left, Button), r1 * bili, RGB(0, 0, 255)
Me.Picture1.Circle (Left + linkages.L5 * bili, Button), r2 * bili, RGB(255, 0, 0)
Me.Picture1.Circle (Left + (r1 + r3) * bili, Button), r3 * bili, RGB(0, 255, 255)
Me.Picture1.CurrentX = Left
Me.Picture1.CurrentY = Button
Me.Picture1.Line -(Left + linkages.XB * bili, Button + linkages.YB * bili)
Me.Picture1.Line -(Left + linkages.XC * bili, Button + linkages.YC * bili)
Me.Picture1.Line -(Left + linkages.XD * bili, Button + linkages.YD * bili)
Me.Picture1.Line -(Left + linkages.XE * bili, Button + linkages.YE * bili)
Me.Picture1.Line -(Left, Button)
Me.Picture1.Line (Left + linkages.XB * bili, Button + linkages.YB * bili)-(Left + linkages.XF * bili, Button + linkages.YF * bili)
FillStyle = 0
Me.Picture1.Circle (Left, Button), bili / 7
Me.Picture1.Circle (Left + linkages.XB * bili, Button + linkages.YB * bili), bili / 7
Me.Picture1.Circle (Left + linkages.XC * bili, Button + linkages.YC * bili), bili / 7
Me.Picture1.Circle (Left + linkages.XD * bili, Button + linkages.YD * bili), bili / 7
Me.Picture1.Circle (Left + linkages.XE * bili, Button + linkages.YE * bili), bili / 7
Me.Picture1.Circle (Left + linkages.XF * bili, Button + linkages.YF * bili), bili / 7
Me.Picture1.Circle (Left + (r1 + r3) * bili, Button), bili / 7
FillStyle = 1
linkages.Y1 = linkages.Y1 + linkages.BJ '角度1=初始角度+步进角度
linkages.Y4 = linkages.Y4 + linkages.BJ * tRAB
Else
r2 = linkages.L5 / (linkages.RAB + 1)
r1 = linkages.L5 - r2
Me.Picture1.Circle (Left, Button), r1 * bili, RGB(0, 0, 255)
Me.Picture1.Circle (Left + linkages.L5 * bili, Button), r2 * bili, RGB(255, 0, 0)
Me.Picture1.CurrentX = Left
Me.Picture1.CurrentY = Button
Me.Picture1.Line -(Left + linkages.XB * bili, Button + linkages.YB * bili)
Me.Picture1.Line -(Left + linkages.XC * bili, Button + linkages.YC * bili)
Me.Picture1.Line -(Left + linkages.XD * bili, Button + linkages.YD * bili)
Me.Picture1.Line -(Left + linkages.XE * bili, Button + linkages.YE * bili)
Me.Picture1.Line -(Left, Button)
Me.Picture1.Line (Left + linkages.XB * bili, Button + linkages.YB * bili)-(Left + linkages.XF * bili, Button + linkages.YF * bili)
FillStyle = 1
Me.Picture1.Circle (Left, Button), bili / 7
Me.Picture1.Circle (Left + linkages.XB * bili, Button + linkages.YB * bili), bili / 7
Me.Picture1.Circle (Left + linkages.XC * bili, Button + linkages.YC * bili), bili / 7
Me.Picture1.Circle (Left + linkages.XD * bili, Button + linkages.YD * bili), bili / 7
Me.Picture1.Circle (Left + linkages.XE * bili, Button + linkages.YE * bili), bili / 7
Me.Picture1.Circle (Left + linkages.XF * bili, Button + linkages.YF * bili), bili / 7
FillStyle = 0
linkages.Y1 = linkages.Y1 + linkages.BJ '角度1=初始角度+步进角度
linkages.Y4 = linkages.Y4 - linkages.BJ * linkages.RAB
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -