John,

> I wonder if you can solve your quality problem of characters
> by zooming in your image, use large fonts and save the resulted
> large image. When you need it, scaling the image back inside
> powerpoint would probably give you smoother characters.
> Not elegant, but quick, if it works.

In time we may try this (we'd have to experiment with different font sizes,
as we are using the same fonts we use when drawing the image to the screen).

>
> Incidentally, I think you can do what you are hoping:
> there is a free software somewhere, a sort of ghostview, which
> converts postscript files into images or some encapsulated
> postscript files, which Powerpoint understands. One of the
> example is in:
>
>    http://robotics.stanford.edu/~zhang/defTalk/sld005.htm
>
> I used it a few years ago... but the software name just does
> not come back to my memory for now. With a little luck, maybe
> one of the list-members is using it now and will drop a line.

I think you're right; it's ghostview.  We have it on our servers,
incidentally.  I do wonder if it can be automated though, since we're
automating the whole process (we save our files, then pipe down & run a VB
script to stuff them into PowerPoint, so it follows that if we create .ps
files we'd also want to run ghostview with some parameters to automatically
save the .ps files as .gif, .png, whatever, and then run our VB for
PowerPoint).  Also... is this going to be something everyone would have to
install, or could we pipe down one or two executable files out of our .jar
to do the trick (as we do w/ our script)?  Our VB doesn't rely on any other
special files so we chose not to bother our users yet again with another
download (they've had to download the Java 1.3 plugin and 2 of the 3 jar
files via self-extracting zip).  If ghostview is the same way (and not too
hefty in size) then we could do that as well, but if not then they'd have
another download.

