0
이것은 내 맞춤 카메라에서 캡처 사진에 사용했지만 실제로 사진을 캡처하는 코드이지만 사용자가 기기를 회전한다고 가정하면 (카메라는 여전히 아이폰 카메라처럼 세로로 유지됩니다) 사진을 찍으면 portrait.how에서 해당 사진을 원합니다. 그렇게?캡처 후 이미지의 방향을 바꾸는 방법은 무엇입니까?
let stillImageOutput = self._getStillImageOutput()
if let videoConnection = stillImageOutput.connection(withMediaType: AVMediaTypeVideo) {
// videoConnection.videoOrientation = AVCaptureVideoOrientation.portrait
stillImageOutput.captureStillImageAsynchronously(from: videoConnection , completionHandler: { [weak self] sample, error in
if let error = error {
DispatchQueue.main.async(execute: {
self?._show(NSLocalizedString("Error", comment:""), message: error.localizedDescription)
})
imageCompletion(nil,error as NSError?)
return
}
let imageData = AVCaptureStillImageOutput.jpegStillImageNSDataRepresentation(sample)
var capturedImage = UIImage(data: imageData!)[![This how photo showing if i capture by rotating Device][1]][1]
가능한 중복 : // 유래 .com/questions/24965638/how-to-flip-uiimage-horizontally-with-swift) –
아니요. 다른 질문입니다. –
도움이 될 것입니다. Objective-C에 있지만 아이디어를 얻을 수 있습니다. http://stackoverflow.com/a/7932657/7005670 –