Well you can render the two images to BufferedImages and manually manage the display (i.e. don't use the JSVGCanvas at all). This would of course lose the ability to easily pan/zoom etc. If you want to go this route the slideshow application is does almost exactly this.
Your approach of having two JSVGCanvas's also seems like it might
work, however you will probably need to subclass them to add
'better' ways to control visibility - so for example using
Chimera's suggestion of toggling visibility will cause the canvas to rerender each time (you have probably actually doubled the work).
But if you were to subclass the Canvas you could have a boolean that you check in paintComponent if it is 'visible' then you call the baseclass paintComponent, otherwise you do nothing (perhaps calling JComponent.paintComponent).
You could then have a 'blink' canvas that sits over a normal canvas. The tricky part then would be to synchronize events/rendering transforms (assuming you need to).
Stephen Turner wrote:
Chimera wrote:
I tried that and the cpu still runs high. I basically loaded 2 svg canvases on top of each other and toggled them every 500 ms. Any other ideas?I'm working on an application that renders graphics that regularly blink
in many areas within the svg document. We are using batik to render the
graphics and have noticed that the cpu % exponentially grows as the more
blinks occur on the screen (as expected). The circles, rectangles,
polygons, etc all blink at the same time. Is there a way to optimize
things that blink on the screen when there are really only two images
that should rotate.... assuming nothing else changes on the screen? I've
looked at DynamicImageRenderer. Is this the right place to start? Any
help would be appreciated.
Is it possible to have all of those items on a 'layer' that toggles visibility on and off? Just an idea.
Chimera
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Stephen
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
