Well, I just tested this and it didn't work. Method (a) still produced an 80 MB spool file like method (b). Gunter, what makes you think that the print job size should be smaller with method (a) than for (b)?

Cheers, Eric

Eric Kolotyluk wrote:


Gunter Zeilinger wrote:
Hi

According my experience with printing BufferedImages, there is a difference between

  
   Graphics2D g;
   AffineTransform t;
   BufferedImage b;

   a)
       g.scale(2.0, 2.0);
       g.drawImage(b, 0, 0, null);

   b)
       t.scale(2.0, 2.0);
       g.drawImage(b, t, null);
      

Scaling the Image by a), set RenderingHint for Bilinear Interpolation shows now effect - the printed image looks always scaled by Nearest Neighbor Interpolation
(already described in message http://swjscmail1.java.sun.com/cgi-bin/wa?A2=ind0301&L=java2d-interest&F=&S=&P=691)
But if I do want to scale up with bilinear or bicubic then (b) should work, right? By the way, what do you think produces the best results, bilinear or bicubic? According to the Java 2D API Graphics book it's bilinear, but they don't say why.
On the other hand, the print job size in case a) is quite smaller (if scale > 1.0) than in case b). So may be in case a), the scaling is done  by the printer (or native print driver) - but not by java.
Ahh! This answers a problem I've seen. I had a 80 MB image that I scaled using (b) which produced a 80 MB spool file, which resulted in a printing error.  I've been using a second print buffer to reduce my spool file size, but that's causing my images to change appearance slightly when I render the original BufferedImage into the smaller print BufferedImage.


So if I used (a) to scale the image, I should get a much smaller spool file with a scale of say 0.04?

Why would this be? Why would the scaling be done in the print driver for case (a) but not for (b)? Does the graphics context try to pass off some operations to the device drivers for performance reasons?

I'll have to try this to confirm.

Thanks so much for the tip Gunter. There really are differences as you've pointed out.

Cheers, Eric
But I am only guessing, what really causes the different results, drawing images into a Graphic2D associated with a print device, by a) or b)

gunter.

===========================================================================
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".
  


Reply via email to