Closed deshan closed 5 years ago
Few changes and fixed
//PictureOutput
func cgImageFromFramebuffer{
...
CGImage(... bitmapInfo:CGBitmapInfo(rawValue: CGImageAlphaInfo.last.rawValue) ...)
...
}
// png representation must use when saving image
// https://stackoverflow.com/questions/1489250/uiimagewritetosavedphotosalbum-save-as-png-with-transparency
pictureOutput?.imageAvailableCallback = {image in
let data : Data? = UIImagePNGRepresentation(image)
if let data = data, let pngImage = UIImage(data: data) {
UIImageWriteToSavedPhotosAlbum(pngImage, self, #selector(self.image(_:didFinishSavingWithError:contextInfo:)), nil)
}
}
Hi, My code is like below, what I need is transparency for the area which has 0 alpha. But what I get is alpha replace with black color.
Thanks