Re: Drawing 25 000 Shape fast



i have to render 25 000 "points" with each one a specific fill color, and
a specific Shape (java.awt.Shape or customized) in a JPanel.

Drawing every Shape, one by one, is too slow (panning the view ins't
smooth). So i tried to create a BufferedImage for each point, and render
them instead. But it is even slower.

Direct : 3 sec
BI: 4.5 sec

I need to reach 0.1 sec by any mean. Right now i'm thinking to add some
kind of Z-buffer but with aliasing it's pretty hard i think. Trying ideas
take time so i'm asking if somebody can help me.

And all the BI take about 60 Mbytes of memory, which is a lot.

use one BufferedImage.
You need to draw your shapes to BI only if something changes.

Andrey

--
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities


.



Relevant Pages

  • Re: Save an Image to a file
    ... I don't really know any java... ... -Do you or does anyone have a nice method that converts a BufferedImage ... Write the BufferedImage to your server ... I've never used PHP but I have processed form data with Perl. ...
    (comp.lang.java.programmer)
  • Re: High Quality Resizing
    ... > right and bottom of my image, and the image had bad artifacts: ... > new BufferedImage( ... final ImageProducerAdapter producer = ... http://uio.dev.java.net Unified I/O for Java ...
    (comp.lang.java.gui)
  • Re: getting pixel color information from an image
    ... if 'image' is Image then you need PixelGrabber ... if 'image' is BufferedImage then use BufferedImage.getRGB ... if 'image' is image file then you should first load it then use one of above ... http://uio.dev.java.net Unified I/O for Java ...
    (comp.lang.java.programmer)
  • Re: Thumbnail creation problem. really weird.
    ... > this is too complicated for me since i have not used this part of java ... may be it is better to create empty BufferedImage, get the pixels from Image ... http://uio.dev.java.net Unified I/O for Java ...
    (comp.lang.java.programmer)
  • Re: Graphics.drawString langsam
    ... Ich erstelle mir ein BufferedImage, ... Bild wird dann in den MediaTracker geladen und es wird solange gewartet ... http://uio.imagero.com Unified I/O for Java ...
    (de.comp.lang.java)