Ejemplo n.º 1
0
        public async void DrawCurve(Canvas2DContext ctx, BezierCurve curve)
        {
            await ctx.BeginPathAsync();

            //await ctx.SetLineWidthAsync(2);
            await ctx.MoveToAsync(curve.StartPoint.X, curve.StartPoint.Y);

            await ctx.BezierCurveToAsync(curve.ControlPoint1.X, curve.ControlPoint1.Y, curve.ControlPoint2.X, curve.ControlPoint2.Y, curve.EndPoint.X, curve.EndPoint.Y);

            //await ctx.SetStrokeStyleAsync("white");
            await ctx.StrokeAsync();

            await ctx.BeginPathAsync();

            //await ctx.SetFillStyleAsync("yellow");
            await ctx.ArcAsync(curve.StartPoint.X, curve.StartPoint.Y, 5, 0, Math.PI * 2);

            await ctx.FillAsync();

            await ctx.BeginPathAsync();

            //await ctx.SetFillStyleAsync("yellow");
            await ctx.ArcAsync(curve.EndPoint.X, curve.EndPoint.Y, 5, 0, Math.PI * 2);

            await ctx.FillAsync();
        }