Add a round corner rectangle to presentation slide in C#

With the help of Spire.Presentation, we can add shapes to the presentation slides easily. This example shows you how to add a round corner rectangle to presentation slide and set the radius of the round corner rectangle in C#.

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

namespace RoundRectangle
{
    class Program
    {
        static void Main(string[] args)
        {          
            Presentation presentation = new Presentation();

            //Insert a round corner rectangle and set its radious
            presentation.Slides[0].Shapes.InsertRoundRectangle(0, 60, 90, 100, 200, 36);

            //Append a round corner rectangle and set its radious
            IAutoShape shape = presentation.Slides[0].Shapes.AppendRoundRectangle(260, 90, 100, 200, 80);
            //Set the color and fill style of shape
            shape.Fill.FillType = FillFormatType.Solid;
            shape.Fill.SolidColor.Color = Color.SeaGreen;
            shape.ShapeStyle.LineColor.Color = Color.White;
            //Rotate the shape to 90 degree
            shape.Rotation = 90;  
            
            //Save the document to file    
            presentation.SaveToFile("Result.pptx", FileFormat.Pptx2013);
                                                                              
        }
    }
}

Effective screenshot of the round corner rectangle on presentation slide:

Add a round corner rectangle to presentation slide in C#