Re: Drawing 25 000 Shape fast



Andrey Kuznetsov a écrit :
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.

I already use this. But it's unusable if one of these events happen:
- pan (let's say that i'm at Zoom Factor 2000)
- zoom
- resize
- the user want to map column 3 instead of column 4 for colors OR size of the shape OR type of shape

.



Relevant Pages

  • Re: ruler settings
    ... The page is centered in the drawing area ... You can zoom in to reduce the amount ... > Yes, vertical zero lines up with left bottom, and horizontal with upper ... >> Common Visio Questions http://www.mvps.org/visio/common_questions.htm ...
    (microsoft.public.visio.general)
  • Re: Drawing 25 000 Shape fast
    ... So if the pan moves the image one pixel, ... then redraw to the one-pixel wide exposed area. ... outline - whatever is enough to give the user a sense of the zoom ... You could also do this while panning. ...
    (comp.lang.java.gui)
  • Re: Rubygame -- need help with zoom
    ... I'm trying to get a Rubygame example to zoom, and can't seem to do so. ... I'm simply drawing a single pixel at the center of the ... then trying to zoom when I press the space bar. ...
    (comp.lang.ruby)
  • Re: Resize page and contents (drawing and printed pages)
    ... Is there an easier way to 'zoom out' the drawing to a desired size ... so that it will fit into one page on the plotter. ... cross-functional flow framework from the flow diagram contents. ...
    (microsoft.public.visio.general)
  • Re: 2003 Zoom View Issue - Cant Zoom over 107%
    ... Hmm. ... I'm able to zoom *only* to 1000% with a drawing that big. ... More Visio shapes, articles, development info and pure diagramming fun at: ...
    (microsoft.public.visio.general)