final ImageValueFacet facet = value.getSpecification().getFacet(ImageValueFacet.class);
final java.awt.Image image = facet.getImage(value);
if (image != null) {
final Size imageSize = new Size(facet.getWidth(value), facet.getHeight(value));
if (imageSize.getWidth() <= w && imageSize.getHeight() <= h) {
canvas.drawImage(new AwtImage(image), left, top);
} else {
canvas.drawImage(new AwtImage(image), left, top, w, h);
}
}
}
}