0
我使用此功能:如何在合併圖像時避免低質量?
var size = CGSize(width: 320, height: 358) // 348
UIGraphicsBeginImageContext(size)
//let areaSize = CGRect(x: 0, y: 0, width: size.width, height: size.height)
let areaSize = CGRect(x: 20, y: 5, width: size.width-40, height: size.height-30)
let areaSizeTop = CGRect(x: 0, y: 0, width: size.width, height: size.height)
bottomImage.drawInRect(areaSize)
topImage.drawInRect(areaSizeTop, blendMode: kCGBlendModeNormal, alpha: 1) //0.8 default
var newImage:UIImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return newImage
合併兩個不同的圖像(A)+(B),但是,當我這樣做最終的圖像(C)的結果是非常低的質量,如何解決那?有一些代碼可以使(C)圖像看起來更好嗎?這裏是一個屏幕(C,合併)圖像:
好吧,你明確地把它做成320x358像素......你想讓它如此之小嗎?源圖像如此之小? –