Click here to Skip to main content
15,437,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to do a C# program that shows a mandelbrot fractal. What graphics tools is the best suited to do this. GDI+, WPF or other? I have never worked with graphics other than simple forms and controls.
Updated 3-Mar-12 14:51pm
Robert1974 3-Mar-12 4:45am    
I use visual studio 10
OriginalGriff 3-Mar-12 4:51am    
You can use the "Improve Question" widget to add information, rather than posting it as a separate comment.

Have a look at this: Mandelbrot Set for C#[^] it just uses SetPixel, which is part of System.Drawing
Share this answer
Sergey Alexandrovich Kryukov 3-Mar-12 20:53pm     CRLF
Would be too slow due SetPixel, maybe even noticeable compared to calculations... --SA
Sergey Alexandrovich Kryukov 3-Mar-12 21:01pm     CRLF
Please see my answer. --SA
Either WPF or System.Drawing with System.Windows.Forms could work for you. I would suggest you use a bitmap for rendering. This way, you can have a tree of already calculated regions on a complex plain, and you can derive new region from any of the already rendered regions using mouse selection.

I only would warn you against using SetPixel. Even though calculations are pretty slow, too…

Wind System.Drawing, you should use the technique based on LockBits:[^].

With WPF, you would use System.Windows.Media.Imaging.WriteableBitmap:[^].

Both MSDN pages have some code samples showing how to work without SetPixel

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900