final XPropertySet xImage = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
m_xGraphicProvider.queryGraphic( value ) );
if (xImage != null)
{
final XPropertySetInfo xInfo = xImage.getPropertySetInfo();
if (xInfo.hasPropertyByName("Size100thMM"))
{
Size imageSize = (Size) xImage.getPropertyValue("Size100thMM");
dim.setSize(imageSize.Width, imageSize.Height);
if (dim.height == 0 && dim.width == 0)
{
imageSize = (Size) xImage.getPropertyValue("SizePixel");
final int dpi = java.awt.Toolkit.getDefaultToolkit().getScreenResolution();
final double fac = 2540 / dpi;
dim.setSize(imageSize.Width * fac, imageSize.Height * fac);
}
}
else if (xInfo.hasPropertyByName("SizePixel"))
{
final Size imageSize = (Size) xImage.getPropertyValue("SizePixel");
final int dpi = java.awt.Toolkit.getDefaultToolkit().getScreenResolution();
final double fac = 2540 / dpi;
dim.setSize(imageSize.Width * fac, imageSize.Height * fac);