Ondra
Ondra

Reputation: 31

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?

Upvotes: 0

Views: 4319

Answers (2)

Ondra
Ondra

Reputation: 31

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.

Upvotes: 3

newky2k
newky2k

Reputation: 479

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/

Upvotes: 0

Related Questions