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

📄 mandelbrot.frm

📁 不错的一个VB菜单设计 界面和功能都不错
💻 FRM
字号:
VERSION 5.00
Object = "{75D4F53D-8785-11D3-93AD-0000832EF44D}#2.2#0"; "FAST2002.ocx"
Begin VB.Form frmMandelbrot 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "FWFractal"
   ClientHeight    =   2880
   ClientLeft      =   2595
   ClientTop       =   2265
   ClientWidth     =   7695
   Icon            =   "Mandelbrot.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2880
   ScaleWidth      =   7695
   ShowInTaskbar   =   0   'False
   Begin VB.CheckBox chkInvert 
      Caption         =   "Invert Colors"
      Height          =   375
      Left            =   2745
      Style           =   1  'Graphical
      TabIndex        =   7
      Top             =   765
      Width           =   1215
   End
   Begin FLWGraphMath.FWMandelbrot objMandelbrot 
      Height          =   2655
      Left            =   120
      Top             =   120
      Width           =   2535
      _ExtentX        =   4471
      _ExtentY        =   4683
      Enabled         =   -1  'True
      BorderStyle     =   9
      Object.ToolTipText     =   ""
      MaxIterations   =   200
      ColorCount      =   255
      AllowZoom       =   -1  'True
   End
   Begin VB.CheckBox chkColors 
      Caption         =   "View Colors"
      Height          =   375
      Left            =   2745
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   1170
      Width           =   1215
   End
   Begin VB.CommandButton cmdZoomOut 
      Caption         =   "Zoom Out"
      Height          =   375
      Left            =   2745
      TabIndex        =   5
      Top             =   1980
      Width           =   1215
   End
   Begin VB.CommandButton cmdReset 
      Caption         =   "Reset"
      Height          =   375
      Left            =   2745
      TabIndex        =   4
      Top             =   1575
      Width           =   1215
   End
   Begin VB.CommandButton cmdDraw 
      Caption         =   "Draw"
      Height          =   375
      Left            =   2745
      TabIndex        =   3
      Top             =   2385
      Width           =   1215
   End
   Begin VB.TextBox txtIterations 
      Height          =   285
      Left            =   2760
      TabIndex        =   1
      Text            =   "200"
      Top             =   360
      Width           =   1095
   End
   Begin VB.Label lblLabel 
      BackStyle       =   0  'Transparent
      Caption         =   "Max. iterations"
      Height          =   195
      Left            =   2760
      TabIndex        =   2
      Top             =   120
      Width           =   1020
   End
   Begin VB.Label lblColor 
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   1  'Fixed Single
      Height          =   150
      Index           =   0
      Left            =   4320
      TabIndex        =   0
      Top             =   120
      Width           =   150
   End
End
Attribute VB_Name = "frmMandelbrot"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit


Private Sub Form_Activate()
  DoEvents
  cmdDraw.Value = True
End Sub

Private Sub Form_Load()
  Dim lngInd   As Long
  Dim lngScale As Long
  
  lngScale = Me.ScaleMode
  Me.ScaleMode = vbPixels
  
  objMandelbrot.ColorCount = 255
    
  lblColor(0).BackColor = objMandelbrot.Color(0)
  For lngInd = 1 To objMandelbrot.ColorCount
    Load lblColor(lngInd)
    With lblColor(lngInd)
      If lngInd Mod 16 = 0 Then
        .Top = lblColor(lngInd - 1).Top + 11
        .Left = lblColor(0).Left
      Else
        .Left = lblColor(lngInd - 1).Left + 11
        .Top = lblColor(lngInd - 1).Top
      End If
      .Visible = True
      .BackColor = objMandelbrot.Color(lngInd)
    End With
  Next
  chkColors.Value = vbChecked
  
  Me.ScaleMode = lngScale
End Sub

Private Sub Form_Unload(Cancel As Integer)
  Dim lngInd As Long
  
  For lngInd = objMandelbrot.ColorCount To 1 Step -1
    Unload lblColor(lngInd)
  Next
End Sub

Private Sub chkInvert_Click()
  Dim lngAux As OLE_COLOR
  Dim lngInd As Long
  
  With objMandelbrot
    For lngInd = 0 To .ColorCount / 2
      lngAux = .Color(lngInd)
      .Color(lngInd) = .Color(.ColorCount - lngInd)
      .Color(.ColorCount - lngInd) = lngAux
    Next
    
    For lngInd = 0 To .ColorCount
      lblColor(lngInd).BackColor = .Color(lngInd)
    Next
    DoEvents
    
    Call .draw
  End With
End Sub

Private Sub chkColors_Click()
  If chkColors.Value = vbChecked Then
    Me.Width = 7200
  Else
    Me.Width = 4200
  End If
End Sub

Private Sub cmdReset_Click()
  Call objMandelbrot.Reset
  Call objMandelbrot.draw
End Sub

Private Sub cmdZoomOut_Click()
  Call objMandelbrot.ZoomOut
  Call objMandelbrot.draw
  cmdZoomOut.Enabled = objMandelbrot.Zooms > 0
End Sub

Private Sub cmdDraw_Click()
  objMandelbrot.MaxIterations = txtIterations
  objMandelbrot.draw
End Sub

Private Sub objMandelbrot_Drawing(lngPercent As Integer)
  If lngPercent = 100 Then
    Me.Caption = "FWMandelbrot demo program"
  Else
    Me.Caption = "FWMandelbrot demo program, working " & lngPercent & "%"
  End If
End Sub

Private Sub objMandelbrot_Zoom()
  cmdZoomOut.Enabled = True
End Sub

⌨️ 快捷键说明

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