Drawing the Mandelbrot Set / Fractal (in VB6)

One possible view of the Mandelbrot set (generated with this project)

Today’s very cool project demonstrates a proof of concept implementation for rendering the famed Mandelbrot set (or “Mandelbrot fractal”) using VB6.  It’s a bit of a feat, since VB6 isn’t exactly optimized for recursion-heavy calculations…but you know me.  :)  I love making VB do things it was never meant to do!

I’m very happy with how the project turned out.  It may not be the fastest or prettiest or most accurate implementation (for example, at very high zoom-in you’ll start to see noticeable quality degradation), but I’ve deliberately kept the project as short and sweet as possible to maximize adaptability and learning potential.

To enhance the experience, I’ve added several user-controlled options to help you get a feel for how the rendering works.  First is the scroll-bar at the top of the screen, which allows you to preferentially set speed or accuracy as the program’s objective.  (For those familiar with how the Mandelbrot set works, the scroll bar controls the “escape time” of the recursive function.)

Another neat option is a click-and-drag feature that allows you to draw new rendering boundaries.  This makes it simple to zoom as deep as you want into the fractal.

Finally, rather than a drab grayscale rendering, I’ve chosen a more purplish gradient.  The code can be easily modified to favor another color if you so choose.

The code is reasonably optimized, so a complete view should render within several seconds on most modern hardware.  If speed is a concern, note that the white areas of the image take the longest to process – so minimizing the amount of white you select will maximize render speed.  Also, due to the inherent limits of the “Double” type in VB6, if you zoom in really, really far the program may lock up.  (Simply click the close button to force-terminate the project if this happens.)

The download link can be found below these sample images.

Similar Posts:


DISCLAIMER: These download files are regularly scanned to ensure they remain free from malicious content. Unfortunately, some virus scanners will flag these .zip files as suspicious simply because they contain source code and/or executable files. I have submitted my projects to a number of companies in an attempt to rectify these false-positives. Some have been cooperative. Others have not. If your virus scanner alerts you regarding these files, please allow the file to be submitted for further analysis (if your program allows for that). This should help ensure that any false-positive warnings gradually disappear for all users.

This site - and its many free downloads - are 100% funded by donations. Please consider a small contribution to fund server costs and to help me support my family. Even $1.00 helps. Thank you!

2 thoughts on “Drawing the Mandelbrot Set / Fractal (in VB6)”

Comments are closed.