我有一个圆弧,我画了如下:funcdrawBackgroundMask(context:CGContextRef,center:CGPoint,radius:CGFloat,lineWidth:CGFloat,startAngle:CGFloat,endAngle:CGFloat){letadjustedRadius:CGFloat=radius-(lineWidth/2)-0CGContextSetLineWidth(context,lineWidth)CGContextSetLineCap(context,.Round)CGContextAddArc(context,center.
在我的应用程序中有一个imageViewA(frame{0,0,320,200}),我想用imageViewA的中心、半径=50剪一个圆,然后绘制到另一个imageViewB(frame{0,0,100,100})中;原图效果是这样的:并使用下面的代码来剪辑:UIGraphicsBeginImageContext(self.frame.size);CGContextRefctx=UIGraphicsGetCurrentContext();CGFloatheight=self.bounds.size.height;CGContextTranslateCTM(ctx,0.0,height)