pragma mark - 合成图

#pragma mark - 合成图

- (UIImage *)getShareImageShell:(UIImage *)shareImage {

    if (shareImage) {

        CGSize size = CGSizeMake(640, 1084);

//      UIGraphicsBeginImageContextWithOptions(outputSize, NO, 0.5);设置透明 质量系数

        UIGraphicsBeginImageContext(size);

        CGContextRef c = UIGraphicsGetCurrentContext();

        CGContextSetFillColorWithColor(c, [UIColor VIMIGrayBackgroundColor].CGColor);

        CGContextFillRect(c, CGRectMake(0, 0, size.width, size.height));

        [shareImage drawInRect:CGRectMake(80, 100, 490, 490)];

        [[UIImage imageNamed:@"share_shell"] drawInRect:CGRectMake(0, 0, size.width, size.height)];

        UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

        return image;

    }else {

        return nil;

    }

}

posted on 2014-08-15 14:23  助金  阅读(138)  评论(0)    收藏  举报