- (UIImage *)addImage:(UIImage *)image1 toImage:(UIImage *)image2 {
UIGraphicsBeginImageContext(image1.size);
// Draw image1
[image1 drawInRect:CGRectMake(0, 0, 40, 40)];
// Draw image2
[image2 drawInRect:CGRectMake(40, 0, 40, 40)];
// Draw image2
[image2 drawInRect:CGRectMake(00, 40, 80, 40)];
UIImage *resultingImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return resultingImage;
}
时间: 2024-10-07 10:22:09