Examples of drawRenderedImage()


Examples of com.google.code.appengine.awt.Graphics2D.drawRenderedImage()

            image.getHeight(),
            BufferedImage.TYPE_INT_RGB);
        Graphics2D g = (Graphics2D)bufferedImage.getGraphics();
        g.setBackground(bkg);
        g.clearRect(0, 0, image.getWidth(), image.getHeight());
        g.drawRenderedImage(image, new AffineTransform());
        return bufferedImage;
    }

    public static byte[] getBytes(Image image, Color bkg, String code, int pad, ImageObserver observer) {
        return getBytes(createRenderedImage(image, observer, bkg), bkg, code, pad);
View Full Code Here

Examples of edu.uci.ics.jung.visualization.transform.shape.TransformingGraphics.drawRenderedImage()

                       
                        if (ri != null) {
                           
                            Shape clip = g2d.getClip();
                            g2d.setClip(perspectiveShape);
                            g2d.drawRenderedImage(ri, AffineTransform
                                    .getTranslateInstance(xLoc, yLoc));
                            g2d.setClip(clip);
                        }
                    } else {
                        g2d.drawImage(image, AffineTransform.getTranslateInstance(xLoc,
View Full Code Here

Examples of java.awt.Graphics2D.drawRenderedImage()

      BufferedImage dest = createImage(w, h);

      Graphics2D g2d = GraphicsUtil.createGraphics(dest);

      g2d.drawRenderedImage(rend, new AffineTransform());

      g2d.dispose();

      rend = null; // We're done with it...
      sendImage(dest);
View Full Code Here

Examples of java.awt.Graphics2D.drawRenderedImage()

      skyImageStream.close();
      // Create a temporary image base light twice as high that will contain sky image in the top part
      BufferedImage imageBaseLightImage = new BufferedImage(skyImage.getWidth(),
          skyImage.getHeight() * 2, BufferedImage.TYPE_INT_RGB);
      Graphics2D g2D = (Graphics2D)imageBaseLightImage.getGraphics();
      g2D.drawRenderedImage(skyImage, null);
      g2D.dispose();
      File imageFile = OperatingSystem.createTemporaryFile("ibl", ".png");
      ImageIO.write(imageBaseLightImage, "png", imageFile);
     
      this.sunflow.parameter("texture", imageFile.getAbsolutePath());
View Full Code Here

Examples of java.awt.Graphics2D.drawRenderedImage()

            // Compute a partially transparent image
            BufferedImage transparentImage = new BufferedImage(image.getWidth(),
                image.getHeight(), BufferedImage.TYPE_INT_ARGB);
            Graphics2D g2D = (Graphics2D)transparentImage.getGraphics();
            g2D.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, transparency));
            g2D.drawRenderedImage(image, null);
            g2D.dispose();
            image = transparentImage;
          }
          File imageFile = OperatingSystem.createTemporaryFile("texture", ".png");
          ImageIO.write(image, "png", imageFile);
View Full Code Here

Examples of java.awt.Graphics2D.drawRenderedImage()

                    (BufferedImage)transferable.getTransferData(DataFlavor.imageFlavor);
                float scale = Math.min(1, 128f / Math.max(transferedImage.getWidth(), transferedImage.getHeight()));
                BufferedImage iconImage = new BufferedImage(128, 128, BufferedImage.TYPE_INT_ARGB);
                Graphics2D g2D = (Graphics2D)iconImage.getGraphics();
                g2D.scale(scale, scale);
                g2D.drawRenderedImage(transferedImage, null);
                g2D.dispose();
                return new ImageIcon(iconImage);
              }
            } catch (UnsupportedFlavorException ex) {
              // Use default representation
View Full Code Here

Examples of java.awt.Graphics2D.drawRenderedImage()

    int destHeight = new Double(src.getHeight() * scale).intValue();
    log.debug("Generating thumbnail, w={}, h={}", destWidth, destHeight);
    BufferedImage dest = new BufferedImage(destWidth, destHeight, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = dest.createGraphics();
    AffineTransform at = AffineTransform.getScaleInstance((double) destWidth / src.getWidth(), (double) destHeight  / src.getHeight());
    g.drawRenderedImage(src, at);
    ImageIO.write(dest, suffix.substring(1), outputStream);
  }
}
View Full Code Here

Examples of java.awt.Graphics2D.drawRenderedImage()

        int tx = insets.left + originX;
        int ty = insets.top  + originY;

        // Translation moves the entire image within the container
        try {
            g2d.drawRenderedImage(source,
                                  AffineTransform.getTranslateInstance(tx, ty));
        } catch( OutOfMemoryError e ) {
        }
    }
View Full Code Here

Examples of java.awt.Graphics2D.drawRenderedImage()

                    case FIT:
                        image = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
                        Graphics2D g2 = image.createGraphics();
                        AffineTransform at = AffineTransform.getScaleInstance((double)image.getWidth() / sourceImage.getWidth(), (double)image.getHeight() / sourceImage.getHeight());
                        g2.drawRenderedImage(sourceImage, at);
                        g2.dispose();
                        break;
                }
            }
            else {
View Full Code Here

Examples of java.awt.Graphics2D.drawRenderedImage()

                                                         ty + transY);
                if (backgroundColor != null) {
                    g2D.fillRect(tx + transX, ty + transY,
                                 tileWidth, tileHeight);
                }
                g2D.drawRenderedImage(bi, transform);
            }
        }

        // Restore color
        g2D.setColor(saveColor);
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.