【问题标题】:AVCapturePhotoOutput jpegPhotoDataRepresentation access preview photoAVCapturePhotoOutput jpegPhotoDataRepresentation 访问预览照片
【发布时间】:2017-01-22 19:05:34
【问题描述】:

我看到 iOS 10 引入了 AVCapturePhotoOutput 作为处理照片捕获的新类,并且能够通过将两个缓冲区传递给 AVCapturePhotoCaptureDelegate 方法 capture 来在主图像旁边创建预览/缩略图图像。

然后可以通过jpegPhotoDataRepresentation 将其表示为 JPEG 数据,但是我很感兴趣并且无法找出预览图像是如何存储然后访问的。我猜UIImageView 会根据视图边界自动选择任一图像?您将如何手动选择任一图像?

let imageData = AVCapturePhotoOutput.jpegPhotoDataRepresentation(forJPEGSampleBuffer: photoSampleBuffer, previewPhotoSampleBuffer: previewPhotoSampleBuffer)
captureImageView.image = UIImage(data: imageData)

【问题讨论】:

标签: ios swift swift3 avfoundation avcaptureoutput


【解决方案1】:

是的,缩略图嵌入在全尺寸 JPEG 图像的标题中。更多信息,您可以查看:https://en.m.wikipedia.org/wiki/JPEG_File_Interchange_Format

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多