Milind Anantwar
Milind Anantwar

Reputation: 82241

interop Shapes.AddPicture creates incorrect dimension for image

I am using interop to create powerpoint presentation.i use Shapes.AddPicture to add images to slide.

Shapes.AddPicture(strImagePath, Microsoft.Office.Core.MsoTriState.msoTrue, Microsoft.Office.Core.MsoTriState.msoFalse, Convert.ToInt32(shape.Left), Convert.ToInt32(shape.Top), Convert.ToInt32(xmlTempNode.Attributes["imgwidth"].Value), Convert.ToInt32(xmlTempNode.Attributes["imgheight"].Value));//load new image to shape

i am passing imageheight as 127, however final slide contains image with imageheight as 167.

Any help would be appreciated.

Upvotes: 0

Views: 876

Answers (1)

Steve Rindsberg
Steve Rindsberg

Reputation: 14809

It seems that you're expecting that PowerPoint uses pixels as its dimensions; it doesn't. It uses points, 72 points to the inch.

Upvotes: 1

Related Questions