//图片去色置灰处理
SDWebImageManager *manager = [SDWebImageManager sharedManager];
//保存图片URL
NSURL* url = [NSURL URLWithString:activityModel.activityImageUrl];
BOOL existBool = [manager diskImageExistsForURL:url];
if (existBool)
{
UIImage* image = [[manager imageCache]imageFromDiskCacheForKey:url.absoluteString];
self.image = [self grayImage:image];
}
else
{
[manager downloadImageWithURL:[NSURL URLWithString:activityModel.activityImageUrl]
options:0
progress:nil
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
if (!error && image)
{
self.image = [self grayImage:image];
}
UIImageView - 图片去色 变灰处理
最新推荐文章于 2022-12-05 19:01:26 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)