Java BufferedImage Transform translateToTopLeftMargin(Graphics2D g2d, PageFormat pageFormat)

Here you can find the source of translateToTopLeftMargin(Graphics2D g2d, PageFormat pageFormat)

Description

This function is not idempotent.

License

BSD License

Parameter

Parameter Description
g2d a parameter
pageFormat a parameter

Declaration

public static void translateToTopLeftMargin(Graphics2D g2d, PageFormat pageFormat) 

Method Source Code

//package com.java2s;
/**/*from  w  w w .  j ava  2s  .c  o m*/
 * <p>
 * This software is distributed under the <a href="http://hci.stanford.edu/research/copyright.txt">
 * BSD License</a>.
 * </p>
 * 
 * @author <a href="http://graphics.stanford.edu/~ronyeh">Ron B Yeh</a> [ronyeh(AT)cs.stanford.edu]
 * @created Mar 8, 2006
 * 
 * Utilities for manipulating and working with the PrinterGraphics object passed into print methods.
 */

import java.awt.Graphics2D;
import java.awt.print.PageFormat;

public class Main {
    /**
     * This function is not idempotent. Call it twice, and it will translate more and more...
     * 
     * @param g2d
     * @param pageFormat
     * @created Mar 8, 2006
     * @author Ron Yeh
     */
    public static void translateToTopLeftMargin(Graphics2D g2d, PageFormat pageFormat) {
        g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
    }
}

Related

  1. transformImage(BufferedImage image, AffineTransform transform)
  2. transformImage(BufferedImage image, AffineTransform transform)
  3. transformImage(BufferedImage image, AffineTransform transform, int newWidth, int newHeight)
  4. transformImage2(BufferedImage image, AffineTransform transform)
  5. transformToolIcon(BufferedImage source, int width, int height)