Package com.google.code.appengine.awt.geom

Examples of com.google.code.appengine.awt.geom.AffineTransform.scale()


                            .println("TTFGlyfTable: ARGS_ARE_POINTS not implemented.");
                }

                if (ttf.flagBit(SCALE)) {
                    double scale = ttf.readF2Dot14();
                    t.scale(scale, scale);
                } else if (ttf.flagBit(XY_SCALE)) {
                    double scaleX = ttf.readF2Dot14();
                    double scaleY = ttf.readF2Dot14();
                    t.scale(scaleX, scaleY);
                } else if (ttf.flagBit(TWO_BY_TWO)) {
View Full Code Here


                    double scale = ttf.readF2Dot14();
                    t.scale(scale, scale);
                } else if (ttf.flagBit(XY_SCALE)) {
                    double scaleX = ttf.readF2Dot14();
                    double scaleY = ttf.readF2Dot14();
                    t.scale(scaleX, scaleY);
                } else if (ttf.flagBit(TWO_BY_TWO)) {
                    System.err
                            .println("TTFGlyfTable: WE_HAVE_A_TWO_BY_TWO not implemented.");
                }
View Full Code Here

        GeneralPath path =  getPath();
        Rectangle2D anchor = getAnchor2D();
        Rectangle2D bounds = path.getBounds2D();
        AffineTransform at = new AffineTransform();
        at.translate(anchor.getX(), anchor.getY());
        at.scale(
                anchor.getWidth()/bounds.getWidth(),
                anchor.getHeight()/bounds.getHeight()
        );
        return at.createTransformedShape(path);
    }
View Full Code Here

                double scaleX =  exterior.getWidth() / interior.getWidth();
                double scaleY = exterior.getHeight() / interior.getHeight();

                tx.translate(exterior.getX(), exterior.getY());
                tx.scale(scaleX, scaleY);
                tx.translate(-interior.getX(), -interior.getY());
            }
            anchor = tx.createTransformedShape(anchor).getBounds2D();
        }
View Full Code Here

            // calcute a transformation for inside drawing
            // based on the stroke width
            AffineTransform at = new AffineTransform();
            if (oldBounds.getWidth() > 0) {
                at.scale(
                    (oldBounds.getWidth() - witdh) /
                        oldBounds.getWidth(), 1);
            }

            if (oldBounds.getHeight() > 0) {
View Full Code Here

                    (oldBounds.getWidth() - witdh) /
                        oldBounds.getWidth(), 1);
            }

            if (oldBounds.getHeight() > 0) {
                at.scale(1,
                    (oldBounds.getHeight() - witdh)
                        / oldBounds.getHeight());
            }

            // recalculate shape and its oldBounds
View Full Code Here

    public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) {
        waitForImage(img);
        double scalex = width/(double)img.getWidth(observer);
        double scaley = height/(double)img.getHeight(observer);
        AffineTransform tx = AffineTransform.getTranslateInstance(x,y);
        tx.scale(scalex,scaley);
        return drawImage(img, null, tx, bgcolor, observer);
    }
   
    /**
     * @see Graphics#drawImage(Image, int, int, int, int, int, int, int, int, ImageObserver)
View Full Code Here

        double scaley = dheight/sheight;
       
        double transx = sx1*scalex;
        double transy = sy1*scaley;
        AffineTransform tx = AffineTransform.getTranslateInstance(dx1-transx,dy1-transy);
        tx.scale(scalex,scaley);
       
        BufferedImage mask = new BufferedImage(img.getWidth(observer), img.getHeight(observer), BufferedImage.TYPE_BYTE_BINARY);
        Graphics g = mask.getGraphics();
        g.fillRect(sx1,sy1, (int)swidth, (int)sheight);
        drawImage(img, mask, tx, null, observer);
View Full Code Here

                Rectangle2D rect = tp.getAnchorRect();
                com.lowagie.text.Image image = com.lowagie.text.Image.getInstance(img, null);
                PdfPatternPainter pattern = cb.createPattern(image.getWidth(), image.getHeight());
                AffineTransform inverse = this.normalizeMatrix();
                inverse.translate(rect.getX(), rect.getY());
                inverse.scale(rect.getWidth() / image.getWidth(), -rect.getHeight() / image.getHeight());
                double[] mx = new double[6];
                inverse.getMatrix(mx);
                pattern.setPatternMatrix((float)mx[0], (float)mx[1], (float)mx[2], (float)mx[3], (float)mx[4], (float)mx[5]) ;
                image.setAbsolutePosition(0,0);
                pattern.addImage(image);
View Full Code Here

                fillRect = inv.createTransformedShape(fillRect);
                g.setPaint(paint);
                g.fill(fillRect);
                if (invert) {
                    AffineTransform tx = new AffineTransform();
                    tx.scale(1,-1);
                    tx.translate(-xoffset,-yoffset);
                    g.drawImage(img,tx,null);
                }
                g.dispose();
                g = null;
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.