如何使用VBA将图像裁剪为特定格式,例如在PowerPoint中圈出? [英] How to crop an image with VBA to a specific form e.g. circle in PowerPoint?
本文介绍了如何使用VBA将图像裁剪为特定格式,例如在PowerPoint中圈出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在带有VBA的PowerPoint中将正方形图像形状裁剪为特定形式,例如
I would like to crop a square image shape in PowerPoint with VBA to a specific form e.g. a circle.
使用Shape.PictureFormat只有以下选项:
With Shape.PictureFormat there are only these options:
- .CropBottom
- .CropLeft
- .CropRight
- .CropTop
- .CropBottom
- .CropLeft
- .CropRight
- .CropTop
有人可以帮我解决这个问题吗?
Can someone help me with this question?
谢谢!
Moe
推荐答案
来自 Microsoft社区-您可以使用 Shape.AutoShapeType
即可裁剪成形状。
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
这篇关于如何使用VBA将图像裁剪为特定格式,例如在PowerPoint中圈出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文