Canvas canvas = new Canvas(bitmap); Rect rect = new Rect(100, 100, 300, 300); canvas.ClipRect(rect);
Canvas canvas = new Canvas(bitmap); RectF oval = new RectF(100, 100, 300, 300); canvas.ClipOval(oval);In this example, the canvas is clipped to a circular region using the ClipOval method. Here, the region is defined using the RectF class which allows for floating-point values. Package library: Android.Graphics