Use MediaCapture on a Windows 8 desktop app

后端 未结 3 1284
甜味超标
甜味超标 2021-01-02 18:57

On a Windows 8 desktop app, I need to take a photo using the camera in C# 4.5.

I\'ve tried to use the CameraCaptureUI class, but it is not available on a desktop app

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-02 19:32

    After the picture is taken I do the following:

    _ms.Seek(0);
    var _bmp = new BitmapImage();
    _bmp.SetSource(_ms);
    preview1.Source = _bmp;
    

    The preview XAML control is

    
    

提交回复
热议问题