在 VB.Net 中使用 interop.powerpoint 我正在插入一个带有代码的 EMF 文件:
' add picture shape to slide
AvailableSlide.Shapes.AddPicture(FileName:=file, LinkToFile:=MsoTriState.msoFalse, _
SaveWithDocument:=MsoTriState.msoTrue, Left:=SlideHorizontalPosition, Top:=SlideVerticalPosition)
' save original image size
mOriginalImageWidth = CurrentShape.Width
mOriginalImageHeight = CurrentShape.Height
' if EMF then crop the bottom
CurrentShape.PictureFormat.CropBottom = mCropValue
我在裁剪之前保存了原始尺寸。但是,如果我在未保存的 PPT 文件中使用选定的图像,我无法弄清楚原始图像大小存储在选定的“形状”对象中的位置(下图中的 5.49 英寸 x 4.13 英寸) )。我认为它会在 PictureFormat 中的某个地方。
dgp
最佳答案
将形状的 .ScaleHeight 和 .ScaleWidth 设置为 1 以将其返回到原始大小。
关于vb.net - 原始图像尺寸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24001292/