// Create a path object Path path = new Path(); path.AddCircle(100, 100, 50, Path.Direction.Clockwise); // Apply the path as a clipping region canvas.ClipPath(path);
// Create a rectangle path object RectF rect = new RectF(0, 0, 200, 200); Path path = new Path(); path.AddRect(rect, Path.Direction.Clockwise); // Apply the path as a clipping region and fill it with a color canvas.ClipPath(path); canvas.DrawColor(Color.Red);This example creates a rectangular path and applies it as a clipping region to the canvas. The canvas is then filled with a red color, but only the area within the rectangular clipping region will be visible. Both examples use the Android.Graphics namespace and are part of the standard Android SDK.