double ty = (imageBounds.getY() - applicationBounds.getMinY());
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);
}