⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mand1.frm

📁 脑电波的模拟程序 不可多得 但是否真与脑电波相同还待进一步考察
💻 FRM
字号:
VERSION 5.00
Object = "{C1A8AF28-1257-101B-8FB0-0020AF039CA3}#1.1#0"; "MCI32.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1 
   AutoRedraw      =   -1  'True
   BackColor       =   &H00FF0000&
   BorderStyle     =   0  'None
   Caption         =   "曼德布罗集"
   ClientHeight    =   6795
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9510
   FillColor       =   &H00FFFF00&
   ForeColor       =   &H00C00000&
   Icon            =   "mand1.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   453
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   634
   ShowInTaskbar   =   0   'False
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   4560
      Top             =   3120
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.ComboBox Combo1 
      Height          =   315
      Left            =   8280
      TabIndex        =   15
      Top             =   2160
      Width           =   975
   End
   Begin VB.TextBox Text3 
      Height          =   264
      Left            =   360
      TabIndex        =   14
      Text            =   "Text3"
      Top             =   6360
      Visible         =   0   'False
      Width           =   3732
   End
   Begin VB.CommandButton cmdreg 
      Caption         =   "RE&GISTER"
      Enabled         =   0   'False
      Height          =   492
      Left            =   8280
      TabIndex        =   13
      Top             =   1080
      Visible         =   0   'False
      Width           =   972
   End
   Begin VB.Timer Timer2 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   4440
      Top             =   6240
   End
   Begin MCI.MMControl MMControl1 
      Height          =   495
      Left            =   4920
      TabIndex        =   12
      Top             =   6240
      Visible         =   0   'False
      Width           =   2895
      _ExtentX        =   6244
      _ExtentY        =   873
      _Version        =   393216
      DeviceType      =   ""
      FileName        =   ""
   End
   Begin VB.Timer Timer1 
      Interval        =   234
      Left            =   8280
      Top             =   6360
   End
   Begin VB.CommandButton rstcmd 
      Caption         =   "&RESET"
      Height          =   372
      Left            =   8280
      TabIndex        =   10
      Top             =   5760
      Width           =   972
   End
   Begin VB.TextBox Text2 
      Height          =   270
      Left            =   8280
      TabIndex        =   8
      Text            =   "Text2"
      Top             =   720
      Width           =   975
   End
   Begin VB.TextBox Text1 
      Height          =   270
      Left            =   8280
      TabIndex        =   7
      Text            =   "Text1"
      Top             =   360
      Width           =   975
   End
   Begin VB.TextBox tx0 
      Height          =   285
      Left            =   8280
      TabIndex        =   6
      Text            =   "-2.5"
      Top             =   2760
      Width           =   975
   End
   Begin VB.TextBox Ty0 
      Height          =   285
      Left            =   8280
      TabIndex        =   5
      Text            =   "-2"
      Top             =   3120
      Width           =   975
   End
   Begin VB.TextBox Twide 
      Height          =   285
      Left            =   8280
      TabIndex        =   4
      Text            =   "4"
      Top             =   3480
      Width           =   975
   End
   Begin VB.CommandButton cmdend 
      Caption         =   "&CLOSE"
      Height          =   495
      Left            =   8280
      TabIndex        =   3
      Top             =   5160
      Width           =   975
   End
   Begin VB.CommandButton cmdsave 
      Caption         =   "SA&VE"
      Height          =   495
      Left            =   8280
      TabIndex        =   2
      Top             =   4560
      Width           =   975
   End
   Begin VB.CommandButton cmdstart 
      Caption         =   "&START"
      Height          =   495
      Left            =   8280
      TabIndex        =   1
      Top             =   3960
      Width           =   975
   End
   Begin VB.PictureBox Picture1 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H00000000&
      Height          =   6000
      Left            =   0
      ScaleHeight     =   396
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   508
      TabIndex        =   0
      Top             =   0
      Width           =   7680
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "曼德布罗集"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FFC0FF&
         Height          =   240
         Left            =   0
         TabIndex        =   11
         Top             =   0
         Width           =   1200
      End
      Begin VB.Shape Shape1 
         BorderColor     =   &H00FFFFFF&
         Height          =   372
         Left            =   2400
         Top             =   1320
         Width           =   492
      End
   End
   Begin VB.Image ico 
      Height          =   495
      Left            =   8280
      Top             =   1080
      Width           =   975
   End
   Begin VB.Image Img 
      Height          =   480
      Index           =   4
      Left            =   4320
      Top             =   3360
      Visible         =   0   'False
      Width           =   480
   End
   Begin VB.Image Img 
      Height          =   480
      Index           =   3
      Left            =   4320
      Top             =   3360
      Visible         =   0   'False
      Width           =   480
   End
   Begin VB.Image Img 
      Height          =   480
      Index           =   2
      Left            =   4320
      Top             =   3360
      Visible         =   0   'False
      Width           =   480
   End
   Begin VB.Image Img 
      Height          =   480
      Index           =   1
      Left            =   4320
      Top             =   3360
      Visible         =   0   'False
      Width           =   480
   End
   Begin VB.Image Img 
      Height          =   480
      Index           =   0
      Left            =   4320
      Top             =   3360
      Visible         =   0   'False
      Width           =   480
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      BackColor       =   &H00FF0000&
      Caption         =   "  左下角  坐标及宽度   "
      ForeColor       =   &H00FFFFFF&
      Height          =   495
      Left            =   8280
      MousePointer    =   1  'Arrow
      TabIndex        =   9
      Top             =   1680
      Width           =   975
   End
   Begin VB.Menu fd 
      Caption         =   "放大"
      Visible         =   0   'False
      Begin VB.Menu zoom 
         Caption         =   "放大"
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim finish As Boolean
Dim x01 As Double, y01 As Double
Dim x02 As Double, y02 As Double, wide2 As Double
Dim x0 As Double, y0 As Double, wide As Double

