Capturing Webcam Image without preview view or cameraUI?
I'm developing a windows UI C# app and I'm attempting to Capture a webcam image without using the CameraCaptureUI
, as I don't want any interruptions in my app.
I am using signatures on a canvas, and I want to capture an image of the user's face when he begins his signature to verify identities without altering the screen.
How might I accomplish this?
I figured out how to do this. Using a new MediaCapture, and an ImageEncodingProperties item, i was able to capture the images without any preview UI.
captureManager = new MediaCapture();
await captureManager.InitializeAsync();
ImageEncodingProperties imgFormat = ImageEncodingProperties.CreatePng();
// create storage file in local app storage
StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync(
"face"+picnum+".png",
CreationCollisionOption.ReplaceExisting);
// take photo
await captureManager.CapturePhotoToStorageFileAsync(imgFormat, file);
链接地址: http://www.djcxy.com/p/81044.html
上一篇: 相机预览旋转方式错误