BufferedImage + PrinterJob

M

Maciek

I try printing some pics (png)
I try this (and other) exmaple:
http://java.sun.com/j2se/1.4.2/docs/guide/jps/spec/appendix_2DPrinterJob.fm.html

In method paint() used that code:
paint(){
[...]
g2d.drawImage(bufferedImage, 0, 0, 100, 100, null);
[...]
}

Everything goes allright as long as loaded pic to bufferedImage
(BufferedImage) is not too big.
But, for example, after loaded (bufferedImage = ImageIO.read(imgage))
png file in resolution 3000x3000px and call PrinterJob.print method,
program throw error "java.lang.OutOfMemoryError". After convert this pic
to smaller resolution, for example 1000x2000px every thing is ok.

Launch JVM with parameters -Xms -Xmx to allocate more memory, but it's
not help.

WinXP, 768MB, java1.4.2
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top