DrawingGuides
CommonSlideViewProperties.DrawingGuides 属性
返回绘图指南的集合。只读 IDrawingGuidesCollection
public IDrawingGuidesCollection DrawingGuides { get; }
示例
下面的示例代码演示了如何在 PowerPoint 演示文稿中添加新的绘图指南。
[C#]
using (Presentation pres = new Presentation())
{
var slideSize = pres.SlideSize.Size;
IDrawingGuidesCollection guides = pres.ViewProperties.SlideViewProperties.DrawingGuides;
// 在幻灯片中心右侧添加新的垂直绘图指南
guides.Add(Orientation.Vertical, slideSize.Width / 2 + 12.5f);
// 在幻灯片中心下方添加新的水平绘图指南
guides.Add(Orientation.Horizontal, slideSize.Height / 2 + 12.5f);
pres.Save("DrawingGuides_out.pptx", SaveFormat.Pptx);
}