I want to write a Windows Store App that can capture video (without any sound) and take pictures. Imagine a digital camera: you can preview the picture on the screen of your device before pushing the button which takes the pic.

The problem I'm facing now is the fact that the Windows.Media.Capture namespace has only classes for objects that capture video with sound (CameraCaptureUI, MediaCapture). I'm not troubled by the objects' capabilities, but by the fact that I will have to include in the manifest of the app the Microphone capability and it does not make sense for the app to use it. I need a class that uses only the Webcam capability.

Any ideas?

有帮助吗?

解决方案

I found the answer and I thought I should share it. I'm sorry for answering my own question, but here goes:

One can specify in the settings of the MediaCapture object, when initializing it, that it will use only the Video part:

var mediaCaptureMgr = new MediaCapture();
var captureSettings = new MediaCaptureInitializationSettings();
captureSettings.StreamingCaptureMode = StreamingCaptureMode.Video;
await mediaCaptureMgr.InitializeAsync(captureSettings);

RTFM!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top