zoukankan      html  css  js  c++  java
  • iOS 图片切圆角的另外两种方式

     1:

      UIBezierPath * maskPath = [UIBezierPath bezierPathWithRoundedRect:imageView.bounds byRoundingCorners:UIRectCornerAllCorners cornerRadii:imageView.bounds.size];

        CAShapeLayer * maskLayer = [[CAShapeLayer alloc]init];

        maskLayer.frame = imageView.bounds;

        maskLayer.path = maskPath.CGPath;

        imageView.layer.mask = maskLayer;

    2:

        UIGraphicsBeginImageContextWithOptions(imageView.bounds.size, NO, 1.0);

        [[UIBezierPath bezierPathWithRoundedRect:imageView.bounds cornerRadius:imageView.frame.size.width]addClip];

        [imageView drawRect:imageView.bounds];

        

        imageView.image = UIGraphicsGetImageFromCurrentImageContext();

        UIGraphicsEndImageContext();

  • 相关阅读:
    poj3253Fence Repair (Huffman)
    poi3617Best Cow Line ——贪心法
    高级排序之——归并排序
    Aizu
    初级排序——冒泡排序
    cookie会话
    加载web资源文件
    servlet
    Http

  • 原文地址:https://www.cnblogs.com/LynnAIQ/p/5938952.html
Copyright © 2011-2022 走看看