Package java.awt.geom

Examples of java.awt.geom.AffineTransform.scale()


            // transform the AOI into the image's coordinate system
            aoi = Px.createTransformedShape(aoi).getBounds2D();
            AffineTransform Mx = new AffineTransform();
            double sx = width / aoi.getWidth();
            double sy = height / aoi.getHeight();
            Mx.scale(sx, sy);
            double tx = -aoi.getX();
            double ty = -aoi.getY();
            Mx.translate(tx, ty);
            // take the AOI transformation matrix into account
            // we apply first the preserveAspectRatio matrix
View Full Code Here


        AffineTransform localTransform = new AffineTransform();
        localTransform.translate(x, y);
        if (fontTransform != null) {
            localTransform.concatenate(fontTransform);
        }
        localTransform.scale(1, -1);
        double[] lt = new double[6];
        localTransform.getMatrix(lt);
        currentStream.write(PDFNumber.doubleOut(lt[0]) + " "
                + PDFNumber.doubleOut(lt[1]) + " " + PDFNumber.doubleOut(lt[2]) + " "
                + PDFNumber.doubleOut(lt[3]) + " " + PDFNumber.doubleOut(lt[4]) + " "
View Full Code Here

                        RenderingHints.VALUE_RENDER_QUALITY);
            }

            // transform page based on scale factor supplied
            AffineTransform at = graphics.getTransform();
            at.scale(scaleX, scaleY);
            graphics.setTransform(at);

            // draw page frame
            if (!transparentPageBackground) {
                graphics.setColor(Color.white);
View Full Code Here

      if(newSize.getX() > image.getWidth(null) || newSize.getY() > image.getHeight(null)) {
        throw new Exception("Requested zoom level ("+level+") is too high.");
      }
      AffineTransform tx = new AffineTransform();
      AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR);
      tx.scale(scale, scale);
      image = op.filter(image, null);
      BufferedImage zoomed = image.getSubimage(topLeft.getX(), topLeft.getY(), newSize.getX(), newSize.getY());
      if(level>maxLevel) {
        maxLevel = level;
      }
View Full Code Here

                at.translate(area.getX(), area.getY());
                //Scale image to fit
                double sx = w / ri.getWidth();
                double sy = h / ri.getHeight();
                if (sx != 1.0 || sy != 1.0) {
                    at.scale(sx, sy);
                }
                g2d.drawRenderedImage(ri, at);
            }

        };
View Full Code Here

        return clip;
    }

    public void scale(double sx, double sy) {
        AffineTransform at = new AffineTransform();
        at.scale(sx, sy);
        transform.concatenate(at);
    }
    //===============================================
    public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
        throw new RuntimeException("Not implemented");
View Full Code Here

            final AffineTransform tx2 = new AffineTransform();           
            final double scale = fontSize / (-hheadTable.getDescent() + ascent);
           
            tx2.translate(x, y + fontSize);
            tx2.scale(scale, -scale);
            tx2.translate(0, ascent);
           
            for (int i = 0; i < text.length(); i++) {
                // get the index for the needed glyph
                final char character = text.charAt(i);
View Full Code Here

                System.err.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.");
            }

            ShapedGlyph glyph = (ShapedGlyph) table.getGlyph(glyphIndex);
View Full Code Here

            // transform the AOI into the image's coordinate system
            aoi = Px.createTransformedShape(aoi).getBounds2D();
            AffineTransform Mx = new AffineTransform();
            double sx = width / aoi.getWidth();
            double sy = height / aoi.getHeight();
            Mx.scale(sx, sy);
            double tx = -aoi.getX();
            double ty = -aoi.getY();
            Mx.translate(tx, ty);
            // take the AOI transformation matrix into account
            // we apply first the preserveAspectRatio matrix
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.