Total Visual SourceBook

Total Visual SourceBook CD and Printed Manual

Microsoft Access/ Office 2016, 2013, 2010, and 2007 Version
is Shipping!

New features in Total Visual SourceBook for Access, Office 2007 and VB6

Supports Access/Office 2016, 2013, 2010 and 2007, and Visual Basic 6.0!

Separate version for Access/Office 2003, 2002, and 2000.

Separate version for:
Access 97/95


View all FMS products for Microsoft AccessAll Our Microsoft Access Products

SourceBook Info:

Why SourceBook?

 

"The code is exactly how I would like to write code and the algorithms used are very efficient and well-documented."

Van T. Dinh, Microsoft MVP

 

 

 

Microsoft Access, Office/VBA, VB6 Modules royalty-free source code libraryMicrosoft Access Modules royalty-free source code libraryMicrosoft Access VBA and VB6 Module Library Free trial of Total Visual SourceBook for Microsoft Access, Office, VB6 and VBA

Module: Fractal in Category Microsoft Visual Basic 6 : Graphics from Total Visual SourceBook

Routines for drawing fractals, including the Mandelbrot and Julia fractals in VB6.

Procedure List

Procedure Name

Type

Description

(Declarations) Declarations Declarations and private variables for the modFractal module
Julia Procedure Draw a Julia fractal
MandelBrot Procedure Draws a Mandelbrot fractal

Example Code for Using Module: Fractal

' Example of modFractal
'
' To try this example, do the following:
' 1. Create a new form
' 2. Add a command button 'cmdDraw'
' 3. Add a slider named 'sldCX'
' 4. Add a slider named 'sldCY'
' 5. Add a slider named 'sldStartX'
' 6. Add a slider named 'sldStartY'
' 7. Add a slider named 'sldEndX'
' 8. Add a slider named 'sldEndY'
' 9. A control array of option buttons called 'optType'.
'    There should be two option buttons in this group
' 10. Add an picture box called 'picFractal'
'    Set the following properties
'    ScaleMode  Pixel
' 11. Paste all the code from this example to the new form's module
' 12. Run the form

Private Const mcintJulia As Integer = 0
Private Const mcintMandelBrot As Integer = 1

Private Sub cmdDraw_Click()
  If optType(mcintJulia).Value = True Then
    'Julia
      Julia picFractal.hDC, sldCX / 1000, sldCY / 1000, sldStartX / 1000, sldStartY / 1000, sldEndX / 1000, sldEndY / 1000, picFractal.ScaleWidth, picFractal.ScaleHeight, 20
  Else
    'Mandelbrot
      MandelBrot picFractal.hDC, sldStartX / 1000, sldStartY / 1000, sldEndX / 1000, sldEndY / 1000, picFractal.ScaleWidth, picFractal.ScaleHeight, 50
  End If
End Sub

Private Sub Form_Load()

  sldCX.Min = -2 * 1000
  sldCX.Max = 2 * 1000
  sldCY.Min = -2 * 1000
  sldCY.Max = 2 * 1000
  sldStartX.Min = -1.5 * 1000
  sldStartX.Max = 1.5 * 1000
  sldStartY.Min = -1.5 * 1000
  sldStartY.Max = 1.5 * 1000
  sldEndX.Min = -1.5 * 1000
  sldEndX.Max = 1.5 * 1000
  sldEndY.Min = -1.5 * 1000
  sldEndY.Max = 1.5 * 1000

  optType(mcintJulia).Caption = "Julia"
  optType(mcintJulia).Value = True
  optType(mcintMandelBrot).Caption = "MandelBrot"
  cmdDraw.Caption = "Draw"

  picFractal.ScaleMode = vbPixels

End Sub

Private Sub Option1_Click(Index As Integer)

  Select Case Index

    Case mcintJulia
      ' Set the range of values defined for the Julia set
      sldCX.Enabled = True
      sldCY.Enabled = True

      sldCX.Min = -2 * 1000
      sldCX.Max = 2 * 1000
      sldCY.Min = -2 * 1000
      sldCY.Max = 2 * 1000
      sldStartX.Min = -1.5 * 1000
      sldStartX.Max = 1.5 * 1000
      sldStartY.Min = -1.5 * 1000
      sldStartY.Max = 1.5 * 1000
      sldEndX.Min = -1.5 * 1000
      sldEndX.Max = 1.5 * 1000
      sldEndY.Min = -1.5 * 1000
      sldEndY.Max = 1.5 * 1000

    Case mcintMandelBrot
      ' Set the range of values defined for the Mandelbrot set
      sldCX.Enabled = False
      sldCY.Enabled = False

      sldStartX.Min = -2.25 * 1000
      sldStartX.Max = 0.75 * 1000
      sldStartY.Min = -1.5 * 1000
      sldStartY.Max = 1.5 * 1000
      sldEndX.Min = -2.25 * 1000
      sldEndX.Max = 0.75 * 1000
      sldEndY.Min = -1.5 * 1000
      sldEndY.Max = 1.5 * 1000

  End Select

End Sub

Microsoft Access Module LibraryOverview of Total Visual SourceBook

The source code in Total Visual SourceBook includes modules and classes for Microsoft Access, Visual Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily add this professionally written, tested, and documented royalty-free code into your applications to simplify your application development efforts.

Additional Resources