title: Xamarin iOS UIBezierPath change direction to bottom
body: <p>I want to draw a path on a image which represent a semi progress bar in Xamarin. Then It works for the top.</p>
  
  <p>But now I want to draw the bottom. But I tried tried and tried again without find anything.</p>
  
  <p>The image will explain you.
  <a href="https://i.stack.imgur.com/cG7bH.png" rel="nofollow noreferrer">Image</a></p>
  
  <p>The code :</p>
  
  <pre><code>public CircleGraph(UIImageView imageView, int lineWidth, float percentComplete) : base(imageView.Frame)
  {
      Initialise(imageView, lineWidth, percentComplete);
  }
  
  void Initialise(UIImageView imageView, int lineWidth, float percentComplete)
  {
      _lineWidth = lineWidth;
      _percentComplete = percentComplete;
      this.BackgroundColor = UIColor.Clear;
  
      this.backgroundImage = imageView;
      Add(backgroundImage);
  
      centerPoint = new CGPoint(Bounds.GetMidX(), Bounds.Height);
      maskLayer = new CAShapeLayer();
      maskLayer.FillColor = UIColor.Blue.CGColor;
      maskLayer.StrokeColor = UIColor.Black.ColorWithAlpha(.5f).CGColor;
      maskLayer.LineWidth = _lineWidth;
      maskLayer.LineCap = CAShapeLayer.CapButt;
  
      this.Layer.Mask = maskLayer;
  }
  
  public void SetClipping(float percentComplete) {
      _percentComplete = percentComplete;
      SetNeedsDisplay();
  }
  
  public override void Draw(CoreGraphics.CGRect rect)
  {
      base.Draw(rect);
  
      using (CGContext g = UIGraphics.GetCurrentContext())
      {
          _radius = (int)(this.Bounds.Width / 2) - _lineWidth / 2;
  
          // Top
          var startAngle = -(float)Math.PI;
          var endAngle = startAngle + HALF_CIRCLE * _percentComplete;
  
          maskPath = new UIBezierPath();
          maskPath.AddArc(centerPoint, _radius, startAngle, endAngle, false);
          maskLayer.Path = maskPath.CGPath;
      };
  }
  </code></pre>
  
  <p>Thanks a lot !</p>