ラスタイメージに96 DPI解像度がロードされているようです。あなたはインプレス(11.02" ×8.27" )のデフォルトのページサイズを使用している場合(ピクセル単位)完全にフィットラスタ画像サイズは次のとおりです。
1058 X 794
また、あなたはこれに固執する場合サイズ(PPTに保存するときなど、おそらく最も互換性の高い選択肢なので)、これがデフォルトであるという事実に頼らないでください。ドキュメントが作成されたら、ページのWidth
とHeight
のプロパティを設定することで、スライドのサイズを設定できます(他のすべてのページのサイズを変更した後に続くと思われます)。
APIは100/mmスケールを使用します。 11.02 ichesは280ミリメートルであるので、幅が280 * 100 = 28000であり、高さは11.02" ×8.27"にpresentaionのサイズを変更し、(好ましくは、4:3)を挿入する21000
Javaの例である画像が収まるように全ページ:
XDrawPage page;
XMultiServiceFactory factory;
// ... setting up the environment and opening document
// resize the page (and all other pages) to our default size
XPropertySet pagePropSet = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, page);
pagePropSet.setPropertyValue("Width", 28000);
pagePropSet.setPropertyValue("Height", 21000);
// create GraphicObjectShape with the size of the page in the top-left corner
Object picture = factory.createInstance("com.sun.star.drawing.GraphicObjectShape");
XShape pictureShape = (XShape)UnoRuntime.queryInterface(XShape.class, picture);
pictureShape.setSize(new Size(28000, 21000));
pictureShape.setPosition(new Point(0, 0));
// load the image file into our the shape
XPropertySet propSet = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, pictureShape);
propSet.setPropertyValue("GraphicURL", new File("c:\\Users\\Vbence\\Downloads\\slide.png").toURI().toURL().toString());
// add the shape to the page
page.add(pictureShape);