@buoge
2017-05-31T18:23:29.000000Z
字数 667
阅读 1156
iOS
if let mCGImageVal = mALAsset?.defaultRepresentation().fullScreenImage().takeUnretainedValue() {
self?.imageView.image = UIImage(cgImage: mCGImageVal)
}
http://www.hangge.com/blog/cache/detail_759.html
if let representation = myALAsset.defaultRepresentation() {
let representationSize =Int(representation.size())
let imageBuffer = UnsafeMutablePointer<UInt8>.allocate(capacity: representationSize)
let bufferSize = representation.getBytes(imageBuffer, fromOffset: Int64(0), length: Int(representation.size()), error: nil)
let imgData:NSData = NSData(bytesNoCopy:imageBuffer ,length:bufferSize, freeWhenDone:true)
self?.imageView.image = UIImage(data: imgData as Data)
}