"Neomorph" <ne******@nospam.demon.co.uk> wrote in message
news:3s********************************@4ax.com...
On Sun, 3 Aug 2003 10:55:29 +0800, "timtt" <kl***@email.hongkong.com>
two-finger typed:
does anyone guideline to speed up drawing in awt applet??
i have thousands of g.drawstring() + d.drawline()
Use (Applet.)createImage(width,height) to create a buffer image, then use
image.getGraphics() to get a graphics context, then you can draw in the
image (in a seperate Thread, for example).
You can even get the Dimensions of the Applet for the width and height of
the image.
In paint() you would only draw the image to the Applet/screen to refresh.
I made a Mandelbrot Applet that way:
http://www.continuum.demon.nl/javadev/MandelBrot/
You know when you zoom in a long way on your mandelbrot applet, it begins to
look a bit grainy, do you think that is due to inaccuracy in your
implementation of the maths? I am trying to think of a way to modify your
code to avoid this, possibly by using a fractional representation rather
then FP. Or have I got his wrong?
John