获取图片的大小 [英] Get the size of a picture

查看:14
本文介绍了获取图片的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前有一个PowerPoint宏,它可以在当前幻灯片中插入原始大小的图片:

Sub Insert_Traverse_2()
    Dim oPic As Shape
    Set oPic = ActiveWindow.View.Slide.Shapes.AddPicture("\nlamvfs00065homes
lkpec
ewpic.png", False, True, 0, 0, -1, -1)
End Sub

如何"获取"图像的大小?我想做一些与

中描述的类似的事情

Powerpoint VBA Macro to copy object's size and location and paste to another object

但是"ShapeRange"似乎对于我创建的对象不可选。

推荐答案

试试这个:

Sub Insert_Traverse_2()
    Dim oPic As Shape
    Set oPic = ActiveWindow.View.Slide.Shapes.AddPicture("\nlamvfs00065homes
lkpec
ewpic.png", False, True, 0, 0, -1, -1)
    With oPic
        MsgBox .Width
        MsgBox .Height
        MsgBox .Left
        MsgBox .Top
    End With
End Sub

这篇关于获取图片的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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