It seems that raster images are loaded with a 96 DPI resolution. If you are using the default page size for Impress (11.02" x 8.27") then the fully fitting raster image size (in pixels) is:
1058 x 794
Also, if you stick with this size (as it is probably the most compatible choice for example when you are saving to PPT), do not rely on the fact that this is the default. After document is created you can set the size of the slides by setting the Width
and Height
property of any page (it seems that all other pages going to follow after you resize one of them).
The API uses a 100/mm scale. 11.02 iches are 280 mm, so width is 280 * 100 = 28000, height is 21000.
Java example to resize the presentaion to 11.02" x 8.27" and insert (a preferably 4:3) image to fit the whole page:
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);