0
我一直在嘗試做點擊重點一段時間,我幾乎嘗試了一切,但沒有一個人似乎爲我工作。以下是我在觸碰開始時的情況,它不起作用。它應該但它不是。我究竟做錯了什麼?點擊關注焦點和曝光不起作用
var newFocusPoint = CGPoint(x: touchPoint.locationInView(cameraView).x/screenSize.width, y: touchPoint.locationInView(cameraView).y/screenSize.height)
if let cameraDevice = device {
if(cameraDevice.lockForConfiguration(nil)) {
if cameraDevice.focusPointOfInterestSupported {
cameraDevice.focusPointOfInterest = newFocusPoint
cameraDevice.focusMode = AVCaptureFocusMode.ContinuousAutoFocus
}
if cameraDevice.exposurePointOfInterestSupported {
cameraDevice.exposurePointOfInterest = newFocusPoint
cameraDevice.exposureMode = AVCaptureExposureMode.ContinuousAutoExposure
}
cameraDevice.unlockForConfiguration()
}
}
這似乎沒有工作。 –
哦等一下我懂了!謝謝! (: –
很高興我能幫忙@John Doe – Katz