Examples of createGraphics()


Examples of java.awt.image.BufferedImage.createGraphics()

        BufferedImage missingImage = null;
        ReplacedElement mre;
        try {
            // TODO: we can come up with something better; not sure if we should use Alt text, how text should size, etc.
            missingImage = ImageUtil.createCompatibleBufferedImage(cssWidth, cssHeight, BufferedImage.TYPE_INT_RGB);
            Graphics2D g = missingImage.createGraphics();
            g.setColor(Color.BLACK);
            g.setBackground(Color.WHITE);
            g.setFont(new Font("Serif", Font.PLAIN, 12));
            g.drawString("Missing", 0, 12);
            g.dispose();
View Full Code Here

Examples of java.awt.image.BufferedImage.createGraphics()

    BufferedImage old_img = (BufferedImage)ImageIO.read(new File(img_fn))
    int width = old_img.getWidth();
    int height = old_img.getHeight();
   
    BufferedImage new_img = new BufferedImage(height,width,BufferedImage.TYPE_INT_RGB);       
        Graphics2D g2d =new_img.createGraphics();
       
        AffineTransform origXform = g2d.getTransform();
        AffineTransform newXform = (AffineTransform)(origXform.clone());
        // center of rotation is center of the panel
        double xRot = 0;
View Full Code Here

Examples of java.awt.image.BufferedImage.createGraphics()

            Rectangle2D target = (Rectangle2D) old.clone();
            target.add(mGhostRect);

            BufferedImage bf = new BufferedImage((int) target.getWidth(),
                (int) target.getHeight(), BufferedImage.TYPE_INT_ARGB_PRE);
            Graphics2D g2b = bf.createGraphics();

            int width = ((int) (mTreeImage.getWidth() - (target.getX() + target
                .getWidth()))) > 0 ? (int) target.getWidth()
                : (int) (mTreeImage.getWidth() - (target.getX()));
            int height = ((int) (mTreeImage.getHeight() - (target.getY() + target
View Full Code Here

Examples of java.awt.image.BufferedImage.createGraphics()

    final Rectangle2D otherArea = new Rectangle2D.Double();

    if ((ObjectUtilities.equal(bounds, this.bounds)) == false)
    {
      final BufferedImage image = new BufferedImage(1, 1, BufferedImage.TYPE_4BYTE_ABGR);
      final Graphics2D graphics = image.createGraphics();
      draw(graphics, bounds);
      graphics.dispose();
    }

    final ImageMap map = new ImageMap();
View Full Code Here

Examples of java.awt.image.BufferedImage.createGraphics()

    final int width = Math.max(1, (int) (scale * dim.width));
    final int height = Math.max(1, (int) (scale * dim.height));

    final BufferedImage bi = ImageUtils.createTransparentImage(width, height);
    final Graphics2D graph = bi.createGraphics();
    graph.setBackground(new Color(0, 0, 0, 0));
    graph.setTransform(AffineTransform.getScaleInstance(scale, scale));
    drawable.draw(graph, new Rectangle2D.Float(0, 0, dim.width, dim.height));
    graph.dispose();

View Full Code Here

Examples of java.awt.image.BufferedImage.createGraphics()

   * @param event the report event.
   */
  public void pageStarted(final ReportEvent event)
  {
    final BufferedImage image = new BufferedImage(150, 50, BufferedImage.TYPE_INT_ARGB);
    final Graphics2D g2 = image.createGraphics();
    final JButton bt = new JButton("A Button");
    bt.setSize(90, 20);
    final JRadioButton radio = new JRadioButton("A radio button");
    radio.setSize(100, 20);

View Full Code Here

Examples of java.awt.image.BufferedImage.createGraphics()

            MessageFormat.format(fileName, new Object[]{new Integer(i)});
        final BufferedImage image = createImage(report.getPageDefinition());

        final Rectangle rect = new Rectangle(0, 0, image.getWidth(), image.getHeight());
        // prepare the image by filling it ...
        final Graphics2D g2 = image.createGraphics();
        g2.setPaint(Color.white);
        g2.fill(rect);

        final PageDrawable pageDrawable = prc.getPageDrawable(i);
        pageDrawable.draw(g2, rect);
View Full Code Here

Examples of java.awt.image.BufferedImage.createGraphics()

    final WaitingImageObserver obs = new WaitingImageObserver(source);
    obs.waitImageLoaded();

    final BufferedImage bImage = new BufferedImage((int) (width * scale), (int) (height * scale), BufferedImage.TYPE_INT_ARGB);

    final Graphics2D graph = bImage.createGraphics();
    graph.setTransform(AffineTransform.getScaleInstance(scale, scale));
    graph.drawImage(source, AffineTransform.getScaleInstance(scale, scale), null);
    graph.dispose();
    return bImage;
  }
View Full Code Here

Examples of java.awt.image.BufferedImage.createGraphics()

                w = (int) (h * imageRatio);
        }
       
        BufferedImage bi = gc.createCompatibleImage(w, h, Transparency.TRANSLUCENT);
       
        Graphics g = bi.createGraphics();
        DcSwingUtilities.setRenderingHint(g);
        g.drawImage(image, 0, 0, w, h, null);
        g.dispose();
       
        bi.flush();
View Full Code Here

Examples of java.awt.image.BufferedImage.createGraphics()

    if (scale < 1.0d) {
      tx.scale(scale, scale);
    }

    Color bgColor = null;
    Graphics2D g2d = outImage.createGraphics();
    g2d.setColor(bgColor);
    g2d.fillRect(0, 0, scaledW, scaledH);
    g2d.drawImage(inImage, tx, null);
    g2d.dispose();
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.