图片合并

 UIImage * image2=[UIImage imageNamed:@"1"];
    UIImage * image1=[UIImage imageNamed:@"1"];
    
    UIGraphicsBeginImageContextWithOptions(CGSizeMake(200, 100), NO, 0);
    [image1 drawInRect:CGRectMake(0, 0, 200, 100)];
    [image2 drawInRect:CGRectMake(50, 25, 100, 50)];
    self.imageView.layer.borderColor=[UIColor orangeColor].CGColor;
    self.imageView.layer.borderWidth=1;
    self.imageView.image=UIGraphicsGetImageFromCurrentImageContext()
    ;
    //关闭上下问
    UIGraphicsEndImageContext();

你可能感兴趣的:(图片合并)