ImageGraphics2D imageG2D = (ImageGraphics2D) img;
renderer.getGraphics2DAdapter().paintImage(
imageG2D.getGraphics2DImagePainter(), context, x, y, width,
height);
} else if (img instanceof ImageRendered) {
ImageRendered imgRend = (ImageRendered) img;
AffineTransform at = new AffineTransform();
at.translate(x / 1000f, y / 1000f);
double sx = (double) width
/ (double) info.getSize().getWidthMpt();
double sy = (double) height
/ (double) info.getSize().getHeightMpt();
sx *= ua.getSourceResolution()
/ info.getSize().getDpiHorizontal();
sy *= ua.getSourceResolution()
/ info.getSize().getDpiVertical();
at.scale(sx, sy);
state.getGraph().drawRenderedImage(imgRend.getRenderedImage(),
at);
} else if (img instanceof ImageXMLDOM) {
ImageXMLDOM imgXML = (ImageXMLDOM) img;
renderer.renderXML(context, imgXML.getDocument(), imgXML
.getRootNamespace());