/// <summary>
 /// Initialize new instance of <see cref="ToolQuadraticBezierSelection"/> class.
 /// </summary>
 /// <param name="serviceProvider">The service provider.</param>
 /// <param name="layer">The selection shapes layer.</param>
 /// <param name="shape">The selected shape.</param>
 /// <param name="style">The selection shapes style.</param>
 /// <param name="point">The selection point shape.</param>
 public ToolQuadraticBezierSelection(IServiceProvider serviceProvider, ILayerContainer layer, IQuadraticBezierShape shape, IShapeStyle style)
 {
     _serviceProvider = serviceProvider;
     _layer           = layer;
     _quadraticBezier = shape;
     _style           = style;
 }
예제 #2
0
        public static AM.Geometry ToGeometry(IQuadraticBezierShape quadraticBezier)
        {
            var sg = new AM.StreamGeometry();

            using var sgc = sg.Open();
            sgc.BeginFigure(
                new A.Point(quadraticBezier.Point1.X, quadraticBezier.Point1.Y),
                quadraticBezier.IsFilled);
            sgc.QuadraticBezierTo(
                new A.Point(quadraticBezier.Point2.X, quadraticBezier.Point2.Y),
                new A.Point(quadraticBezier.Point3.X, quadraticBezier.Point3.Y));
            sgc.EndFigure(false);
            return(sg);
        }
예제 #3
0
 public static SKPath ToSKPath(this IBaseShape shape, double dx, double dy, Func <double, float> scale)
 {
     return(shape switch
     {
         ILineShape lineShape => ToSKPath(lineShape, dx, dy, scale),
         IRectangleShape rectangleShape => ToSKPath(rectangleShape, dx, dy, scale),
         IEllipseShape ellipseShape => ToSKPath(ellipseShape, dx, dy, scale),
         IImageShape imageShape => ToSKPath(imageShape, dx, dy, scale),
         IArcShape arcShape => ToSKPath(arcShape, dx, dy, scale),
         ICubicBezierShape cubicBezierShape => ToSKPath(cubicBezierShape, dx, dy, scale),
         IQuadraticBezierShape quadraticBezierShape => ToSKPath(quadraticBezierShape, dx, dy, scale),
         ITextShape textShape => ToSKPath(textShape, dx, dy, scale),
         IPathShape pathShape => ToSKPath(pathShape, dx, dy, scale),
         IGroupShape groupShape => ToSKPath(groupShape.Shapes, dx, dy, scale),
         _ => null,
     });
예제 #4
0
 public QuadraticBezierDrawNode(IQuadraticBezierShape quadraticBezier, IShapeStyle style)
 {
     Style           = style;
     QuadraticBezier = quadraticBezier;
     UpdateGeometry();
 }
예제 #5
0
파일: DataFlow.cs 프로젝트: will8886/Core2D
 /// <inheritdoc/>
 public void Bind(IQuadraticBezierShape quadraticBezier, object db, object r)
 {
 }
예제 #6
0
 public IQuadraticBezierDrawNode CreateQuadraticBezierDrawNode(IQuadraticBezierShape quadraticBezier, IShapeStyle style)
 {
     return(new QuadraticBezierDrawNode(quadraticBezier, style));
 }