siema. mam taki problem rysuje zbiór mandelbrota. wyswietla sie na serverze elegancko. ale teraz musze zrobić powiekszanie i potrzebne sa mi do tego kontrolki i własnie mam problem z jednoczesnym wyświetleniem ich razem z ta grafiką która wygenerowałem. macie jakieś pomysły???
kod:
<html> <body> <form action="nowa.jsp"><input type="submit" name="button" value="ostatni" />
<% // Create image int width=600, height=500; BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); // Get drawing contextGraphics g = image.getGraphics();
// Fill background
g.setColor(Color.white);
g.fillRect(0, 0, width, height);
int i,j;
double x,y,xtemp;
double res_x=2.5;
double res_y=1;
int i_MAX=1000;
for(int I=0;I<width;I++)
{ res_x=((3.5/width)I-2.5);
for(int J=0;J<height;J++)
{
res_y=(1-(2.0/height)J);
x=y=i=0;
while(((xx+yy)<4) && (i<i_MAX))
{
xtemp=xx-yy+res_x;
y=2xy+res_y;
x=xtemp;
i++;
}
if(i==i_MAX){
g.setColor(Color.black);
g.fillRect(I,J,1,1);
}else{
if(i<255)
g.setColor(new Color(255-i,255-i,255-i));
else
g.setColor(new Color(0,0,0));
g.fillRect(I,J,1,1);
}
}
}
// Dispose context
g.dispose();
// Send back image
ServletOutputStream sos = response.getOutputStream();
JPEGImageEncoder encoder =JPEGCodec.createJPEGEncoder(sos);
encoder.encode(image);
%>