Free Support Forum - aspose.com

Add 12 WMFs on 1 page?

Hi there,

I have a requirement to build a single slide with 3 by 4 grid of images/sides on it

is this possible ?

Currently the images are embeded in slides as wmfs.

Hi there,

is this possible ?

Sure, it’s possible. Just set correct coordinates for PictureFrames.
Also you can create table and put your images as background of cells.

What am I doing wrong then.....

this works, with a jpeg

Slide objSlide = Mergepres.AddEmptySlide();
Picture objPicture = new Picture(Mergepres, @"c:\cc.jpg");
int objPictureID = Mergepres.Pictures.Add(objPicture);
int pictureWidth = objPicture.Image.Width;
int pictureHeight = objPicture.Image.Height;

PictureFrame objPictureFrame = objSlide.Shapes.AddPictureFrame(objPictureID, 1, 1,pictureWidth, pictureHeight);

this does not, With my wmf file

Slide objSlide = Mergepres.AddEmptySlide();
Picture objPicture = new Picture(Mergepres, @"c:\Picture1.wmf");
int objPictureID = Mergepres.Pictures.Add(objPicture);
int pictureWidth = objPicture.Image.Width;
int pictureHeight = objPicture.Image.Height;

PictureFrame objPictureFrame = objSlide.Shapes.AddPictureFrame(objPictureID, 1, 1,pictureWidth, pictureHeight);

What wrong with wmf files? Red cross instead of image when you open it with PowerPoint?
MS PowerPoint doesn’t support some types of wmf files. Try another constructor to create Picture.

Metafile meta = new Metafile(“c:\Picture1.wmf”);
Picture objPicture =
new Picture(pres, meta);
int objPictureId = Mergepres.Pictures.Add(objPicture);

yes i see a red cross.

your metafile solution works perfectly, thanks