Enum ShapePathType

ShapePathType enumeration

Represents path segment type.

public enum ShapePathType

Values

NameValueDescription
LineTo1Straight line segment
CubicBezierCurveTo3Cubic Bezier curve
MoveTo0Start a new path
Close128If the starting POINT and the end POINT are not the same, a single straight line is drawn to connect the starting POINT and ending POINT of the path.
End4The end of the current path
Escape5Escape
ArcTo6An arc
Unknown7Unknown

Examples

namespace AsposeCellsExamples
{
    using Aspose.Cells;
    using Aspose.Cells.Drawing;
    using System;

    public class DrawingClassShapePathTypeDemo
    {
        public static void Run()
        {
            // Create a new workbook for demonstration
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];

            try
            {
                // Create a shape to demonstrate path types
                Shape shape = worksheet.Shapes.AddAutoShape(AutoShapeType.Rectangle, 10, 10, 10, 10, 200, 200);

                // Create a custom geometry path
                Geometry geometry = shape.Geometry;
                ShapePath path = new ShapePath();

                // Demonstrate different ShapePathType values
                Console.WriteLine("Available ShapePathType values:");
                Console.WriteLine($"LineTo: {ShapePathType.LineTo}");
                Console.WriteLine($"CubicBezierCurveTo: {ShapePathType.CubicBezierCurveTo}");
                Console.WriteLine($"MoveTo: {ShapePathType.MoveTo}");
                Console.WriteLine($"Close: {ShapePathType.Close}");
                Console.WriteLine($"End: {ShapePathType.End}");

                // Apply some path operations
                path.MoveTo(10, 10);
                path.LineTo(100, 100);
                path.Close();

                // Save the workbook
                workbook.Save("ShapePathTypeDemo.xlsx");
                Console.WriteLine("Demo completed successfully");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Error working with ShapePathType: {ex.Message}");
            }
        }
    }
}

See Also