ios quartz 画图

画实心椭圆

  CGRect textCountRect = CGRectMake(self.frame.size.width - size.width-10, 22, size.width, size.height);

        CGContextRef context = UIGraphicsGetCurrentContext();

        CGContextSaveGState(context);

        CGContextSetFillColorWithColor(context, [[UIColor redColor] CGColor]);

        CGContextFillEllipseInRect(context, CGRectMake(textCountRect.origin.x, textCountRect.origin.y, textCountRect.size.width + 1, textCountRect.size.height + 2));

        CGContextFillPath(context);

        CGContextRestoreGState(context);

 

画圆

 

  1. // Drawing code CGContextRef context=UIGraphicsGetCurrentContext();   
  2. CGContextSetLineWidth(context, width);   
  3. CGContextSetStrokeColorWithColor(context, [[UIColor redColor] CGColor]);   
  4. CGContextStrokeRect(context, CGRectMake(110.0, 110.0, 100.0, 100.0));  
  5.  CGContextStrokePath(context);

猜你喜欢

转载自chinaxxren.iteye.com/blog/1666986