Mandelbrot Sample

Description

The thread1 sample illustrates the use of threads to generate an image of an area in the complex plane which contains a mathematical object called the Mandelbrot set.

Concept

The sample creates a frame window that contains a canvas and a menu bar and a non gui thread. The image is generated by selecting the menu item. The image is generated on a separate thread so that the user interface remains responsive. A progress indicator window is used to display the status of the image generation. The generation task can be canceled before it has been completed.

The Mandelbrot set is one example of a fractal. An iterative algorithm is used to decide if each point in the area is part of the Mandelbrot set. Colors for points not in the set are assigned based on the number of iterations required to decide the point is not in the set.

For more information on the Mandelbrot set, and on fractals in general, see the book The Fractal Geometry of Nature by Benoit B. Mandelbrot.

The sample demonstrates the use of the INonGuiThread, ITimer, IImage, IGImage and IProgressIndicator classes.

Task

Run the sample. Use the menu items to generate an image of the mathematical object known as the Mandelbrot set.

Supported
Supported
Supported