use of org.apache.poi.hwmf.draw.HwmfGraphics in project poi by apache.
the class HwmfPicture method draw.
public void draw(Graphics2D ctx, Rectangle2D graphicsBounds) {
AffineTransform at = ctx.getTransform();
try {
Rectangle2D wmfBounds = getBounds();
// scale output bounds to image bounds
ctx.translate(graphicsBounds.getX(), graphicsBounds.getY());
ctx.scale(graphicsBounds.getWidth() / wmfBounds.getWidth(), graphicsBounds.getHeight() / wmfBounds.getHeight());
HwmfGraphics g = new HwmfGraphics(ctx, wmfBounds);
for (HwmfRecord r : records) {
r.draw(g);
}
} finally {
ctx.setTransform(at);
}
}
Aggregations