我有两个关于如何在Windows Phone 8上访问相机的问题:
答案 0 :(得分:0)
这个article from MSDN有一个例子,即访问前后摄像头,以及访问闪存,假设您使用C#(因为您没有指定)。这是创建捕获设备标题下的代码段:
System.Collections.Generic.IReadOnlyList<Windows.Foundation.Size> SupportedResolutions =
PhotoCaptureDevice.GetAvailableCaptureResolutions(CameraSensorLocation.Front);
Windows.Foundation.Size res = SupportedResolutions[0];
this.captureDevice = await PhotoCaptureDevice.OpenAsync(CameraSensorLocation.Front, res);
要访问相机的闪光灯,请参阅指定相机属性标题下的代码段:
cam.SetProperty(KnownCameraPhotoProperties.FlashMode, FlashState.On);
cam.SetProperty(KnownCameraGeneralProperties.PlayShutterSoundOnCapture, true);
cam.SetProperty(KnownCameraGeneralProperties.AutoFocusRange, AutoFocusRange.Infinity);
希望这有帮助!