互操作Shapes.AddPicture为图像创建了不正确的尺寸 [英] interop Shapes.AddPicture creates incorrect dimension for image

查看:93
本文介绍了互操作Shapes.AddPicture为图像创建了不正确的尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用互操作创建PowerPoint演示文稿.我使用Shapes.AddPicture将图像添加到幻灯片中.

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

我将imageheight传递为127, 但是最终幻灯片包含带有 imageheight为167.

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

任何帮助将不胜感激.

推荐答案

似乎您期望PowerPoint使用像素作为其尺寸.没有.它使用点,即72英寸为英寸.

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

这篇关于互操作Shapes.AddPicture为图像创建了不正确的尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