How to crop an image with VBA to a specific form e.g. circle in PowerPoint?

爱⌒轻易说出口 提交于 2020-06-01 06:32:08

问题


I would like to crop a square image shape in PowerPoint with VBA to a specific form e.g. a circle.

With Shape.PictureFormat there are only these options:

  • .CropBottom
  • .CropLeft
  • .CropRight
  • .CropTop

Can someone help me with this question?

Thanks!

Moe


回答1:


From Microsoft Community - you can use Shape.AutoShapeType to "crop to shape."

Sub CropToCircle()
    Dim shp As Shape
    Set shp = ActivePresentation.Slides(1).Shapes(1)

    If shp.Type = msoLinkedPicture Or shp.Type = msoPicture Then
        shp.AutoShapeType = msoShapeOval
    End If
End Sub


来源:https://stackoverflow.com/questions/51436712/how-to-crop-an-image-with-vba-to-a-specific-form-e-g-circle-in-powerpoint

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!