Private Sub cmdend_Click()
MMControl1.Command = "close"
End
End Sub

Private Sub cmdreg_Click()
Dim ps As String
ps = InputBox("输入注册码:", "注册")
SaveSetting "MAND1", "曼德布罗集", "password", ps
End Sub

Private Sub cmdsave_Click()
Static num As Integer
num = num + 1
CommonDialog1.DefaultExt = "bmp"
CommonDialog1.FileName = "mand1-" & num
CommonDialog1.ShowSave
If CommonDialog1.FileName <> "" Then
SavePicture Picture1.Image, CommonDialog1.FileName
End If
End Sub

Private Sub cmdstart_Click()
Dim red As Integer, green As Integer, blue As Integer, times As Integer
Dim ix As Integer, iy As Integer
Dim X As Double, Y As Double, t As Double, zx As Double, zy As Double
Dim xs As Double, ys As Double
Dim inset As Boolean
x0 = x02
y0 = y02
wide = wide2
tx0.Text = x0
Ty0.Text = y0
Twide.Text = wide
Timer2.Enabled = False
cmdstart.Enabled = False
cmdend.Enabled = False
cmdsave.Enabled = False
Text3.Visible = False
finish = False
For ix = 0 To 499
For iy = 0 To 499
X = ix * wide / 500# + x0
Y = iy * wide / 500# + y0
zx = X
zy = Y
inset = True
times = 0
Do While inset And times < 1000
xs = zx * zx
ys = zy * zy
zy = 2 * zx * zy + Y
zx = xs - ys + X
If xs + ys > 4 Then inset = False
times = times + 1
Loop
If Not inset Then
red = (times * 5 + 59) Mod 255
blue = (times * 2 + 73) Mod 255
green = (times * 3 + 17) Mod 255
Picture1.PSet (ix, 500 - iy), RGB(red, green, blue)
Else
Picture1.PSet (ix, 500 - iy), RGB(0, 0, 0)
End If
Next iy
DoEvents
Next ix
cmdstart.Enabled = True
cmdend.Enabled = True
cmdsave.Enabled = True
finish = True
End Sub




Private Sub Form_Click()
MsgBox "请按<START>键!", vbExclamation + vbSystemModal
End Sub

Private Sub Form_Load()
Dim ps As String, fn As String, fn1 As String
MMControl1.Notify = False
MMControl1.wait = True
MMControl1.Shareable = False
MMControl1.DeviceType = "sequencer"
fn = App.Path
fn1 = Right$(fn, 1)
If fn1 = "\" Then fn = fn & "mand1.mid" Else fn = fn & "\mand1.mid"
Text3.Text = fn
MMControl1.FileName = fn
MMControl1.Command = "open"
MMControl1.Command = "play"
MsgBox "==欢迎光临==", vbInformation + vbSystemModal, "曼德布罗集..."
'Do
'x02 = Val(InputBox("左下角 X 坐标", "输入", "-2.5"))
'Loop While x02 = 0
'Do
'y02 = Val(InputBox("左下角 Y 坐标", "输入", "-2"))
'Loop While y02 = 0
'Do
'wide2 = Val(InputBox("宽度", "输入", "4"))
'Loop While wide2 = 0
x02 = tx0.Text
y02 = Ty0.Text
wide2 = Twide.Text
ps = GetSetting("MAND1", "曼德布罗集", "password")
If ps <> "1234567" Then
MsgBox "非法拷贝,请注册!", vbCritical + vbSystemModal, "你是盗版者"
cmdreg.Enabled = True
cmdreg.Visible = True
ico.Visible = False
cmdsave.Visible = False
End If
Picture1.DrawMode = 13
Picture1.AutoRedraw = True
Picture1.ScaleMode = 3
Picture1.Left = 5
Picture1.Top = 5
Shape1.Width = 25
Shape1.Height = 25
Picture1.Width = 500
Picture1.Height = 500
cmdstart.Default = True
MsgBox "下面的过程需要几分钟时间,请耐心等待!", vbQuestion, "准备好了吗?"
Timer2.Enabled = True
End Sub

Private Sub Picture1_mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If finish = True Then
x02 = x01
y02 = y01
wide2 = wide / 20#
tx0.Text = x02
Ty0.Text = y02
Twide.Text = wide2
End If
End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Shape1.Move X, Y - 25
X = X - 250
Y = 250 - Y
x01 = X * wide / 500# + 0.5 * wide + x0
y01 = Y * wide / 500# + 0.5 * wide + y0
Text1.Text = x01
Text2.Text = y01
End Sub

Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 And finish Then PopupMenu fd
End Sub

Private Sub rstcmd_Click()
Form_Load
cmdstart_Click
End Sub

Private Sub Timer1_Timer()
Static Imagen As Integer
If Label2.FontSize > 25 Then Label2.FontSize = 10
Label2.FontSize = Label2.FontSize + 1
If Imagen = 5 Then Imagen = 0
ico.Picture = Img(Imagen).Picture
Imagen = Imagen + 1
End Sub

Private Sub Timer2_Timer()
Static wait As Integer
wait = wait + 1
If wait = 10 Then
MsgBox "请按<START>键!", vbExclamation
Timer2.Enabled = False
End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -