// Instantiate Presentation class that represents the PPTX
Presentation pres = new Presentation();
try {
// Get the first slide
ISlide sld = pres.getSlides().get_Item(0);
// Add AutoShape of rectangle type
IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 75, 150);
// Set the fill type to Picture
shp.getFillFormat().setFillType(FillType.Picture);
// Set the picture fill mode
shp.getFillFormat().getPictureFillFormat().setPictureFillMode(PictureFillMode.Tile);
// Set the picture
IPPImage imgx = pres.getImages().addImage(new FileInputStream(new File("aspose1.jpg")));
shp.getFillFormat().getPictureFillFormat().getPicture().setImage(imgx);
// Write the PPTX file to disk
pres.save("RectShpPic.pptx", SaveFormat.Pptx);
} catch (IOException e) {
} finally {
if (pres != null) pres.dispose();
}