Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

BufferedImage + PrinterJob

 
 
Maciek
Guest
Posts: n/a
 
      11-01-2005
I try printing some pics (png)
I try this (and other) exmaple:
http://java.sun.com/j2se/1.4.2/docs/...terJob.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
 
Reply With Quote
 
 
 
Reply

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 joseph_daniel_zukiger@yahoo.com 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



Advertisments