[
Advertise | Submit Code | About us | Contact us | Link us
]
Go!
Membership Services
Login
Register

Home
C# General

General

C# Language

Design & Architecture

Algorithms

Database

Security

Active Directory

COM Interop

Remoting
C# Windows Forms

General

Combo and List boxes

Miscellaneous Controls

Button Controls

Edit Controls
Cutting Edge

ASP.NET 2.0

Visual Studio 2005

Windows Longhorn

SQL Server 2005
C# Multimedia and GDI+

General

DirectX

GDI+

Audio
Internet & Web

General

Images and multimedia

Database

Utilities

Security

ASP.NET Controls

Design and Architecture

Webservices
.NET

General

Design & Architecture

Algorithms

Database

Security

Active Directory

COM Interop

Remoting

ADO.NET

XML.NET

Tools

Enterprise

IDE
Visual Basic .NET

VB.NET General

VB.NET Controls
General Reading

.NET Books Review

Product Showcase

Book Chapters

Business Design & Strategy
Community

Discuss

Job Board

Discussion

CodeXchange
DeveloperLand

Advertise

Submit Code

About us

Contact us

Link us
Miscellaneous

Favorite Links

Downloads

Programming Sites

Top Stories
Regular Expressions

E-Mail

Date/Time
Home > C# Multimedia and GDI+ > GDI+
Fractals in C#
Posted by on Monday, August 23, 2004 (EST)

This example program is for generating Mandelbrot and Julia sets. The purpose for this example is to learn a few things about working with bitmap graphics in C# and .NET.

This article has been viewed: 4,830 times
Technology: GDI+.

Contents

Fractals.zip [^]

Introduction

This example program is for generating Mandelbrot and Julia sets.  The purpose for this example is to learn a few things about working with bitmap graphics in C# and .NET.

Top Go to Table of Contents

New features

  • Calculation & drawing is done using a background thread, so the UI is still responsive.
  • Mouse selection of zoom region.
  • Common code from Mandelbrot & Julia classed moved into a base class called FractalSet.

The asynchronous drawing technique used here is based on the code from the article, Draw Asynchronously With .NET [^] by Bill Storage, in the Aug 2002 issue of Visual Studio Magazine.

Top Go to Table of Contents

Compile the code

The download only contains the source code, so you need to create a C# Windows application project and add the code to it.

Top Go to Table of Contents

Using the program

Click the Draw button to create the Mandelbrot set.

To center on the region of interest, click the left mouse button on the point which you want to become the center.

Click the Zoom In button a few times.

 Alternatively, draw a rectangle around the area you would like to zoom in on.

Select a C value for the Julia set by clicking on the Mandelbrot set.  Selecting a point along the edge of one of the cardiod shapes works best.

Select Julia from the Draw menu, to draw the Julia set for the C value selected in the previous step

Adjust the Zoom and number of iterations to obtain an interesting Julia set.  If you can't find anything interesting, you need to go back to the Mandelbrot set to select a new value for C.

Return to the Mandelbrot set by selecting Mandelbrot from the Draw menu.

Top Go to Table of Contents

Saving your art

From the File menu, you can save the image or the parameters.  The parameters are serialized as XML.

Top Go to Table of Contents

About Bill Burris

3D Graphics, OpenGL AI Python, C#, C++

Click here if you want to know more about .

Other articles that may interest you

  • Write a Word Add-In – Part 0
  • Write a Word Add-In – Part I
  • Lengthy Operations on Single Thread in .NET Application
  • Learning Draughts
  • Exceptions and Performance
  • Average Rating :

    Discussion Forums
    Got a programming related question? Hopefully someone has the answer... Want to help out other developers? Visit our discussion forums.

    Sponsored by:

    New Articles

  • Exceptions and Performance
    Almost every time exceptions are mentioned in mailing lists and newsgroups, people say they're really expensive.Let's examine that claim, shall we?

  • Creating multilingual websites - Part 1
    Extend the existing globalization capabilities of .NET to create flexible and powerful multilingual web sites. First, create a custom ResourceManager, and then create custom localized-capable server controls to easily deploy multilingual functionality.

  • Parameter passing in C#
    Many people have become fairly confused about how parameters are passed in C#, particularly with regard to reference types. This page should help to clear up some of that confusion

  • Most Popular Articles

  • LDAP, IIS and WinNT Directory Services
    This article explains how to use .NET Directory Services to retrieve and search directory objects, create new directory objects and edit or delete existing directory objects. Describes Active Directory Application Mode (ADAM) and how to use the IIS, WinNT and LDAP directory (ADSI) provider.

  • An in-depth look at WMI and instrumentation, Part II
    WMI stands for Windows Management Instrumentation and, as the name indicates, is about managing your IT infrastructure this article is the second part of a two-part series.

  • An in-depth look at WMI and instrumentation, Part I
    WMI stands for Windows Management Instrumentation and, as the name indicates, is about managing your IT infrastructure this article provides an in-depth look at WMI and MOM 2005

  • New Books

  • Murach's ASP.NET 2.0 Upgrader's Guide: VB Edition
    What’s new and how to use it! That’s what this book delivers if you’re a VB developer who’s interested in upgrading from ASP.NET 1.x to ASP.NET 2.0.

  • C# in easy steps
    Learn to program with Microsoft’s premier programming language. No previous programming knowledge is assumed. With numerous easy-to-follow examples, this title explains the essentials of object-oriented programming with C#.

  • Murach's ASP.NET web programming with VB.NET
    Murach's ASP.NET web programming with VB.NET by Doug Lowe and Anne Prince is a in depth training and reference book for ASP.NET programming using VB.NET. The book builds upon Murach's previous books and covers more advanced concepts for programming ASP.NET pages.

  • Got Code?

    if you have any article , source code , or anything else you'd like to share with this community that you think others might find useful, please submit it here and we will gladly make it available on this site. submit@developerland.com.
    Partners

    All articles are copyrighted by their individual authors unless otherwise specified , everything else Copyright ©2004-2006 DeveloperLand