AddPicturePlaceholder

ILayoutPlaceholderManager.AddPicturePlaceholder 方法

向布局幻灯片添加新的占位符形状以容纳图片。

public IAutoShape AddPicturePlaceholder(float x, float y, float width, float height)
参数类型描述
xSingle新的占位符形状的 X 坐标。
ySingle新的占位符形状的 Y 坐标。
widthSingle新的占位符形状的宽度。
heightSingle新的占位符形状的高度。

返回值

创建的 IAutoShape 作为图片占位符。

示例

以下示例展示了如何将图片占位符形状添加到布局幻灯片。

[C#]
using (Presentation pres = new Presentation())
{
	ILayoutSlide layout = pres.LayoutSlides.GetByType(SlideLayoutType.Blank);
	IAutoShape placeholder = layout.PlaceholderManager.AddPicturePlaceholder(20, 20, 200, 200);
}

另见