title: How to erase path area from canvas (Android)
body: <p>I need to crop corners on <code>ImageView</code>. Not to round them but erase triangles from each corner.</p>
  
  <p>Seems like the only way to do that is to override <code>onDraw</code> method and erase these areas from canvas using <code>Path</code>. The problem is I have not solid color background, so I need ERASE these areas but not to fill them with some color. </p>
  
  <p>I use following code for that:</p>
  
  <pre><code>@Override
  protected void onDraw(Canvas canvas) {
      Path path = new Path();
      path.moveTo(0, 0);
      path.lineTo(20, 0);
      path.lineTo(0, 20);
      path.close();
  
      Paint paint = new Paint();
      paint.setAntiAlias(true);
      paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
      canvas.drawPath(path, paint);
      super.onDraw(canvas);
  }
  </code></pre>
  
  <p>But the corner makes black but not transparent. Could you help me? Or probably you know better solution for my task. Here is how it looks like.</p>
  
  <p><img src="https://i.stack.imgur.com/A9s6L.png" alt="enter image description here"></p>