图片旋转锯齿

    //在图片边缘添加一个像素的透明区域,去图片锯齿

    CGRect imageRrect = CGRectMake(0, 0,imageView.frame.size.width, imageView.frame.size.height);

    UIGraphicsBeginImageContext(imageRrect.size); 

    [imageView.imagedrawInRect:CGRectMake(1,1,imageView.frame.size.width-2,imageView.frame.size.height-2)];

    imageView.image = UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

 

 


消除锯齿:
        imageView.layer.shadowOffset = CGSizeMake(0, 2);//0,2
        imageView.layer.shadowRadius = 2.0;
        imageView.layer.shadowColor = [UIColor whiteColor].CGColor;
        imageView.layer.shadowOpacity = 0.8;
        imageView.layer.borderColor = [UIColor whiteColor].CGColor;
        imageView.layer.borderWidth = 3.0;//2.0
        imageView.layer.cornerRadius = 3.0;//3.0
        imageView.layer.masksToBounds=YES; 
        [imageView.layer setShouldRasterize:YES];

 


作者:GangWang
出处:http://www.cnblogs.com/GnagWang/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

 
原文地址:https://www.cnblogs.com/GnagWang/p/2435231.html