title: Android canvas clipPath: make clipped areas transparent
body: <p>I've created a custom view in Android which requires a curved edge which I've implemented using <code>canvas.clipPath</code>. This works with the exception that the clipped region shows a grey background colour instead of being transparent.</p>
  
  <p><a href="https://i.stack.imgur.com/zvrbN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zvrbN.png" alt="enter image description here"></a></p>
  
  <p>In this image the right hand black colour is the content, which should show through the clipped region. The green is the view, and the grey to the immediate right of the view is the region which should be transparent, e.g. in this example the grey should be black.</p>
  
  <p>Here is my (Xamarin) code:</p>
  
  <pre><code>public override void Draw(Canvas canvas)
  {
      var path = new Path();
      path.AddRect(0,0,this.Width-100,this.Height, Path.Direction.Cw);
      path.AddArc(new RectF(this.Width-200, -100, this.Width, this.Height+100), 270, 180);
      canvas.ClipPath(path);
      base.Draw(canvas);
  }
  </code></pre>
  
  <p>Is is possible to make the clipped regions of a canvas transparent?</p>
  
  <p>(By the way I'm aware I shouldn't be instantiating objects in <code>Draw</code>, this is just for brevity)</p>