Table of contents
TOC
折叠目录
展开目录

Crop.PictureWidth 属性 (办公室)Crop.PictureWidth Property (Office)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

获取或设置要裁剪的图像的宽度。可读/写Gets or sets the width of the image that is to be cropped. Read/write

语法Syntax

表达式PictureWidthexpression. PictureWidth

表达式_该表达式返回一个裁剪对象。_expression An expression that returns a Crop object.

返回值Return Value

SingleSingle

示例Example

下面的示例将一幅大小为 200 x 200 的图像插入 PowerPoint 演示文稿幻灯片中大致处于中央的位置,然后在图像框内部将该图像的大小调整为 100 x 100。图像框保持 200 x 200 大小。接着代码在紧邻该图像右上方的位置添加一个正方形(默认形状),基本上将该图像的左下角裁剪掉。The following example inserts a 200 x 200 image into a PowerPoint presentation approximately in the center of the slide. It then resizes the image inside the frame to 100 x 100. The image frame stays at 200 x 200. The code then adds a square (the default shape) just above and to the right of the image, essentially cropping the lower left corner of the image.

Sub CropImage() 
 ActivePresentation.Slides(1).Shapes.AddPicture "c:\myImage.png", msoFalse, msoTrue, 250,150, 200, 200 
 ActivePresentation.Slides(1).Shapes(1).PictureFormat.Crop.PictureHeight = 100 
 ActivePresentation.Slides(1).Shapes(1).PictureFormat.Crop.PictureWidth = 100 
 ActivePresentation.Slides(1).Shapes(1).PictureFormat.Crop.PictureOffsetX = 0 
 ActivePresentation.Slides(1).Shapes(1).PictureFormat.Crop.PictureOffsetY = 0 
 ActivePresentation.Slides(1).Shapes(1).PictureFormat.Crop.ShapeHeight = 100 
 ActivePresentation.Slides(1).Shapes(1).PictureFormat.Crop.ShapeWidth = 100 
 ActivePresentation.Slides(1).Shapes(1).PictureFormat.Crop.ShapeLeft = 330 
 ActivePresentation.Slides(1).Shapes(1).PictureFormat.Crop.ShapeTop = 170 
End Sub 

另请参阅See also

概念Concepts

裁剪对象Crop Object

其他资源Other resources

裁剪对象成员Crop Object Members

© 2018 Microsoft