简体   繁体   中英

Windows Phone 8.1 app MediaCapture under exposed

I am trying to capture pictures directly from the camera in my Windows Phone 8.1 Store App.

I have succeeded in initializing a MediaCapture for the device and it take photographs but they are always black or way way under exposed.

Can someone point me in the direction of how I get the camera to auto expose and if possible trigger a focus too as I get catastrophic failure when I call photoManager.VideoDeviceController.FocusControl.FocusAsync() ?

For auto-focus I use this code:

mediaCapture = new MediaCapture();
var settings = new MediaCaptureInitializationSettings();
settings.StreamingCaptureMode = StreamingCaptureMode.Video;
settings.PhotoCaptureSource = PhotoCaptureSource.VideoPreview;

await mediaCapture.InitializeAsync(settings);

var focusSettings = new FocusSettings();
focusSettings.AutoFocusRange = AutoFocusRange.FullRange;
focusSettings.Mode = FocusMode.Auto;
focusSettings.WaitForFocus = true;
focusSettings.DisableDriverFallback = false;

mediaCapture.VideoDeviceController.FocusControl.Configure(focusSettings);

for exposure, try this:

await mediaCapture.VideoDeviceController.ExposureControl.SetAutoAsync(true);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM