Silverlight 1.0 Mandelbrot Set Generator

Silverlight Add comments

While reading the Mandelbrot set chapter in Dewdney’s The New Turing Omnibus, I realized that this would be a great test application for Microsoft’s new interactive Web application framework Silverlight. Below is the component, its source code, and a few things I learned along the way.

Beware: the Mandelbrot set is computationally expensive and may appear to lock up your web browser. If a “Stop running this script?” dialog pops up, please click no to allow the calculations to finish.

Silverlight 1.0 Mandelbrot Set Control

Here is a Silverlight 1.0 control which draws the Mandelbrot set. Left-click to zoom in on a particular region.


Source Code

The source code to the Silverlight Mandelbrot set consists of the following pieces:

Notable Findings

  • Overall responsiveness is rather slow, especially on the mousemove event. Perhaps I’m pushing Silverlight too hard too early, but this slowness makes me highly reluctant to adopt Silverlight yet.
  • I can’t figure out how to do progressive (e.g. line-by-line) rendering to give the user feedback.
  • There is no facility for directly painting an individual pixel within Silverlight. Instead, you must draw 1 by 1 colored XAML rectangle controls. Because individual XAML rectangles are quite heavyweight, I coalesce multiple pixels of the same color in the same row into one rectangle.
  • I wanted to use right-click to zoom out, but there doesn’t appear to be a way to capture the right click event from within Silverlight.

About the Mandelbrot Set

For more information on the Mandelbrot set, see its Wikipedia article.

2 Responses to “Silverlight 1.0 Mandelbrot Set Generator”

  1. pleased precariously » silvermandel Says:

    [...] on Steven Engelhardt’s blog there’s a mandelbrot viewer written using silverlight 1.0 (meaning just xaml + javascript). In his post he listed a few [...]

  2. Chris Toshok Says:

    Just wanted to let you know that I solved your progressive rendering problem. Check it out here: http://squeedlyspooch.com/mandel-sl10/foo.html

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in