diff --git a/samples/winrt/OcvImageProcessing/OcvImageProcessing.sln b/samples/winrt/OcvImageProcessing/OcvImageProcessing.sln new file mode 100644 index 0000000000..11bf904bc1 --- /dev/null +++ b/samples/winrt/OcvImageProcessing/OcvImageProcessing.sln @@ -0,0 +1,38 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OcvImageProcessing", "OcvImageProcessing\OcvImageProcessing.vcxproj", "{A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|ARM = Release|ARM + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Debug|ARM.ActiveCfg = Debug|ARM + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Debug|ARM.Build.0 = Debug|ARM + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Debug|ARM.Deploy.0 = Debug|ARM + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Debug|Win32.ActiveCfg = Debug|Win32 + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Debug|Win32.Build.0 = Debug|Win32 + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Debug|Win32.Deploy.0 = Debug|Win32 + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Debug|x64.ActiveCfg = Debug|x64 + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Debug|x64.Build.0 = Debug|x64 + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Debug|x64.Deploy.0 = Debug|x64 + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Release|ARM.ActiveCfg = Release|ARM + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Release|ARM.Build.0 = Release|ARM + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Release|ARM.Deploy.0 = Release|ARM + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Release|Win32.ActiveCfg = Release|Win32 + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Release|Win32.Build.0 = Release|Win32 + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Release|Win32.Deploy.0 = Release|Win32 + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Release|x64.ActiveCfg = Release|x64 + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Release|x64.Build.0 = Release|x64 + {A5555EA2-F9E8-4078-90F5-D428F2C0D6D1}.Release|x64.Deploy.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/samples/winrt/OcvImageProcessing/OcvImageProcessing/App.xaml b/samples/winrt/OcvImageProcessing/OcvImageProcessing/App.xaml new file mode 100644 index 0000000000..78409d5118 --- /dev/null +++ b/samples/winrt/OcvImageProcessing/OcvImageProcessing/App.xaml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + diff --git a/samples/winrt/OcvImageProcessing/OcvImageProcessing/App.xaml.cpp b/samples/winrt/OcvImageProcessing/OcvImageProcessing/App.xaml.cpp new file mode 100644 index 0000000000..228e24a1fe --- /dev/null +++ b/samples/winrt/OcvImageProcessing/OcvImageProcessing/App.xaml.cpp @@ -0,0 +1,107 @@ +// +// App.xaml.cpp +// Implementation of the App class. +// + +#include "pch.h" +#include "MainPage.xaml.h" + +using namespace OcvImageProcessing; + +using namespace Platform; +using namespace Windows::ApplicationModel; +using namespace Windows::ApplicationModel::Activation; +using namespace Windows::Foundation; +using namespace Windows::Foundation::Collections; +using namespace Windows::UI::Xaml; +using namespace Windows::UI::Xaml::Controls; +using namespace Windows::UI::Xaml::Controls::Primitives; +using namespace Windows::UI::Xaml::Data; +using namespace Windows::UI::Xaml::Input; +using namespace Windows::UI::Xaml::Interop; +using namespace Windows::UI::Xaml::Media; +using namespace Windows::UI::Xaml::Navigation; + +// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 + +/// +/// Initializes the singleton application object. This is the first line of authored code +/// executed, and as such is the logical equivalent of main() or WinMain(). +/// +App::App() +{ + InitializeComponent(); + Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending); +} + +/// +/// Invoked when the application is launched normally by the end user. Other entry points +/// will be used when the application is launched to open a specific file, to display +/// search results, and so forth. +/// +/// Details about the launch request and process. +void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ args) +{ + auto rootFrame = dynamic_cast(Window::Current->Content); + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (rootFrame == nullptr) + { + // Create a Frame to act as the navigation context and associate it with + // a SuspensionManager key + rootFrame = ref new Frame(); + + if (args->PreviousExecutionState == ApplicationExecutionState::Terminated) + { + // TODO: Restore the saved session state only when appropriate, scheduling the + // final launch steps after the restore is complete + + } + + if (rootFrame->Content == nullptr) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + if (!rootFrame->Navigate(TypeName(MainPage::typeid), args->Arguments)) + { + throw ref new FailureException("Failed to create initial page"); + } + } + // Place the frame in the current Window + Window::Current->Content = rootFrame; + // Ensure the current window is active + Window::Current->Activate(); + } + else + { + if (rootFrame->Content == nullptr) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + if (!rootFrame->Navigate(TypeName(MainPage::typeid), args->Arguments)) + { + throw ref new FailureException("Failed to create initial page"); + } + } + // Ensure the current window is active + Window::Current->Activate(); + } +} + +/// +/// Invoked when application execution is being suspended. Application state is saved +/// without knowing whether the application will be terminated or resumed with the contents +/// of memory still intact. +/// +/// The source of the suspend request. +/// Details about the suspend request. +void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e) +{ + (void) sender; // Unused parameter + (void) e; // Unused parameter + + //TODO: Save application state and stop any background activity +} diff --git a/samples/winrt/OcvImageProcessing/OcvImageProcessing/App.xaml.h b/samples/winrt/OcvImageProcessing/OcvImageProcessing/App.xaml.h new file mode 100644 index 0000000000..8e16532bce --- /dev/null +++ b/samples/winrt/OcvImageProcessing/OcvImageProcessing/App.xaml.h @@ -0,0 +1,24 @@ +// +// App.xaml.h +// Declaration of the App class. +// + +#pragma once + +#include "App.g.h" + +namespace OcvImageProcessing +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + ref class App sealed + { + public: + App(); + virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ args) override; + + private: + void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e); + }; +} diff --git a/samples/winrt/OcvImageProcessing/OcvImageProcessing/Assets/Lena.png b/samples/winrt/OcvImageProcessing/OcvImageProcessing/Assets/Lena.png new file mode 100644 index 0000000000..3e8668734a Binary files /dev/null and b/samples/winrt/OcvImageProcessing/OcvImageProcessing/Assets/Lena.png differ diff --git a/samples/winrt/OcvImageProcessing/OcvImageProcessing/Assets/Logo.png b/samples/winrt/OcvImageProcessing/OcvImageProcessing/Assets/Logo.png new file mode 100644 index 0000000000..ea685d651a Binary files /dev/null and b/samples/winrt/OcvImageProcessing/OcvImageProcessing/Assets/Logo.png differ diff --git a/samples/winrt/OcvImageProcessing/OcvImageProcessing/Assets/SmallLogo.png b/samples/winrt/OcvImageProcessing/OcvImageProcessing/Assets/SmallLogo.png new file mode 100644 index 0000000000..efaf5468a1 Binary files /dev/null and b/samples/winrt/OcvImageProcessing/OcvImageProcessing/Assets/SmallLogo.png differ diff --git a/samples/winrt/OcvImageProcessing/OcvImageProcessing/Assets/SplashScreen.png b/samples/winrt/OcvImageProcessing/OcvImageProcessing/Assets/SplashScreen.png new file mode 100644 index 0000000000..901c3b085a Binary files /dev/null and b/samples/winrt/OcvImageProcessing/OcvImageProcessing/Assets/SplashScreen.png differ diff --git a/samples/winrt/OcvImageProcessing/OcvImageProcessing/Assets/StoreLogo.png b/samples/winrt/OcvImageProcessing/OcvImageProcessing/Assets/StoreLogo.png new file mode 100644 index 0000000000..af64bf00ad Binary files /dev/null and b/samples/winrt/OcvImageProcessing/OcvImageProcessing/Assets/StoreLogo.png differ diff --git a/samples/winrt/OcvImageProcessing/OcvImageProcessing/Common/StandardStyles.xaml b/samples/winrt/OcvImageProcessing/OcvImageProcessing/Common/StandardStyles.xaml new file mode 100644 index 0000000000..4def039e59 --- /dev/null +++ b/samples/winrt/OcvImageProcessing/OcvImageProcessing/Common/StandardStyles.xaml @@ -0,0 +1,1828 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Mouse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/winrt/OcvImageProcessing/OcvImageProcessing/MainPage.xaml b/samples/winrt/OcvImageProcessing/OcvImageProcessing/MainPage.xaml new file mode 100644 index 0000000000..86db7b8257 --- /dev/null +++ b/samples/winrt/OcvImageProcessing/OcvImageProcessing/MainPage.xaml @@ -0,0 +1,23 @@ + + + + +