当前位置: 首页>>代码示例>>C#>>正文


C# Presentation.AddEmptySlide方法代码示例

本文整理汇总了C#中Presentation.AddEmptySlide方法的典型用法代码示例。如果您正苦于以下问题:C# Presentation.AddEmptySlide方法的具体用法?C# Presentation.AddEmptySlide怎么用?C# Presentation.AddEmptySlide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Presentation的用法示例。


在下文中一共展示了Presentation.AddEmptySlide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        static void Main(string[] args)
        {
            //Instantiate PresentationEx class that represents the PPT file
            Presentation pres = new Presentation();

            //Blank slide is added by default, when you create
            //presentation from default constructor
            //Adding an empty slide to the presentation and getting the reference of
            //that empty slide
            Slide slide = pres.AddEmptySlide();

            slide = pres.GetSlideByPosition(2);

            //Get the font index for Arial
            //It is always 0 if you create presentation from
            //default constructor
            int arialFontIndex = 0;

            //Add a textbox
            //To add it, we will first add a rectangle
            Shape shp = slide.Shapes.AddRectangle(1200, 800, 3200, 370);

            //Hide its line
            shp.LineFormat.ShowLines = false;

            //Then add a textframe inside it
            TextFrame tf = shp.AddTextFrame("");

            //Set a text
            tf.Text = "Text added dynamically";
            Portion port = tf.Paragraphs[0].Portions[0];
            port.FontIndex = arialFontIndex;
            port.FontBold = true;
            port.FontHeight = 32;

            //Write the output to disk
            pres.Write("outAspose.ppt");
        }
开发者ID:horazius17,项目名称:Aspose_Slides_NET,代码行数:38,代码来源:Program.cs


注:本文中的Presentation.AddEmptySlide方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。