I don't have time to try your test program but I am very sure this works fine and that something you are doing is causing this.
ie in a nutshell, the printing APIs do preserve full image resolution so long as they have it to preserve ..
Looking only at your print() method I think that you shouldn't be scaling the graphics. If you want your RenderedImage to be scaled without loss of resolution you may have more luck if you apply this scale to the affinetransform parameter of drawRenderedImage(..)
ie essentially the "usual" approach to drawing a large image into a fixed area is to call drawImage(...) which takes a source anbd destination rects. The scale above can be used to get the same result with your RenderedImage.
Incidentally if you were using the Image IO-based JAI TIFF reader you would get a BufferedImage.
I'm not sure what the JAI codecs you are using actually return Its possible you have BI anyway: as an experiment you could cast the RI to one and if its a BI try regular drawImage as above. I wouldn't recommend that other than as an experiment since its not guaranteed.
-phil.
Mike Cross wrote:
What happens:
I'm trying to print a TIFF image (a scanned engineering drawing) to an HP LaserJet printer from an applet. The printed image appears grainy, as if it's using a low dpi rather than the 300 dpi that I'd like it to use. If I print the same image from another application (eg Windows Imaging), the image is much better, and less grainy.
The applets's code is attached below (DisplayApplet2.java, DADisplayJAI2.java, TiffPrinter.java). I've looked through this lists's archives, and that of the JAI-INTEREST list, and have found posts from other people with similar problems. I haven't been able to get the posted solutions to work for me.
=========================================================================== 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".
