Phil,
Thanks for your reply.
> I don't have time to try your test program
That's a shame. I spent a non-trivial amount of time producing a simple
applet that would demonstrate the problem.
> but I am very sure this works
> fine and that something you are doing is causing this.
I'm glad to hear that it can be made to work, and would be delighted if
someone could tell me where I'm going wrong. I was hoping to get some
answers to the questions I included in my original message in the hope that
they would dispel my confusion.
I originally posted my message to the JAI list, but I was redirected to
this list.
As an alternative to answering the questions, could you point me to an
online source which actually and repeatably prints a decent-sized (eg 9000
x 6000) TIFF image and produces a good quality 300 dpi (or better) result?
All the examples I've been able to find (on Sun's site and others) print
on-screen components or generated text etc that are much smaller than the
page size.
> ie in a nutshell, the printing APIs do preserve full image resolution
> so long as they have it to preserve ..
That's good to hear. But what resolution should I make my image so that it
will print OK?
> Looking only at your print() method I think that you shouldn't be
> scaling the graphics.
I tried commenting out the g2.scale(...) line, and all it printed was a
large version of the top left of the image.
> 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(..)
I'm not sure whether *I* want my image to be scaled or not. I only want to
do what's necessary to get a good print on the paper.
> 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.
You've lost me there. According to the JDK 1.4.1 docs:
abstract void drawImage(BufferedImage img, BufferedImageOp op, int x, int
y)
Renders a BufferedImage that is filtered with a BufferedImageOp.
Where are the source & destination rectangles specified?
> Incidentally if you were using the Image IO-based JAI TIFF
> reader you would get a BufferedImage.
No, I'm not using Image IO, as I started developing this application months
ago before Image IO was released.
> I'm not sure what the JAI codecs you are using actually return
I think I'm using RenderedImage throughout.
> 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.
> 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.
Thanks again, and please excuse me if I appear frustrated. I've been trying
to get this working for the last few weeks and the project is already late
and over-budget - and yes, there's still lots more to do!
all the best,
Mike
----------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail
for such purpose.
----------------------------------------------------------------------------------------
===========================================================================
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".