Package java.awt

Examples of java.awt.Graphics2D.drawRenderedImage()


                    }
                }
            }
            g2d.drawRenderedImage(bufImage, at);
        } else {
            g2d.drawRenderedImage(rend, at);
        }
    }

    private BufferedImage makeTransparentImage(RenderedImage src) {
        BufferedImage bufImage = new BufferedImage(src.getWidth(), src.getHeight(),
View Full Code Here


    private BufferedImage makeTransparentImage(RenderedImage src) {
        BufferedImage bufImage = new BufferedImage(src.getWidth(), src.getHeight(),
                BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2d = bufImage.createGraphics();
        g2d.drawRenderedImage(src, new AffineTransform());
        g2d.dispose();
        return bufImage;
    }

    /** {@inheritDoc} */
 
View Full Code Here

            try {
                AffineTransform at = new AffineTransform();
                double sx = targetDim.getWidth() / img.getWidth();
                double sy = targetDim.getHeight() / img.getHeight();
                at.scale(sx, sy);
                g2d.drawRenderedImage(alphat, at);
            } finally {
                g2d.dispose();
            }
            /*
            try {
View Full Code Here

                baseTransform = new AffineTransform();
            }
            dataDst = createBufferedImage(isize, _type);
            Graphics dataG = Sprite._createImageGraphics((BufferedImage) dataDst);
            Graphics2D g = Sprite.wrapRendering(dataG);
            g.drawRenderedImage(i, (AffineTransform) baseTransform);
            g.dispose();
            ((BufferedImage) dataDst).flush();
        }
        i.flush();
        writeToOutput(metadata, r.getStreamMetadata(), w, iwp, dataDst);
View Full Code Here

        }
        bdata = createBufferedImage(dim, _type);
        Graphics dataG = Sprite._createImageGraphics(bdata);
        Graphics2D g = Sprite.wrapRendering(dataG);
        if (data instanceof RenderedImage) {
            g.drawRenderedImage((RenderedImage) data, new AffineTransform());
        } else {
            g.drawImage((Image) data, new AffineTransform(), obs);
        }
        dataG.dispose();
        if (data instanceof Image) {
View Full Code Here

            BufferedImage destImage = new BufferedImage(newWidth,newHeight,BufferedImage.TYPE_INT_RGB);
            Graphics2D g = destImage.createGraphics();
            g.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                               RenderingHints.VALUE_INTERPOLATION_BICUBIC);
            AffineTransform at = AffineTransform.getScaleInstance((double)newWidth/src.getWidth(), (double)newHeight/src.getHeight());
            g.drawRenderedImage(src, at);
            ImageIO.write(destImage,imageFormat, new File(destFile));
            return true;
        }catch(Exception e)
        {
            return false;
View Full Code Here

    BufferedImage bdest =
        new BufferedImage(destWidth, destHight, BufferedImage.TYPE_INT_ARGB);
    Graphics2D g = bdest.createGraphics();
     AffineTransform at =
        AffineTransform.getScaleInstance(xScale,yScale);
     g.drawRenderedImage(img,at);

    graphics.drawImage(bdest, posX, posY, null);
   
}
/**
 
View Full Code Here

    BufferedImage bdest =
        new BufferedImage(destWidth, destHight, BufferedImage.TYPE_INT_ARGB);
    Graphics2D g = bdest.createGraphics();
     AffineTransform at =
        AffineTransform.getScaleInstance(xScale,yScale);
     g.drawRenderedImage(img,at);

     return img;
}
  /**
   * Compute the filename based on the stretching factor
View Full Code Here

        } else {
            decodedImage = new BufferedImage(decodedRenderedImage.getWidth(),
                                             decodedRenderedImage.getHeight(),
                                             BufferedImage.TYPE_INT_ARGB);
            ig = decodedImage.createGraphics();
            ig.drawRenderedImage(decodedRenderedImage,
                                 new AffineTransform());
            ig.dispose();
        }

        // Compare images
View Full Code Here

    BufferedImage bdest =
        new BufferedImage(destWidth, destHight, BufferedImage.TYPE_INT_ARGB);
    Graphics2D g = bdest.createGraphics();
     AffineTransform at =
        AffineTransform.getScaleInstance(xScale,yScale);
     g.drawRenderedImage(img,at);

    graphics.drawImage(bdest, posX, posY, null);
   
}
/**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.