コード例 #1
0
        public override void Initialize(Android.Content.Context context)
        {
            base.Initialize(context);

            Settings.LoadData(context);

            if (String.IsNullOrEmpty(Settings.CameraId))
            {
                Settings.CameraId = CameraUtilities.GetDefaultCamera();
                Settings.CameraResolutionSelected = CameraUtilities.GetDefaultCameraResolution(Settings.CameraId);
            }
            if (!CameraUtilities.IsResolutionSupported(Settings.CameraId, Settings.CameraResolutionSelected))
            {
                Settings.CameraResolutionSelected = CameraUtilities.GetDefaultCameraResolution(Settings.CameraId);
            }

            var(viewAngleHorizontal, viewAngleVertical)   = CameraUtilities.FetchCameraViewAngle(Settings.CameraId);
            var(resolutionHorizontal, resolutionVertical) = CameraUtilities.FetchCameraResolution(Settings.CameraId);

            Settings.SetCameraParameters(viewAngleHorizontal, viewAngleVertical, resolutionHorizontal, resolutionVertical);
        }