예제 #1
0
void MyWindow::draw ()
{   int i,j,k,f;
	double zre,zim,wre,wim,wrenew,deltax,deltay;
	ULONG color;
	bitmap->directcolor();
	deltax=(Xmax-Xmin)/width();
	deltay=(Ymax-Ymin)/height();
	for (i=0; i<width(); i++)
	{   zre=Xmin+i*deltax;
		for (j=0; j<=height(); j++)
		{   wre=zre;
			wim=zim=Ymin+j*deltay;
			for (k=0; k<Iterations; k++)
			{	if (wim*wim+wre*wre>16) break;
				wrenew=wre*wre-wim*wim+zre;
				wim=2*wre*wim+zim;
				wre=wrenew;
			}
			if (k<Iterations)
			{   f=255l*k/Iterations;
				color=Rgb(0,255-f,f);
			}
			else color=0;
			bitmap->point(i,j,color);
		}
		if (i%10==0) copy();
	}
	window.update();
}
예제 #2
0
void parameter (int command)
{	xmin.set(window.xmin()); xmax.set(window.xmax());
	ymin.set(window.ymin()); ymax.set(window.ymax());
	iterations.set(window.iterations());
	d.carryout();	if (d.result()!=DID_OK) return;
	window.set(xmin,xmax,ymin,ymax,iterations);
	window.update();
	thread.start();
}