How to use the camera in the Windows desktop app for Win8 (tablet) (change package.appxmanifest?)

Asked 1 years ago, Updated 1 years ago, 70 views

This is about the title.
The WinRT API is available for Windows desktop applications, so
https://software.intel.com/en-us/articles/using-winrt-apis-from-desktop-applications

(List of available APIs)
https://msdn.microsoft.com/en-us/library/windows/desktop/dn554295%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

After seeing , I thought about using MediaCapture class, but I think the Windows store app changed package.appxmanifest to allow the camera to be used.
How can I use the camera for desktop apps?

windows c++ visual-studio

2022-09-30 20:34

1 Answers

For C# and VB, MSDN's Japan Forum has a sample code for a desktop application using MediaCapture, and you can get a complete set of projects from github.
You can use the camera without permission like the store app in the sample.

C++ may replace the following:

  • Edit vcxproj to add TargetPlatformVersion
  • See dll below
    System.Runtime.WindowsRuntime.dllSystem.Runtime.dll
    System.Runtime.InteropServices.WindowsRuntime.dll
    System.Threading.Tasks.dll
    System.IO.dll
  • Windows.winmd is found in Project Properties ->Configuration Properties ->General ->Windows Store Application Support ->[Yes]


2022-09-30 20:34

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.