Package java.awt.geom

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


  {
    AffineTransform origTransform = grx.getTransform();
   
    AffineTransform transform = new AffineTransform();
    transform.translate(1, 1);
    transform.scale(realZoom, realZoom);
    grx.transform(transform);
   
    try
    {
      drawPageError(grx);
View Full Code Here


        BufferedImage.TYPE_INT_RGB
        );
   
    Graphics2D grx = (Graphics2D) image.getGraphics();
    AffineTransform transform = new AffineTransform();
    transform.scale(realZoom, realZoom);
    grx.transform(transform);

    drawPageError(grx);
   
    return image;
View Full Code Here

    private static AffineTransform createGradientTransform(Rectangle2D r) {
        double cx = r.getCenterX();
        double cy = r.getCenterY();
        AffineTransform xform = AffineTransform.getTranslateInstance(cx, cy);
        xform.scale(r.getWidth()/2, r.getHeight()/2);
        xform.translate(-cx, -cy);
        return xform;
    }

    /**
 
View Full Code Here

   
  }
  private BufferedImage scale(BufferedImage bi, double scaleX, double scaleY)
    {
        AffineTransform tx = new AffineTransform();
        tx.scale(scaleX, scaleY);
        AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BICUBIC);
        return op.filter(bi, null);
    }
}
View Full Code Here

          }
          Integer superscript = (Integer)attrs.get(TextAttribute.SUPERSCRIPT);
          if (TextAttribute.SUPERSCRIPT_SUPER.equals(superscript))
          {
            atrans = new AffineTransform();
            atrans.scale(2 / 3d, 2 / 3d);
            atrans.translate(0, - awtFont.getSize() / 2f);
            awtFont = awtFont.deriveFont(atrans);
          }
          else if (TextAttribute.SUPERSCRIPT_SUB.equals(superscript))
          {
View Full Code Here

            awtFont = awtFont.deriveFont(atrans);
          }
          else if (TextAttribute.SUPERSCRIPT_SUB.equals(superscript))
          {
            atrans = new AffineTransform();
            atrans.scale(2 / 3d, 2 / 3d);
            atrans.translate(0, awtFont.getSize() / 2f);
            awtFont = awtFont.deriveFont(atrans);
          }
          awtAttributedString.addAttribute(TextAttribute.FONT, awtFont, iterator.getIndex(), runLimit);
        }
View Full Code Here

    BufferedImage image = ImageIO.read(new ByteArrayInputStream(imageResult.getImage()));
    double scaleX = imageBounds.getWidth() / image.getWidth();
    double scaleY = imageBounds.getHeight() / image.getHeight();
    AffineTransform transform = new AffineTransform();
    transform.translate(tx, ty);
    transform.scale(scaleX, scaleY);
    if (log.isDebugEnabled()) {
      log.debug("adding image, width=" + image.getWidth() + ",height=" + image.getHeight() + ",x=" + tx + ",y="
          + ty);
    }
    // opacity
View Full Code Here

    grx.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
    grx.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);

    AffineTransform atrans = new AffineTransform();
    atrans.translate(globalOffsetX, globalOffsetY);
    atrans.scale(zoom, zoom);
    grx.transform(atrans);

    java.util.List pages = jasperPrint.getPages();
    if (pages != null)
    {
View Full Code Here

  private static BufferedImage scale(BufferedImage image, double xFactor, double yFactor) {

    // scale image based on factor x and y
    AffineTransform scaleTransform = new AffineTransform();
    scaleTransform.scale(xFactor, yFactor);

    BufferedImage result = new BufferedImage((int) (image.getWidth() * xFactor), (int) (image.getHeight() * yFactor), BufferedImage.TYPE_INT_RGB);

    Graphics2D g2 = (Graphics2D) result.getGraphics();

View Full Code Here

        }

        // Scaling.
        Rectangle2D contentBox = contentContext.getBox();
        Dimension2D rotatedCanvasSize = rotation.transform(canvasSize);
        initialCtm.scale(
          rotatedCanvasSize.getWidth() / contentBox.getWidth(),
          rotatedCanvasSize.getHeight() / contentBox.getHeight()
          );

        // Origin alignment.
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.