Saturday, 15 June 2013

ios - getting camera horizontal view angle in Swift -


Text after "

I want to get the camera's HVA and VVA (Horizontal View Angle and Vertical View Angle) of an iOS device. (using swift) How do you do this?

In Android, I can use the following functions:

  public double getHVA () {camera.getParameters () returned getHorizontalViewAngle (); } Public Double getVVA () {return camera.getParameters (). GetVerticalViewAngle (); }  

Is there something similar to Swift?

"itemprop =" text ">

It would be surprising that I have no good solution for this. I have been successfully able to get HBA as a program, but it seems there is currently no way to get VVA (if anyone knows otherwise, please correct me)

here How i did it

Give Device = AVCaptureDevice.devices () Capture Capture Device: AVCaptureDevice? Devices in devices {if (device.hasMediaType (AVMediaTypeVideo)) {if (device.position == AVCaptureDevicePosition.Back) {device for CaptDevice = as? AVCaptureDevice}}} If you have read retrievedDevice = captureDevice {println ("HFOV \" (retrievedDevice.activeFormat.videoFieldOfView) "}}

To read more about AVCaptureDevices, and my code source To view,


No comments:

Post a Comment