Package java.awt

Examples of java.awt.Graphics2D.drawRenderedImage()


      if (src.getType() == targetType) {
        return src;
      }
      BufferedImage tgt = new BufferedImage(src.getWidth(), src.getHeight(), targetType);
      Graphics2D g = tgt.createGraphics();
      g.drawRenderedImage(src, null);
      g.dispose();
      return tgt;
    }
  }
}
View Full Code Here


      if (src.getType() == targetType) {
        return src;
      }
      BufferedImage tgt = new BufferedImage(src.getWidth(), src.getHeight(), targetType);
      Graphics2D g = tgt.createGraphics();
      g.drawRenderedImage(src, null);
      g.dispose();
      return tgt;
    }
  }
View Full Code Here

      Graphics2D g = bdest.createGraphics();
      // TODO escaralar con altura fija.
      AffineTransform at = AffineTransform.getScaleInstance(
          (double) width / bsrc.getWidth(), (double) height
              / bsrc.getHeight());
      g.drawRenderedImage(bsrc, at);
      temp = new ImageIcon(bdest);
    } catch (IOException e) {
      e.printStackTrace();
    }
    return temp;
View Full Code Here

            Dimension size = new Dimension(image.getWidth(), image.getHeight());
            buf = buildBufferedImage(size);
           
            Graphics2D g = createGraphics(buf);
           
            g.drawRenderedImage(image, IDENTITY);
            g.dispose();
        }

        //
        // Cache image and set xlink:href
View Full Code Here

        AffineTransform redTxf = new AffineTransform();
        Point2D.Double redVec = new Point2D.Double();
        RenderedImage refRed = null;
        if(ARed != null){
            // System.out.println("Drawing A");
            g.drawRenderedImage(ARed, redTxf);
            refRed = ARed;
        }
        if(BRed != null){
            // System.out.println("Drawing B");
View Full Code Here

            redVec.y = Math.floor(redVec.y) - (BRed.getMinY() - refRed.getMinY());

            // System.out.println("BRed adjust : " + redVec);

                // redTxf.setToTranslation(redVec.x, redVec.y);
            g.drawRenderedImage(BRed, redTxf);
        }
        if(CRed != null){
            // System.out.println("Drawing C");

            if(refRed == null){
View Full Code Here

            redVec.y = Math.floor(redVec.y) - (CRed.getMinY() - refRed.getMinY());

            // System.out.println("CRed adjust : " + redVec);

                // redTxf.setToTranslation(redVec.x, redVec.y);
            g.drawRenderedImage(CRed, redTxf);
        }
        if(DRed != null){
            // System.out.println("Drawing D");

            if(refRed == null){
View Full Code Here

            redVec.y = Math.floor(redVec.y) - (DRed.getMinY() - refRed.getMinY());

            // System.out.println("DRed adjust : " + redVec);

                // redTxf.setToTranslation(redVec.x, redVec.y);
            g.drawRenderedImage(DRed, redTxf);
        }

        CachableRed realTile;
        realTile = new BufferedImageCachableRed(realTileBI,
                                                realTileRectDev.x,
View Full Code Here

                g2d.setPaint(bgcolor);
                g2d.fillRect(0, 0, w, h);
                g2d.dispose();
            }
            if (rend != null) { // might be null if the svg document is empty
                g2d.drawRenderedImage(rend, new AffineTransform());
            }
            rend = null; // We're done with it...
            writeImage(dest, output);
        } catch (Exception ex) {
            throw new TranscoderException(ex);
View Full Code Here

        Dimension size = new Dimension(image.getWidth(), image.getHeight());
        BufferedImage buf = buildBufferedImage(size);

        Graphics2D g = createGraphics(buf);

        g.drawRenderedImage(image, IDENTITY);
        g.dispose();

        // Save image into file
        saveBufferedImageToFile(imageElement, buf, generatorContext);
    }
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.