0

Nokia のサンプル コードを使用して、Nokia Imaging SDK でアプリを開発しようとしていました。

ステートメントで System.UnauthorizedAccessException を取得しています

await InitializeCamera(CameraSensorLocation.Back);

.

protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (_photoCaptureDevice != null)
            {
                _photoCaptureDevice.Dispose();
                _photoCaptureDevice = null;
            }

            ShowProgress(AppResources.InitializingCameraText);
            await InitializeCamera(CameraSensorLocation.Back);
            HideProgress();
            BackgroundVideoBrush.SetSource(_photoCaptureDevice);

            SetScreenButtonsEnabled(true);
            SetCameraButtonsEnabled(true);
            Storyboard sb = (Storyboard)Resources["CaptureAnimation"];
            sb.Stop();

            SetOrientation(this.Orientation);

            base.OnNavigatedTo(e);
        }


private async Task InitializeCamera(CameraSensorLocation sensorLocation)
        {
            Windows.Foundation.Size initialResolution =
                new Windows.Foundation.Size(DefaultCameraResolutionWidth,
                                            DefaultCameraResolutionHeight);
            Windows.Foundation.Size previewResolution =
                new Windows.Foundation.Size(DefaultCameraResolutionWidth,
                                            DefaultCameraResolutionHeight);

            // Find out the largest 4:3 capture resolution available on device
            IReadOnlyList<Windows.Foundation.Size> availableResolutions =
                PhotoCaptureDevice.GetAvailableCaptureResolutions(sensorLocation);

            Windows.Foundation.Size captureResolution = new Windows.Foundation.Size(0, 0);

            for (int i = 0; i < availableResolutions.Count; i++)
            {
                double ratio = availableResolutions[i].Width / availableResolutions[i].Height;
                if (ratio > 1.32 && ratio < 1.34)
                {
                    if (captureResolution.Width < availableResolutions[i].Width)
                    {
                        captureResolution = availableResolutions[i];
                    }
                }
            }

            PhotoCaptureDevice device =
                await PhotoCaptureDevice.OpenAsync(sensorLocation, initialResolution);

            await device.SetPreviewResolutionAsync(previewResolution);
            await device.SetCaptureResolutionAsync(captureResolution);

            _photoCaptureDevice = device;

            SetOrientation(this.Orientation);
        }

このエラーを処理するにはどうすればよいですか

4

1 に答える 1

1

WMAppManifest.xml に欠落している機能

ID_CAP_ISV_CAMERA
于 2014-01-05T02:46:01.430 に答える