Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > BufferedImage + PrinterJob

Thread Tools

BufferedImage + PrinterJob

Posts: n/a
I try printing some pics (png)
I try this (and other) exmaple:

In method paint() used that code:
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 =
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
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to split a PrinterJob ?? tonylaq Java 2 08-10-2007 10:22 PM
IndexOutOfBoundsException getting a PrinterJob.defaultPage() on a Linux box Java 1 01-10-2006 09:44 PM
Read PrinterJob Dialog settings Mike Java 0 09-08-2004 10:43 AM
Selecting Printer w/PrinterJob Brad Grier Java 0 02-19-2004 06:26 AM
PrinterJob.printDialog() - adding extra tab panels Steve Jones Java 0 02-18-2004 07:17 PM