Your code works for me. I tested in PowerPoint 2003 and OpenOffice 2.2
and the images are in place.
Which version of PowerPoint you are using? Anything special with the
image file?
Yegor
> Hello
> I want to insert the same image on several slides, but it works only on the
> first slide.
> For the others I've got a red cross.
> Here a sample code :
> SlideShow ppt = new SlideShow();
>
> Slide s = ppt.createSlide();
> Slide s2 = ppt.createSlide();
> Slide s3 = ppt.createSlide();
>
> int idx = ppt.addPicture(new File("image.jpg"), Picture.JPEG);
> Picture pict = new Picture(idx);
> Picture pict2 = new Picture(idx);
> Picture pict3 = new Picture(idx);
>
> pict.setAnchor(new Rectangle(10,10,100,100));
> s.addShape(pict);
>
>
> pict2.setAnchor(new Rectangle(10,10,100,100));
> s2.addShape(pict2);
>
>
> pict3.setAnchor(new Rectangle(10,10,100,100));
> s3.addShape(pict3);
> FileOutputStream out = new FileOutputStream("report.ppt");
> ppt.write(out);
> out.close();
> Thanks
> MG
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]