/// <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; }
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); }
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, });
public QuadraticBezierDrawNode(IQuadraticBezierShape quadraticBezier, IShapeStyle style) { Style = style; QuadraticBezier = quadraticBezier; UpdateGeometry(); }
/// <inheritdoc/> public void Bind(IQuadraticBezierShape quadraticBezier, object db, object r) { }
public IQuadraticBezierDrawNode CreateQuadraticBezierDrawNode(IQuadraticBezierShape quadraticBezier, IShapeStyle style) { return(new QuadraticBezierDrawNode(quadraticBezier, style)); }