Exemple #1
0
        public override PathF PathForBounds(RectangleF rect)
        {
            var path = new PathF();

            path.AppendRectangle(rect);
            return(path);
        }
Exemple #2
0
        public override PathF PathForBounds(Microsoft.Maui.Graphics.Rectangle rect)
        {
            var path = new PathF();

            path.AppendRectangle(rect);
            return(path);
        }
        private void FillSubPaths(ICanvas canvas)
        {
            canvas.StrokeColor = Colors.LightGrey;
            canvas.DrawRectangle(150.5f, 150.5f, 50, 50);
            var path = new PathF();

            path.AppendRectangle(175.5f, 150.5f, 25, 50);
            path.AppendEllipse(175.5f, 150.5f, 25, 50);
            canvas.FillColor = Colors.Black;
            canvas.FillPath(path);
        }
Exemple #4
0
        public override void Draw(ICanvas canvas)
        {
            canvas.SaveState();

            var path = new PathF();

            path.AppendRectangle(100, 100, 100, 100);

            canvas.ClipPath(path);
            canvas.FillColor = Colors.CornflowerBlue;
            canvas.FillRectangle(0, 0, 300, 300);

            canvas.RestoreState();

            canvas.FillColor = Colors.Salmon;
            canvas.FillRectangle(120, 120, 60, 60);
        }
Exemple #5
0
        PathF GetBoundaryPath(Rect bounds)
        {
            if (Clip != null)
            {
                return(Clip.PathForBounds(bounds));
            }

            if (Shape != null)
            {
                return(Shape.PathForBounds(bounds));
            }

            var path = new PathF();

            path.AppendRectangle(bounds);
            return(path);
        }
Exemple #6
0
 public static void AppendRectangle(this PathF path, Rectangle rect) => path.AppendRectangle((float)rect.X, (float)rect.Y, (float)rect.Width, (float)rect.Height);