On 21 nov. 07, at 15:36, [EMAIL PROTECTED] wrote:
Eventually that is probably what I will do. But I was
wondering if I
was missing something obvious to actually dispose of
all resources
associated with the BufferedImage
By default you don't need to care about BufferedImages - if you
don't hold any references it up to the GC to free java-related
memory, and up to the "Java2D Disposer" to clean up native
resources associated with it (that was why I ask wether seting a
different accaleration-priority would help).
Yes indeed.
However because BufferedImages tend to be that widely used the
chance you've hit a bug in java is quite small. If you could post
the code (or even the compiled application), I could have a look at
it.
lg Clemens
[Message sent by forum member 'linuxhippy' (linuxhippy)]
I've put the 2 JAR files at [1,2]. Here is the associated command line:
java -jar zslideshow-0.1.0-SNAPSHOT.jar
I'm not sure I am doing anything "wrong", though, as the app works
perfectly fine when I instantiate images as OSXImage or
awt.ToolkitImage. And the code is exactly the same except for the
line where I instantiate the java.awt.Image (either using ImageIcon
in which case I get an OSXImage, or ImageIO.read() in which case I
get a BufferedImage).
One notable thing: my call to Image.flush() does not occur on the
EDT, but in a thread created by my own app (not the main thread). I
do not see why this should be a problem, but I just thought I'd
mention it.
The source code is kind of large, as it uses my own Java2D-based ZUI
(zoomable user interface [3]) toolkit to actually display the images.
If you really want to have a look at it, [4] is where images get
created and destroyed. [5] is the class encapsulating the image and
containing the actual drawing code.
[1] http://www.lri.fr/~pietriga/2007/11/zslideshow-0.1.0-SNAPSHOT.jar
[2] http://www.lri.fr/~pietriga/2007/11/zvtm-0.9.6-SNAPSHOT.jar
[3] http://zvtm.sourceforge.net/
[4] http://zvtm.svn.sourceforge.net/viewvc/zvtm/zslideshow/trunk/src/
main/java/net/claribole/zslideshow/ImageDescription.java?view=markup
[5] http://zvtm.svn.sourceforge.net/viewvc/zvtm/zvtm/trunk/src/main/
java/net/claribole/zvtm/glyphs/VImageST.java?view=markup
thanks,
Emmanuel
--
Emmanuel Pietriga
INRIA Futurs - Projet In Situ tel : +33 1 69 15 34 66
Bat 490, Université Paris-Sud fax : +33 1 69 15 65 86
91405 ORSAY Cedex FRANCE http://www.lri.fr/~pietriga
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".