UIImage剪切

UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];spa

    imageView.center = CGPointMake(200, 300);ip

    imageView.backgroundColor= [ UIColor redColor];it

    UIImage *anotherImage = [UIImage imageNamed:@"476F762C08F8CAC35D2624F02DF4E62F"];io

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

    [[UIBezierPath bezierPathWithRoundedRect:imageView.boundsim

                                cornerRadius:40] addClip];di

    

    

    

    [anotherImage drawInRect:imageView.bounds];view

    imageView.image = UIGraphicsGetImageFromCurrentImageContext();vi

    UIGraphicsEndImageContext();co

    [self.view addSubview:imageView];

相關文章
相關標籤/搜索