How to clear circle in CGContext in iOS
问题 I want create image using CGcontext. This is simple image with white or black background. also I want to add transperent part which is in circle ( check attached image). I know how to do this in rect. But i want to make it circle. Please anyone help me in this. 回答1: Use the below code to clear circle in your context -(UIImage *) getImageWithcenterClear:(CGPoint) center{ CGRect frame = [[UIScreen mainScreen] bounds]; UIGraphicsBeginImageContextWithOptions([[UIScreen mainScreen] bounds].size,