Package ae.java.awt

Examples of ae.java.awt.Graphics2D


        } else {
            dest = ICCBIFilter(src, srcColorSpace, dest, destColorSpace);
        }

        if (savdest != null) {
            Graphics2D big = savdest.createGraphics();
            try {
                big.drawImage(dest, 0, 0, null);
            } finally {
                big.dispose();
            }
            return savdest;
        } else {
            return dest;
        }
View Full Code Here


                    noTrans = false;
                    break;
                }
            }
            if (noTrans) {
                Graphics2D g = dest.createGraphics();
                try {
                    g.drawImage(src, 0, 0, null);
                } finally {
                    g.dispose();
                }

                return dest;
            }
        }
View Full Code Here

            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);

            result = computePixelBounds(im);
            result.x -= MARGIN - bounds.x;
            result.y -= MARGIN - bounds.y;
View Full Code Here

     */
    BufferedImage makeBufferedImage(Image img, Color bgColor, int type,
                                    int sx1, int sy1, int sx2, int sy2)
    {
        BufferedImage bimg = new BufferedImage(sx2-sx1, sy2-sy1, type);
        Graphics2D g2d = bimg.createGraphics();
        g2d.setComposite(AlphaComposite.Src);
        if (bgColor != null) {
            g2d.setColor(bgColor);
            g2d.fillRect(0, 0, sx2-sx1, sy2-sy1);
            g2d.setComposite(AlphaComposite.SrcOver);
        }
        g2d.drawImage(img, -sx1, -sy1, null);
        g2d.dispose();
        return bimg;
    }
View Full Code Here

                                                    getTransparency());
    }

    public BufferedImage getSnapshot() {
        BufferedImage bi = getBackupImage();
        Graphics2D g = bi.createGraphics();
        g.setComposite(AlphaComposite.Src);
        g.drawImage(this, 0, 0, null);
        g.dispose();
        return bi;
    }
View Full Code Here

        return new SunGraphics2D(SurfaceData.getPrimarySurfaceData(this),
                                 fg, bg, font);
    }

    private void initSurface(int width, int height) {
        Graphics2D g2 = createGraphics();
        try {
            g2.clearRect(0, 0, width, height);
        } finally {
            g2.dispose();
        }
    }
View Full Code Here

    public boolean drawToBufImage(Graphics g, ToolkitImage img,
                                  AffineTransform xform,
                                  ImageObserver iw)
    {
        Graphics2D g2 = (Graphics2D) g;

        if (src != null) {
            src.checkSecurity(null, false);
        }
        if ((availinfo & ImageObserver.ERROR) != 0) {
            if (iw != null) {
                iw.imageUpdate(image, ImageObserver.ERROR|ImageObserver.ABORT,
                               -1, -1, -1, -1);
            }
            return false;
        }
        boolean done  = ((availinfo & ImageObserver.ALLBITS) != 0);
        boolean abort = ((availinfo & ImageObserver.ABORT) != 0);

        if (!done && !abort) {
            addWatcher(iw);
            startProduction();
            // Some producers deliver image data synchronously
            done = ((availinfo & ImageObserver.ALLBITS) != 0);
        }

        if (done || (0 != (availinfo & ImageObserver.FRAMEBITS))) {
            g2.drawImage (bimage, xform, null);
        }

        return done;
    }
View Full Code Here

    public BufferedImageGraphicsConfig(BufferedImage bufImg, Component comp) {
        if (comp == null) {
            this.gd = new BufferedImageDevice(this);
        } else {
            Graphics2D g2d = (Graphics2D)comp.getGraphics();
            this.gd = g2d.getDeviceConfiguration().getDevice();
        }
        this.model = bufImg.getColorModel();
        this.raster = bufImg.getRaster().createCompatibleWritableRaster(1, 1);
        this.width = bufImg.getWidth();
        this.height = bufImg.getHeight();
View Full Code Here

TOP

Related Classes of ae.java.awt.Graphics2D

Copyright © 2018 www.massapicom. 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.