I've got a problem. I use image, which takes big space e.g. 40000x40000 px.
and so there is a problem with the amount of memory. I've found a compromise. The bigger cache we use the faster the performance will be. I use my own ImageRenderer (DRenderer.java)
and RenderedImage (ExtRenderedImage.java) instead BufferedImage. I suggest to use a RenderedImage in follow classes for flexibility.
Hi Antipin,
I am encouraged by your enthusiasm. However I have a few questions and notes on the suggestion.
First off why is it trying to render the entire 40,000x40,000 image at once. It should only render the portion that is visible. My first guess is that you have embedded it in a normal Swing scroll pane, in which case I strongly suggest you look at using JSVGScrollPane that is new in Batik 1.5.1.
Second I would note that your modification moves the rendering of the SVG document into the Swing thread (in the paint method). This is generally bad as the rendering can take several seconds even just for the displayed area.
Third you may not be aware that the StaticRenderer already does the caching that your modification adds. This is normally disabled for Dynamic documents because the extra time to update the cache can be quite noticeable, however you should be able to just replace the createImageRenderer method with one that always returns the Static Renderer. It is also worth noting that the static renderer goes to fairly great extents to try and render 'blocks' of tiles which makes a large difference for complex documents.
So to summarize, I think you can most/all of what you want (and perhaps more) by using the JSVGScrollPane with a StaticRenderer. If you tried this solution and found it unacceptable for some reason I would be interested in hearing why.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]