UIImage 2合一

来源:互联网 发布:我知谁掌管明天歌谱 编辑:程序博客网 时间:2024/05/01 15:35
-(UIImage *)addImage:(UIImage *)image1 toImage:(UIImage *)image2{    UIGraphicsBeginImageContext(image2.size);        //Draw image2    [image2 drawInRect:CGRectMake(0, 0, image2.size.width, image2.size.height)];        //Draw image1    [image1 drawInRect:CGRectMake(20, 20, image1.size.width, image1.size.height)];        UIImage *resultImage=UIGraphicsGetImageFromCurrentImageContext();        UIGraphicsEndImageContext();        return resultImage;}


原创粉丝点击