List of utility methods to do BufferedImage Transform
BufferedImage | transformImage2(BufferedImage image, AffineTransform transform) transform Image BufferedImage result = createOptimalImage(image, image.getWidth(), image.getHeight());
Graphics2D g2d = (Graphics2D) result.createGraphics();
g2d.drawImage(image, transform, null);
g2d.dispose();
return result;
|
BufferedImage | transformToolIcon(BufferedImage source, int width, int height) transform Tool Icon BufferedImage result = source; int rw = result.getWidth(); int rh = result.getHeight(); if (rw != width || rh != height) { float scale = Math.min((float) (width / rw), (float) (height / rh)); int nw = (int) (rw * scale); int nh = (int) (rh * scale); int x = 0, y = 0; ... |
void | translateToTopLeftMargin(Graphics2D g2d, PageFormat pageFormat) This function is not idempotent. g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY()); |