diff options
author | Keiron Liddle <keiron@apache.org> | 2003-03-27 23:53:28 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2003-03-27 23:53:28 +0000 |
commit | 714095486e1f8a2adf6d4f2a68f68cd108044d49 (patch) | |
tree | be31d02b367f5493f708893591ebfe404d8a2472 /src/java/org/apache/fop/svg | |
parent | bf07554894e7fc074b4b2fe1727c6664751a4b59 (diff) | |
download | xmlgraphics-fop-714095486e1f8a2adf6d4f2a68f68cd108044d49.tar.gz xmlgraphics-fop-714095486e1f8a2adf6d4f2a68f68cd108044d49.zip |
moved image drawing so drawing with size also works
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196187 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/svg')
-rw-r--r-- | src/java/org/apache/fop/svg/PDFGraphics2D.java | 89 |
1 files changed, 44 insertions, 45 deletions
diff --git a/src/java/org/apache/fop/svg/PDFGraphics2D.java b/src/java/org/apache/fop/svg/PDFGraphics2D.java index d0bbaf9fe..915a364bc 100644 --- a/src/java/org/apache/fop/svg/PDFGraphics2D.java +++ b/src/java/org/apache/fop/svg/PDFGraphics2D.java @@ -406,6 +406,50 @@ public class PDFGraphics2D extends AbstractGraphics2D { return false; } + return drawImage(img, x, y, width, height, observer); + } + + private BufferedImage buildBufferedImage(Dimension size) { + return new BufferedImage(size.width, size.height, + BufferedImage.TYPE_INT_ARGB); + } + + /** + * Draws as much of the specified image as has already been scaled + * to fit inside the specified rectangle. + * <p> + * The image is drawn inside the specified rectangle of this + * graphics context's coordinate space, and is scaled if + * necessary. Transparent pixels do not affect whatever pixels + * are already there. + * <p> + * This method returns immediately in all cases, even if the + * entire image has not yet been scaled, dithered, and converted + * for the current output device. + * If the current output representation is not yet complete, then + * <code>drawImage</code> returns <code>false</code>. As more of + * the image becomes available, the process that draws the image notifies + * the image observer by calling its <code>imageUpdate</code> method. + * <p> + * A scaled version of an image will not necessarily be + * available immediately just because an unscaled version of the + * image has been constructed for this output device. Each size of + * the image may be cached separately and generated from the original + * data in a separate image production sequence. + * @param img the specified image to be drawn. + * @param x the <i>x</i> coordinate. + * @param y the <i>y</i> coordinate. + * @param width the width of the rectangle. + * @param height the height of the rectangle. + * @param observer object to be notified as more of + * the image is converted. + * @return true if the image was drawn + * @see java.awt.Image + * @see java.awt.image.ImageObserver + * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int) + */ + public boolean drawImage(Image img, int x, int y, int width, int height, + ImageObserver observer) { // first we look to see if we've already added this image to // the pdf document. If so, we just reuse the reference; // otherwise we have to build a FopImage and add it to the pdf @@ -543,51 +587,6 @@ public class PDFGraphics2D extends AbstractGraphics2D { return true; } - private BufferedImage buildBufferedImage(Dimension size) { - return new BufferedImage(size.width, size.height, - BufferedImage.TYPE_INT_ARGB); - } - - /** - * Draws as much of the specified image as has already been scaled - * to fit inside the specified rectangle. - * <p> - * The image is drawn inside the specified rectangle of this - * graphics context's coordinate space, and is scaled if - * necessary. Transparent pixels do not affect whatever pixels - * are already there. - * <p> - * This method returns immediately in all cases, even if the - * entire image has not yet been scaled, dithered, and converted - * for the current output device. - * If the current output representation is not yet complete, then - * <code>drawImage</code> returns <code>false</code>. As more of - * the image becomes available, the process that draws the image notifies - * the image observer by calling its <code>imageUpdate</code> method. - * <p> - * A scaled version of an image will not necessarily be - * available immediately just because an unscaled version of the - * image has been constructed for this output device. Each size of - * the image may be cached separately and generated from the original - * data in a separate image production sequence. - * @param img the specified image to be drawn. - * @param x the <i>x</i> coordinate. - * @param y the <i>y</i> coordinate. - * @param width the width of the rectangle. - * @param height the height of the rectangle. - * @param observer object to be notified as more of - * the image is converted. - * @return true if the image was drawn - * @see java.awt.Image - * @see java.awt.image.ImageObserver - * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int) - */ - public boolean drawImage(Image img, int x, int y, int width, int height, - ImageObserver observer) { - System.out.println("drawImage"); - return true; - } - /** * Disposes of this graphics context and releases * any system resources that it is using. |