>
> John
>
>
> >Hello John,
> >
> >Doesn't make a difference, since our image when we save it
> to a file is
> >redrawn to the size we want (800x600) before it's saved.
> Printing directly
> >using the PrintComponent class will always render the fonts
> just the way we
> >want no matter what size we scale to.  It'd be really great if the
> >
> >You're right, that it's not specifically a JAI problem, but a Java2D
> >problem.  A coworker working on a very similar project has
> found code that
> >will use Java2D methods to create a PostScript file which
> looks very nice.
> >(I had also found one but it couldn't do Graphics2D-specific
> methods.)  If
> >we can find something that will turn PostScript files into
> some type of
> >image file that can be inserted into PowerPoint then that
> will be extremely
> >useful (especially since the software is distributed with
> its source code).
> >
> >I'm afraid there's not much we can do with Java2D and JAI
> alone that will be
> >able to render the fonts in an image the way we want, partly
> because of the
> >limitations on directly drawing an image as we're doing.
> >
> >Thanks for the mention of the Java2D-interest group. :)
> >
> >Kate
> >
> >> -----Original Message-----
> >> From: John Zhang [mailto:[EMAIL PROTECTED]]
> >> Sent: Wednesday, May 02, 2001 7:34 PM
> >> To: [EMAIL PROTECTED]
> >> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> >> Subject: RE: Drawn image rendering quality
> >>
> >>
> >> Hi Kate-
> >>
> >> Does it make any difference if the [width,height]
> >> are exactly the same as the panel size?
> >>
> >> This is not a JAI problem and probably Java2D-interest
> >> will provide a satisfactory solution.
> >>
> >> Good luck,
> >> John
> >>
> >> ----
> >>
> >> From:         "Wintjen, Kate" <[EMAIL PROTECTED]>
> >> Subject:      Drawn image rendering quality
> >> Content-Type: text/plain; charset="iso-8859-1"
> >>
> >> I'm using the following code to render an image I have drawn
> >> in a custom
> >> panel:
> >>
> >> String filename = "myfile.png";
> >> BufferedImage buff = (BufferedImage)createImage(width, height);
> >> Graphics2D g2d = buff.createGraphics();
> >> panel.paintComponent(g2d);
> >> JAI.create("filestore", buff, filename, "PNG", null);
> >>
> >> This works, but there's something we're trying to fix.
> >> There's some text in
> >> the drawing, and it's not exactly coming out the way we'd
> >> like, although it
> >> is probably coming out as one would or should expect.
> >>
> >> If we turn on anti-aliasing using RenderingHints, it looks
> >> great on the
> >> screen, even after opening the file for viewing.  However,
> >> the text prints
> >> out fuzzy.  If we make sure anti-aliasing is off with
> >> RenderingHints, it
> >> doesn't look as good on the screen, and printing makes the
> >> text very jagged
> >> and pixelated.
> >>
> >> To print, we're using this class (found off the internet):
> >>
> >> public class PrintUtilities implements Printable {
> >>   private Component componentToPrint;
> >>
> >>   public static void printComonent(Component c) { }
> >>   public static void printComponent(Component c, Rectangle r) {
> >>     new PrintUtilities(c).print(r, orientation);
> >>   }
> >>   public void print(Rectangle r) {
> >>     PrinterJob printJob = PrinterJob.getPrinterJob();
> >>     PageFormat pformat = printJob.defaultPage();
> >>     Paper paper = new Paper();
> >>     pformat.setOrientation(PageFormat.PORTRAIT);
> >>     paper.setImageableArea(r.x, r.y, r.width, r.height);
> >>     pformat.setPaper(paper);
> >>     printJob.setPrintable(this, pformat);
> >>     if (printJob.printDialog()) {
> >>       try {
> >>         printJob.print();
> >>       }
> >>       catch (PrinterException e) {
> >>         System.out.println("Error: " + e);
> >>       }
> >>     }
> >>   }
> >>   public int print(Graphics g, PageFormat pageFormat, int
> pageIndex) {
> >>     if (pageIndex > 0) return(NO_SUCH_PAGE);
> >>     else {
> >>       Graphics2D g2d = (Graphics2D)g;
> >>       g2d.translate(pageFormage.getImageableX(),
> >>                     pageFormat.getImageableY());
> >>       disableDoubleBuffering(componentToPrint);
> >>       componentToPrint.paint(g2d);
> >>       enableDoubleBuffering(componentToPrint);
> >>       return(PAGE_EXISTS);
> >>     }
> >>   }
> >>   public static void disableDoubleBuffering(Component c) {
> >>     RepaintManager currentManager =
> RepaintManager.currentManager(c);
> >>     currentManager.setDoubleBufferingEnabled(false);
> >>   }
> >>   public static void enableDoubleBuffering(Component c) {
> >>     RepaintManager currentManager =
> RepaintManager.currentManager(c);
> >>     currentManager.setDoubleBufferingEnabled(true);
> >>   }
> >> }
> >>
> >> Then, in the class we're printing the panel from, we call:
> >>
> >> PrintUtilities.printComponent(panel, rect);
> >>
> >> The quality of the text when printing is absolutely perfect:
> >> it's clear and
> >> smooth with no fuzziness or pixelation, regardless of whether
> >> anti-aliasing
> >> was on or off.  This is exactly what we'd like to achieve
> >> when saving our
> >> images, is that wonderful text quality.
> >>
> >> Is there any way of doing this?  I'm asking here because
> it might be
> >> possible with the JAI package, even though there may be other
> >> solutions.
> >> We've already tried looking at the various objects
> >> PrintUtilities uses in
> >> order to see if there was a way to capture the output (in
> >> bytes I suppose)
> >> being sent to the printer, but so far that's a no-go.  So,
> I'm hoping
> >> there's something in the JAI package that will do what we'd
> >> really like.
> >>
> >> Thanks for reading my long-winded post!
> >> Kate Wintjen
> >>
> >> Kate Wintjen
> >> :-) <[EMAIL PROTECTED]>
> >> * 314-232-6086
> >> * S306-4060
> >>
> >
> >=============================================================
> ==============
> >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".
>

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