Path: blob/master/samples/winrt/ImageManipulations/AdvancedCapture.xaml.h
16337 views
//*********************************************************1//2// Copyright (c) Microsoft. All rights reserved.3// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF4// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY5// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR6// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.7//8//*********************************************************910//11// AdvancedCapture.xaml.h12// Declaration of the AdvancedCapture class13//1415#pragma once1617#include "pch.h"18#include "AdvancedCapture.g.h"19#include "MainPage.xaml.h"20#include <ppl.h>2122#define VIDEO_FILE_NAME "video.mp4"23#define PHOTO_FILE_NAME "photo.jpg"24#define TEMP_PHOTO_FILE_NAME "photoTmp.jpg"2526using namespace concurrency;27using namespace Windows::Devices::Enumeration;2829namespace SDKSample30{31namespace MediaCapture32{33/// <summary>34/// An empty page that can be used on its own or navigated to within a Frame.35/// </summary>36[Windows::Foundation::Metadata::WebHostHidden]37public ref class AdvancedCapture sealed38{39public:40AdvancedCapture();4142protected:43virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;44virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;4546private:47MainPage^ rootPage;48void ScenarioInit();49void ScenarioReset();5051void Failed(Windows::Media::Capture::MediaCapture ^ mediaCapture, Windows::Media::Capture::MediaCaptureFailedEventArgs ^ args);5253void btnStartDevice_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);5455void btnStartPreview_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);5657void lstEnumedDevices_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);58void EnumerateWebcamsAsync();5960void AddEffectToImageStream();6162void ShowStatusMessage(Platform::String^ text);63void ShowExceptionMessage(Platform::Exception^ ex);6465void EnableButton(bool enabled, Platform::String ^name);6667task<Windows::Storage::StorageFile^> ReencodePhotoAsync(68Windows::Storage::StorageFile ^tempStorageFile,69Windows::Storage::FileProperties::PhotoOrientation photoRotation);70Windows::Storage::FileProperties::PhotoOrientation GetCurrentPhotoRotation();71void PrepareForVideoRecording();72void DisplayProperties_OrientationChanged(Platform::Object^ sender);73Windows::Storage::FileProperties::PhotoOrientation PhotoRotationLookup(74Windows::Graphics::Display::DisplayOrientations displayOrientation, bool counterclockwise);75Windows::Media::Capture::VideoRotation VideoRotationLookup(76Windows::Graphics::Display::DisplayOrientations displayOrientation, bool counterclockwise);7778Platform::Agile<Windows::Media::Capture::MediaCapture> m_mediaCaptureMgr;79Windows::Storage::StorageFile^ m_recordStorageFile;80bool m_bRecording;81bool m_bEffectAdded;82bool m_bEffectAddedToRecord;83bool m_bEffectAddedToPhoto;84bool m_bSuspended;85bool m_bPreviewing;86DeviceInformationCollection^ m_devInfoCollection;87Windows::Foundation::EventRegistrationToken m_eventRegistrationToken;88bool m_bRotateVideoOnOrientationChange;89bool m_bReversePreviewRotation;90Windows::Foundation::EventRegistrationToken m_orientationChangedEventToken;91void Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);92};93}94}959697