【VB开源代码栏目提醒】:网学会员VB开源代码为您提供PicDraw.frm参考,解决您在PicDraw.frm学习中工作中的难题,参考学习。
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5640
ClientLeft = 60
ClientTop = 345
ClientWidth = 6585
ForeColor = &H00C0C0C0&
LinkTopic = "Form1"
ScaleHeight = 5640
ScaleWidth = 6585
StartUpPosition = 3 '窗口缺省
Begin VB.PictureBox Picture4
Height = 2310
Left = 225
ScaleHeight = 2250
ScaleWidth = 6180
TabIndex = 4
Top = 2340
Width = 6240
Begin VB.PictureBox Picture2
AutoRedraw = -1 'True
BackColor = &H80000000&
Height = 1995
Left = 120
ScaleHeight = 1935
ScaleWidth = 5925
TabIndex = 5
Top = 120
Width = 5985
End
End
Begin VB.PictureBox Picture3
Height = 2160
Left = 210
ScaleHeight = 2100
ScaleWidth = 6180
TabIndex = 2
Top = 105
Width = 6240
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
BackColor = &H80000000&
Height = 1890
Left = 105
ScaleHeight = 1830
ScaleWidth = 5925
TabIndex = 3
Top = 90
Width = 5985
End
End
Begin
VB.CommandButton Command2
Caption = "曲线"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 480
Left = 3825
TabIndex = 1
Top = 4905
Width = 2295
End
Begin VB.CommandButton Command1
Caption = "网格曲线"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 480
Left = 480
TabIndex = 0
Top = 4905
Width = 2295
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Const PI = 3.1415926
Private Sub Command1_Click()
Dim i As Integer
Dim s As Double
Dim t As Double
Dim myrange As UserArray
myrange.MinX = 0
myrange.MaxX = 10 * PI
myrange.MinY = -1.2
myrange.MaxY = 1.2
InitialGrid Picture1, myrange
For i = 0 To 1000
s = PI / 100 * i
t = Sin(s)
DrawLine Picture1, 0, t, s, myrange, vbGreen
Next i
myrange.MinX = 0
myrange.MaxX = 1000
myrange.MinY = 0
myrange.MaxY = 11
For i = 0 To 1000
s = i
t = 10 * (1 - Exp(-s / 100))
DrawLine Picture1, 1, t, s, myrange, vbRed
Next i
End Sub
Private Sub Command2_Click()
Dim i As Integer
Dim s As Double
Dim t As Double
Dim myrange As UserArray
myrange.MinX = 0
myrange.MaxX = 1000
myrange.MinY = 0
myrange.MaxY = 11
For i = 0 To 1000
s = i
t = 100 * Abs((s Mod 100) / 1000)
DrawLine Picture2, 2, t, s, myrange, vbBlue
Next i
End Sub