How to use Face Detection API in WinUI3 app?

Jack 40 Reputation points
2025-02-28T11:59:49.6+00:00

Hi MS team,

https://learn.microsoft.com/en-us/samples/microsoft/windows-universal-samples/camerafacedetection/

The link above is MS demo for UWP app, but I want to use it in WinUI3 app.

When i merge the code to WinUI3, there are some elements not supported in WinUI3, such as CaptureElement.

Do you have the camera face detection sample for WinUI3? or can you guide me to adapt it?

Thanks.

Windows development Windows App SDK
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 90,681 Reputation points
    2025-03-01T06:26:40.03+00:00

    In WinUI 3, CaptureElement is replaced by MediaPlayerElement, like in the MS sample : https://github.com/microsoft/Windows-Camera/tree/master/Samples/MediaCaptureWinUI3

    You can also read frames as explained at https://learn.microsoft.com/en-us/windows/apps/develop/camera/process-media-frames-with-mediaframereader


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.