Hi,

the code below is part of a program to draw the Mandelbrot-set. It works, if 
the canvas is small (stamp-size). However, if the size is increased to 800x800, 
the middle 1/3 of the image is replaced by a vertical grey bar. Any ideas?

Thanks in advance

Engelbert

--------------------------------------------------------------------------------------------------

procedure TForm_MandelbrotSet.B_DrawClick(Sender: TObject);

var dp, dq : real;
      np, nq : word;

 procedure Iterate (np, nq : word);

 var p, q, x, y, x_old : real;
       k                       : word;

 begin
   p := P_min + np * dp;
   q := Q_min + nq * dq;
   k := 0;
   x := 0;
   y := 0;
   repeat
     x_old := x;
     x := x*x - y*y + p;
     y := 2 * x_old * y + q;
     inc(k);
   until (x*x + y*y > r_max) or (k = k_max);
   if k = k_max then k := 0;
   PB_Drawing.Canvas.Pixels[np, PB_Drawing.Height-nq] := k;
 end;

begin
 dp := (P_max - P_min) / PB_Drawing.Width;
 dq := (Q_max - Q_min) / PB_Drawing.Height;
 for np := 1 to PB_Drawing.Width do
 for nq := 1 to PB_Drawing.Height do
 Iterate(np, nq);
end;
___________________________________________________________
NEU: WEB.DE DSL für 19,99 EUR/mtl. und ohne Mindest-Laufzeit!
http://produkte.web.de/go/02/

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to