iOS 圖像處理 - 圖像拼接
阿新 • • 發佈:2017-07-01
資源 class 圖像拼接 span str screen oat right contex
參考:網上資源。鏈接已丟失
解決這個問題:將兩個圖像拼接在一起
前提:須要加入Framework:CoreGraphics.framework
源代碼:
- (UIImage *) combine:(UIImage*)leftImage :(UIImage*)rightImage { CGFloat width = leftImage.size.width * 2; CGFloat height = leftImage.size.height; CGSize offScreenSize = CGSizeMake(width, height); UIGraphicsBeginImageContext(offScreenSize); CGRect rect = CGRectMake(0, 0, width/2, height); [leftImage drawInRect:rect]; rect.origin.x += width/2; [rightImage drawInRect:rect]; UIImage* imagez = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return imagez; }
參考:網上資源。鏈接已丟失
iOS 圖像處理 - 圖像拼接