我想创建焦点功能,就像使用 AVCam 的本机相机应用程序一样,但无法创建相同的功能。我正在使用上面的代码:
if ([[[captureManager videoInput] device] isFocusPointOfInterestSupported]) {
CGPoint tapPoint = [tgr locationInView:[self videoPreviewView]];
CGPoint convertedFocusPoint = [self convertToPointOfInterestFromViewCoordinates:tapPoint];
[self addLayoutsOfAutoFocus:tapPoint];
[USERDEFAULTS setValue:[NSString stringWithFormat:@"%f",convertedFocusPoint.x] forKey:x_value];
[USERDEFAULTS setValue:[NSString stringWithFormat:@"%f",convertedFocusPoint.y] forKey:y_value];
[USERDEFAULTS synchronize];
[captureManager continuousFocusAtPoint:convertedFocusPoint];
[captureManager continuousExpousureAtPoint:convertedFocusPoint];
}
我正在尝试保存焦点,但是下次我重新加载相机时,焦点会丢失。
请帮忙。