简体   繁体   中英

How to take high quality photo from integrated camera in WPF

I'm implementing WPF app where I need to take high quality photos from integrated camera. So far I've been successful with capturing video and taking frames from it (described for example here: Wpf and C # capture webcam and network cameras ).

But this is not what I want - because video frame quality is not so great. I have MS Surface 4 Pro which has 8Mpx camera with full HD video support and with the above method I'm able to just get full HD frame from it. But I would like to have full 8Mpx picture, like it is possible to take in the native Windows Camera app.

In UWP I would probably have been successful with CameraCaptureUI class, but I didn't find any clues for WPF.

Does anyone has an idea how this could be implemented?

If your app will run on Windows 10 or above, you can now use most of the APIs from Windows 10 in a WPF application.

https://blogs.windows.com/windowsdeveloper/2019/04/30/calling-windows-10-apis-from-a-desktop-application-just-got-easier/

I've found out that XAML Islands do work with .NET Framework 4.8. So I've been able to implement a WPF solution using UWP components MediaCapture and CaptureElement. With that I can take photos with full resolution which was my goal.

Simple sample project can be found here: https://github.com/ondrasvoboda/WPFCamera , consider it just as a proof of concept.

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