如何将颜色仅设置为uiimage的白色环绕?

时间:2014-12-12 12:03:16

标签: ios objective-c uiimageview

我正在使用两个UIImageViews叠加图像有一些白色环境的形状我需要只为周围的白色着色但是当我选择颜色时,它正在申请完整的图像。

 UIButton *selectBtn=(UIButton *)sender;
previousButtonTag=selectBtn.tag;
UIImage *selectImg=[self tintedBackgroundImageWithColor:[self.ColorsArray objectAtIndex:sender.tag]];
 OverlayImg.backgroundColor=[ColorsArray objectAtIndex:sender.tag];
CGRect drawRect = CGRectMake(0,0,OverlayImg.image.size.width, OverlayImg.image.size.height);
UIGraphicsBeginImageContextWithOptions(OverlayImg.image.size,0,0);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetBlendMode(context, kCGBlendModeSourceAtop);
selectImg=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
OverlayImg.image=selectImg;

0 个答案:

没有答案