0

关于如何访问 Windows Phone 8 上的摄像头,我有两个问题:

  1. 如何使用前置摄像头拍照?
  2. 如何访问主摄像头的闪光灯/手电筒?
4

1 回答 1

0

This article from MSDN has an example of both accessing the front and back cameras, as well as accessing the flash, assuming your using C# (since you didn't specify). Here's a snippet under the Creating the Capture Device heading:

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);

For accessing the flash of the camera, here is a snippet under the Specifying Camera Properties heading:

cam.SetProperty(KnownCameraPhotoProperties.FlashMode, FlashState.On);
cam.SetProperty(KnownCameraGeneralProperties.PlayShutterSoundOnCapture, true);
cam.SetProperty(KnownCameraGeneralProperties.AutoFocusRange, AutoFocusRange.Infinity);

Hope this helps!

于 2013-05-20T14:09:22.453 回答