且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MediaCapture Windows 8 桌面 - 照片较暗

更新时间:2023-10-21 12:48:10

迟到的回复,但如果对以后的人有帮助:暗图片通常是由于缺乏视频预览.相机驱动程序使用预览流来运行他们的 3A 算法(自动白平衡/对焦/曝光).目前让 MediaCapture 在桌面应用程序中预览有点挑战.一种方法是创建一个 D3DImage 并依靠一些本机互操作来调用 Media Foundation 和 DirectX.它不是微不足道的,但可以封装,因此 C# API 表面保持简单.这是一些代码示例:https://github.com/mmaitre314/MediaCaptureWPF

Late reply, but in case that helps folks in the future: dark pictures are often due to the lack of video preview. Camera drivers use the preview stream to run their 3A algorithms (auto-whitebalance/focus/exposure). At the moment getting MediaCapture to preview in Desktop apps is a bit challenging. One way to do it is to create a D3DImage and rely on some native interop to call Media Foundation and DirectX. It is not trivial but can be encapsulated so the C# API surface remains simple. Here is some code sample: https://github.com/mmaitre314/MediaCaptureWPF