栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > 百科 > 教育

C# 设置PPT中的形状组合/取消组合

教育 更新时间: 发布时间: 百科归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

C# 设置PPT中的形状组合/取消组合

01

using Spire.Presentation;
using Spire.Presentation.Drawing;
using System.Collections;
using System.Drawing;

namespace GroupShapes
{
class Program
{
static void Main(string[] args)
{
//创建一个PPT文档,并获取第一张幻灯片
Presentation ppt = new Presentation();
ISlide slide = ppt.Slides[0];

//添加一个圆形
IAutoShape shape1 = slide.Shapes.AppendShape(ShapeType.Ellipse, new RectangleF(289, 166, 120, 120));
shape1.Fill.FillType = FillFormatType.Solid;
shape1.Fill.SolidColor.Color = Color.White;
shape1.Line.FillType = FillFormatType.Solid;
shape1.Line.SolidFillColor.Color = Color.Purple;
shape1.Name = "Shape1";

//添加一个五角星形状
IAutoShape shape2 = slide.Shapes.AppendShape(ShapeType.FivePointedStar, new RectangleF(300, 170, 100, 100));
shape2.Fill.FillType = FillFormatType.Solid;
shape2.Fill.SolidColor.Color = Color.Orange;
shape2.Line.FillType = FillFormatType.None;
shape2.Name = "Shape2";

//设置五角星形状的光边效果
GlowEffect glow = new GlowEffect();
glow.ColorFormat.Color = Color.Red;
glow.Radius = 3.0;
shape2.EffectDag.GlowEffect = glow;

//将shape5和shape6两个形状组合
ArrayList list = new ArrayList();
list.Add(shape1);
list.Add(shape2);
slide.GroupShapes(list);

//保存文档
ppt.SaveToFile("GroupShapes.pptx", FileFormat.Pptx2013);
System.Diagnostics.Process.Start("GroupShapes.pptx");
}
}
}

02

形状组合效果:

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/ask/907712.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号