Re: Drawing 25 000 Shape fast



Oliver Wong wrote:
[post re-ordered]

"MTP" <mtp@xxxxxxxxxxxxxxx> wrote in message news:e95r4e$lkr$2@xxxxxxxxxxxxxxxxxxxxx

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

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 factor 2000? So if an object was previous 1x1 pixel, it is now 2000x2000 pixels?

yes

- zoom
- resize


What's the difference between zoom and resize, assuming vector (i.e. not raster) images?

weel zoom changes the data viewed, while resize change the way data are viewed


- the user want to map column 3 instead of column 4 for colors OR size of the shape OR type of shape


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.


Have you considered using Java3D/OpenGL and taking advantage of the 3D accelerator to perform zoom and pan?

i've tried -Dsun.java2d.opengl=true but the JVM was unstable and the performance boost was small.
.



Relevant Pages

  • Re: automatically zooming windows
    ... This would cause Word to resize the window ... > If I've been working on the document on the PowerBook and subsequently ... so either way I have to manually resize the window. ... > seems to zoom to what *would* be the size of the page if the Zoom ...
    (microsoft.public.mac.office.word)
  • Re: Autmatically change View
    ... Bob, thank you very much for the quick reply. ... tabloid and it automatically resizes to that page width. ... happens if you are in print preview...it resize each page for you. ... the status bar to turn on 'Zoom' and click on the percentage zoom choice on the status bar to open the dialog ...
    (microsoft.public.word.pagelayout)
  • Word Resize/Zoom problem?
    ... then I set it's Zoom to be ... After this, I set the PageFit, and Zoom properties: ... The zoomPercentage value is 100, so I set the Zoom to be 100%. ... try to resize the Word app, and it still seems to be in PageFitFull mode, ...
    (microsoft.public.word.vba.general)
  • Zoom-in and Zoom Out
    ... a feature I am just ignorant of, ... and zoom into a state and resize, ... a city and resize, zoom into a street and resize, ... I thought I could do the same with a chart. ...
    (microsoft.public.excel.charting)
  • Re: Drawing 25 000 Shape fast
    ... - pan (let's say that i'm at Zoom Factor 2000) ... So if an object was previous 1x1 pixel, ... What's the difference between zoom and resize, assuming vector images? ...
    (comp.lang.java.gui)