Hi guys,

I am working on a conversion of the Mandelbrot Fractal from Java to C# and my programming skills are lacking quite a bit. I am desperately trying to improve but I have come across some errors that are stumping me. I have attached a txt file with the code I have so far and below is the segment of code I am getting errors with.

private void mandelbrot() // calculate all points
                    int x, y;
                    float h, b, alt = 0.0f;

                    action = false;
                    public function setCursor;
                    float System.WriteLine("Mandelbrot-Set will be produced - please wait...");
                    //float showStatus("Mandelbrot-Set will be produced - please wait...");
                    for (int x = 0; x < x1; x += 2) 
                        for (int y = 0; y < y1; y++) 
                            h = pointcolour(xstart + xzoom * (double)x, ystart + yzoom * (double)y); // color value
                            if (h != alt)
                                b = 1.0f - h * h; // brightnes
                                ///djm added
                                ///HSBcol.fromHSB(h,0.8f,b); //convert hsb to rgb then make a Java Color
                                ///Color col = new Color(0,HSBcol.rChan,HSBcol.gChan,HSBcol.bChan);
                                //djm end
                                //djm added to convert to RGB from HSB

                                g1.setColor(Color.getHSBColor(h, 0.8f, b));
                                //djm test
                                Color col = Color.getHSBColor(h, 0.8f, b);
                                int red = col.getRed();
                                int green = col.getGreen();
                                int blue = col.getBlue();
                                alt = h;
                            g1.drawLine(x, y, x + 1, y);
                    showStatus("Mandelbrot-Set ready - please select zoom area with pressed mouse.");
                    action = true;

If anyone can offer me some advice on how to resolve some of these issues that would be great. I know there are quite a few, but if anyone can give me some tips on the best way of tackling a conversion like this or point me in the direction to resolving this, then I would really appreciate it. Thnks a lot for your time and help.


Recommended Answers

Answered by ddanbe 2,724 in a post from

Click on this thread (a collegue of you?) http://www.daniweb.com/forums/thread236306.html
to find out more. Good luck!

Jump to Post

All 2 Replies

Hi, thanks very much for this, I apprciate the help, I'll take a loook at the link and see what I can do.


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.