向dotos同志学习,公布源码。
Option Explicit
Dim Data(1 To 256) As Byte
Dim XiangWei As Double
Dim DataLenth As Integer
Const PI = 3.14159265
Private Sub Command1_Click()
XiangWei = 0
If XXXXXXXXXXlue = True Then
XiangWei = (3 / 2) * PI
End If
Timer1.Enabled = True
Frame1.Enabled = False
Command1.Enabled = False
Command2.Enabled = True
XXXXXXXXXsible = True
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
Frame1.Enabled = True
Command1.Enabled = True
Command2.Enabled = False
XXXXXXXXXsible = False
End Sub
Private Sub Form_Load()
Dim i As Integer
For i = 1 To 256
Data(i) = i - 1
Next i
End Sub
Private Sub ImageOut(ByVal Times As Integer)
Dim i As Integer
For i = 1 To Times
XXXXXXXXXXXndData Data
Next i
DataLenth = Times
End Sub
Private Sub Timer1_Timer()
If XXXXXXXXXXlue = True Then
'******正弦波*****
Call ImageOut(Int((Sin(XiangWei) + 1) * 40))
XiangWei = XiangWei + PI / 150
ElseIf XXXXXXXXXXlue = True Then
'******据齿波*******
Call ImageOut(Int(((XiangWei + 30) Mod 30) * 4))
XiangWei = XiangWei + 0.1
ElseIf XXXXXXXXXXlue = True Then
'******方波*******
If XiangWei Mod 30 > 15 Then Call ImageOut(80) Else Call ImageOut(0)
XiangWei = XiangWei + 0.1
ElseIf XXXXXXXXXXlue = True Then
'******三角波*******
If XiangWei Mod 30 <= 15 Then
Call ImageOut(Int(XiangWei Mod 30) * 4)
Else
Call ImageOut((30 - Int(XiangWei Mod 30)) * 4)
End If
XiangWei = XiangWei + 0.1
End If
XXXXXXXXXption = DataExchange(DataLenth * 256) & "/s"
End Sub
Private Function DataExchange(ByVal Datee As Long) As String
On Error Resume Next
If Datee <= 1024 Then
DataExchange = Str(Datee) & "Byte"
Exit Function
End If
If Datee > 1204 And Datee < 1048576 Then
DataExchange = Str(Int(Datee / 1024)) & "KB"
Exit Function
End If
DataExchange = Format(Datee / 1048576, "#########.##") & "MB"
End Function