![]() Void MainPage::Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) , _displayRequest(ref new Windows::System::Display::DisplayRequest()) Void Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) Windows::System::Display::DisplayRequest^ _displayRequest Prevent the screen from sleeping while the camera is running Following is the simple sample in C++/CX version. ![]() For C++/CX, we can check the HRESULT value which should be 0x80070020. However, this is a C# sample and FileLoadException is what used in. A simple sample can be found at Use MediaCapture to start the preview stream. ![]() We can catch this error to alert the user that the camera is currently being used by another application. StartPreviewAsync method will throw a FileLoadException if another app has exclusive control of the capture device.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |