vb.net - 原始图像尺寸

标签 vb.net powerpoint

在 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

enter image description here

最佳答案

将形状的 .ScaleHeight 和 .ScaleWidth 设置为 1 以将其返回到原始大小。

关于vb.net - 原始图像尺寸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24001292/

相关文章:

text - 以编程方式创建演示文稿时,如何在幻灯片之间拆分一大块文本?

vba - Powerpoint vba - 从 Excel 复制表格

Vb.net 2010,如何同时使用两个过滤器

javascript - 垂直菜单向上打开?

vb.net - 条码解析

vb.net - 复制 Excel 公式而不引用 vb.net 中的先前工作表

vba - 从 Powerpoint 在 VBA 中打开 Excel 文件

vb.net - 单击 Powerpoint 幻灯片 Pane

vb.net - 在 Vb.net 中以编程方式处理 PowerPoint Presenter View 对象事件

.net - Linq 查询列出 VB.NET