Examples of createGraphics()


Examples of ae.java.awt.GraphicsEnvironment.createGraphics()

     *          image.
     */
    public Graphics2D createGraphics() {
        GraphicsEnvironment env =
            GraphicsEnvironment.getLocalGraphicsEnvironment();
        return env.createGraphics(this);
    }

    /**
     * Returns a subimage defined by a specified rectangular region.
     * The returned <code>BufferedImage</code> shares the same
View Full Code Here

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

            Rectangle bounds = r2d.getBounds();
            BufferedImage im = new BufferedImage(bounds.width + MARGIN * 2,
                                                 bounds.height + MARGIN * 2,
                                                 BufferedImage.TYPE_INT_ARGB);

            Graphics2D g2d = im.createGraphics();
            g2d.setColor(Color.WHITE);
            g2d.fillRect(0, 0, im.getWidth(), im.getHeight());

            g2d.setColor(Color.BLACK);
            draw(g2d, rx + MARGIN - bounds.x, ry + MARGIN - bounds.y);
View Full Code Here

Examples of com.google.code.appengine.awt.GraphicsEnvironment.createGraphics()

    }

    public Graphics2D createGraphics() {
        GraphicsEnvironment ge =
            GraphicsEnvironment.getLocalGraphicsEnvironment();
        return ge.createGraphics(this);
    }

    @Override
    public Graphics getGraphics() {
        return createGraphics();
View Full Code Here

Examples of com.google.code.appengine.awt.image.BufferedImage.createGraphics()

            (int)Math.ceil(bounds.getWidth()) + 1,
            (int)Math.ceil(bounds.getHeight()) + 1,
            BufferedImage.TYPE_INT_ARGB);

        // fill background
        Graphics2D graphics = image.createGraphics();
        graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR, 0.0f));
        graphics.fill(graphics.getDeviceConfiguration().getBounds());
        graphics.setComposite(AlphaComposite.SrcOver);

        // draw paint
View Full Code Here

Examples of com.itextpdf.text.pdf.PdfContentByte.createGraphics()

    PdfContentByte cb = writer.getDirectContent();
    Rectangle pagesize = document.getPageSize();
    float w = pagesize.getWidth();
    float h = pagesize.getHeight();

    Graphics2D g2 = cb.createGraphics(w, h);
    g2.setFont(new java.awt.Font("Arial", 0, 6));
    g2.setColor(new java.awt.Color(96, 96, 96));
    String produced =
      "(produced by " + Statics.shortProducer + " " + Statics.currentYear + ", #" + documentNumber + ", " + person0Name
        + ")";
View Full Code Here

Examples of com.itextpdf.text.pdf.PdfTemplate.createGraphics()

            throw new IOException(MessageLocalization.getComposedMessage("java.awt.image.fetch.aborted.or.errored"));
        }
        int w = pg.getWidth();
        int h = pg.getHeight();
        PdfTemplate tp = cb.createTemplate(w, h);
        Graphics2D g2d = tp.createGraphics(w, h, true, quality);
        g2d.drawImage(awtImage, 0, 0, null);
        g2d.dispose();
        return getInstance(tp);
    }
View Full Code Here

Examples of com.jogamp.opengl.util.awt.TextureRenderer.createGraphics()

   * @return
   */
  public static TextureRenderer makeText(String text) {
    // create texture for the text
    TextureRenderer textRenderer = new TextureRenderer(1, 3, false);
    Graphics2D g2d = textRenderer.createGraphics();
    FontRenderContext frc = g2d.getFontRenderContext();
    Font f = new Font("Arial", Font.BOLD, 18);
    String s = new String(text);
    TextLayout tl = new TextLayout(s, f, frc);
    // get the necessary size for the text to be rendered
View Full Code Here

Examples of com.lowagie.text.pdf.PdfContentByte.createGraphics()

            PdfWriter writer = PdfWriter.getInstance(document, out);
            document.open();
            for (int i = 0; i < pageStore.getPageCount(); ++i) {
                document.newPage();
                PdfContentByte pcb = writer.getDirectContent();
                Graphics2D g = pcb.createGraphics(
                        (float) pf.getWidth(), (float) pf.getHeight());
                Page page = pageStore.getPage(i);
                page.resolveForwards(context);
                page.draw(g, drawable.getX(), drawable.getY(),
                        drawable.getHeight());
View Full Code Here

Examples of com.lowagie.text.pdf.PdfTemplate.createGraphics()

            throw new IOException("java.awt.Image fetch aborted or errored");
        }
        int w = pg.getWidth();
        int h = pg.getHeight();
        PdfTemplate tp = cb.createTemplate(w, h);
        Graphics2D g2d = tp.createGraphics(w, h, true, quality);
        g2d.drawImage(awtImage, 0, 0, null);
        g2d.dispose();
        return getInstance(tp);
    }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfTemplate.createGraphics()

        PdfTemplate template = pdfContentByte.createTemplate((float)displayWidth, (float)displayHeight);

        Graphics2D g = forceSvgShapes
          ? template.createGraphicsShapes((float)displayWidth, (float)displayHeight)
          : template.createGraphics(availableImageWidth, availableImageHeight, new LocalFontMapper());

        if (clip != null)
        {
          g.setClip(clip);
        }
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.