From 5ec908c5f0651ccb5928deed84b54efcd9ccf986 Mon Sep 17 00:00:00 2001 From: Maxim Kostin Date: Wed, 18 Mar 2015 16:31:27 +0300 Subject: [PATCH] Added WinRT 8.1 Modern Desktop JavaScript sample --- .../OcvTransform/OcvTransform.cpp | 23 +- .../JavaScript/MediaCaptureJavaScript.jsproj | 115 ++++++++++ .../JavaScript/MediaCaptureJavaScript.sln | 84 +++++++ .../MediaCaptureJavaScript_TemporaryKey.pfx | Bin 0 -> 2512 bytes samples/winrt/JavaScript/css/default.css | 6 + samples/winrt/JavaScript/default.html | 31 +++ .../JavaScript/html/AdvancedCapture.html | 40 ++++ .../JavaScript/images/logo.scale-100.png | Bin 0 -> 4609 bytes .../winrt/JavaScript/images/microsoft-sdk.png | Bin 0 -> 3405 bytes .../winrt/JavaScript/images/smallTile-sdk.png | Bin 0 -> 1248 bytes .../JavaScript/images/smalllogo.scale-100.png | Bin 0 -> 1099 bytes .../winrt/JavaScript/images/splash-sdk.png | Bin 0 -> 5068 bytes .../images/splashscreen.scale-100.png | Bin 0 -> 2146 bytes .../JavaScript/images/squareTile-sdk.png | Bin 0 -> 2482 bytes .../winrt/JavaScript/images/storeLogo-sdk.png | Bin 0 -> 1550 bytes .../JavaScript/images/storelogo.scale-100.png | Bin 0 -> 429 bytes samples/winrt/JavaScript/images/tile-sdk.png | Bin 0 -> 2665 bytes .../winrt/JavaScript/images/windows-sdk.png | Bin 0 -> 1426 bytes .../winrt/JavaScript/js/AdvancedCapture.js | 161 +++++++++++++ samples/winrt/JavaScript/js/default.js | 74 ++++++ samples/winrt/JavaScript/package.appxmanifest | 35 +++ .../JavaScript/sample-utils/sample-utils.css | 215 ++++++++++++++++++ .../JavaScript/sample-utils/sample-utils.js | 204 +++++++++++++++++ .../sample-utils/scenario-select.html | 15 ++ 24 files changed, 997 insertions(+), 6 deletions(-) create mode 100644 samples/winrt/JavaScript/MediaCaptureJavaScript.jsproj create mode 100644 samples/winrt/JavaScript/MediaCaptureJavaScript.sln create mode 100644 samples/winrt/JavaScript/MediaCaptureJavaScript_TemporaryKey.pfx create mode 100644 samples/winrt/JavaScript/css/default.css create mode 100644 samples/winrt/JavaScript/default.html create mode 100644 samples/winrt/JavaScript/html/AdvancedCapture.html create mode 100644 samples/winrt/JavaScript/images/logo.scale-100.png create mode 100644 samples/winrt/JavaScript/images/microsoft-sdk.png create mode 100644 samples/winrt/JavaScript/images/smallTile-sdk.png create mode 100644 samples/winrt/JavaScript/images/smalllogo.scale-100.png create mode 100644 samples/winrt/JavaScript/images/splash-sdk.png create mode 100644 samples/winrt/JavaScript/images/splashscreen.scale-100.png create mode 100644 samples/winrt/JavaScript/images/squareTile-sdk.png create mode 100644 samples/winrt/JavaScript/images/storeLogo-sdk.png create mode 100644 samples/winrt/JavaScript/images/storelogo.scale-100.png create mode 100644 samples/winrt/JavaScript/images/tile-sdk.png create mode 100644 samples/winrt/JavaScript/images/windows-sdk.png create mode 100644 samples/winrt/JavaScript/js/AdvancedCapture.js create mode 100644 samples/winrt/JavaScript/js/default.js create mode 100644 samples/winrt/JavaScript/package.appxmanifest create mode 100644 samples/winrt/JavaScript/sample-utils/sample-utils.css create mode 100644 samples/winrt/JavaScript/sample-utils/sample-utils.js create mode 100644 samples/winrt/JavaScript/sample-utils/scenario-select.html diff --git a/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.cpp b/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.cpp index 438b2c6d13..40335e2cdc 100644 --- a/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.cpp +++ b/samples/winrt/ImageManipulations/MediaExtensions/OcvTransform/OcvTransform.cpp @@ -120,13 +120,24 @@ HRESULT OcvImageManipulations::SetProperties(ABI::Windows::Foundation::Collectio if (found) { - IInspectable* value; - spSetting->Lookup(key, &value); + Microsoft::WRL::ComPtr spPropVal; + Microsoft::WRL::ComPtr spInsp; + + spSetting->Lookup(key, spInsp.ReleaseAndGetAddressOf()); + + hr = spInsp.As(&spPropVal); + if (hr != S_OK) + { + return hr; + } + + INT32 effect; + hr = spPropVal->GetInt32(&effect); + if (hr != S_OK) + { + return hr; + } - Microsoft::WRL::ComPtr> ref; - hr = value->QueryInterface(IID_PPV_ARGS(&ref)); - int effect = InvalidEffect; - hr = ref->get_Value(&effect); if ((effect >= 0) && (effect < InvalidEffect)) { m_TransformType = (ProcessingType)effect; diff --git a/samples/winrt/JavaScript/MediaCaptureJavaScript.jsproj b/samples/winrt/JavaScript/MediaCaptureJavaScript.jsproj new file mode 100644 index 0000000000..56e6936acd --- /dev/null +++ b/samples/winrt/JavaScript/MediaCaptureJavaScript.jsproj @@ -0,0 +1,115 @@ + + + + + Debug + AnyCPU + + + Debug + ARM + + + Debug + x64 + + + Debug + x86 + + + Release + AnyCPU + + + Release + ARM + + + Release + x64 + + + Release + x86 + + + + d70a3790-48ce-4e58-af60-ebefc22e9c7a + + + + 12.0 + + + + + Windows + 8.1 + 8.1 + $(VersionNumberMajor).$(VersionNumberMinor) + en-US + MediaCaptureJavaScript_TemporaryKey.pfx + + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + $(OPENCV_WINRT_INSTALL_DIR)WS\8.1\$(PlatformTarget)\$(PlatformTarget)\vc12\bin\ + $(OPENCV_WINRT_INSTALL_DIR)WS\8.1\$(PlatformTarget)\$(PlatformTarget)\vc12\lib\ + $(OPENCV_WINRT_INSTALL_DIR)WS\8.1\$(PlatformTarget)\include\ + + d + + + + + + + PreserveNewest + + + PreserveNewest + + + + + + + + \ No newline at end of file diff --git a/samples/winrt/JavaScript/MediaCaptureJavaScript.sln b/samples/winrt/JavaScript/MediaCaptureJavaScript.sln new file mode 100644 index 0000000000..cb5c347fa4 --- /dev/null +++ b/samples/winrt/JavaScript/MediaCaptureJavaScript.sln @@ -0,0 +1,84 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OcvTransform", "..\ImageManipulations\MediaExtensions\OcvTransform\OcvTransform.vcxproj", "{BA69218F-DA5C-4D14-A78D-21A9E4DEC669}" +EndProject +Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "MediaCaptureJavaScript", "MediaCaptureJavaScript.jsproj", "{D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Debug|ARM.ActiveCfg = Debug|ARM + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Debug|ARM.Build.0 = Debug|ARM + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Debug|ARM.Deploy.0 = Debug|ARM + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Debug|Win32.ActiveCfg = Debug|Win32 + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Debug|Win32.Build.0 = Debug|Win32 + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Debug|Win32.Deploy.0 = Debug|Win32 + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Debug|x64.ActiveCfg = Debug|x64 + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Debug|x64.Build.0 = Debug|x64 + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Debug|x64.Deploy.0 = Debug|x64 + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Release|Any CPU.ActiveCfg = Release|Win32 + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Release|ARM.ActiveCfg = Release|ARM + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Release|ARM.Build.0 = Release|ARM + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Release|ARM.Deploy.0 = Release|ARM + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Release|Win32.ActiveCfg = Release|Win32 + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Release|Win32.Build.0 = Release|Win32 + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Release|Win32.Deploy.0 = Release|Win32 + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Release|x64.ActiveCfg = Release|x64 + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Release|x64.Build.0 = Release|x64 + {C5B886A7-8300-46FF-B533-9613DE2AF637}.Release|x64.Deploy.0 = Release|x64 + {BA69218F-DA5C-4D14-A78D-21A9E4DEC669}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {BA69218F-DA5C-4D14-A78D-21A9E4DEC669}.Debug|ARM.ActiveCfg = Debug|ARM + {BA69218F-DA5C-4D14-A78D-21A9E4DEC669}.Debug|ARM.Build.0 = Debug|ARM + {BA69218F-DA5C-4D14-A78D-21A9E4DEC669}.Debug|Win32.ActiveCfg = Debug|Win32 + {BA69218F-DA5C-4D14-A78D-21A9E4DEC669}.Debug|Win32.Build.0 = Debug|Win32 + {BA69218F-DA5C-4D14-A78D-21A9E4DEC669}.Debug|x64.ActiveCfg = Debug|x64 + {BA69218F-DA5C-4D14-A78D-21A9E4DEC669}.Debug|x64.Build.0 = Debug|x64 + {BA69218F-DA5C-4D14-A78D-21A9E4DEC669}.Release|Any CPU.ActiveCfg = Release|Win32 + {BA69218F-DA5C-4D14-A78D-21A9E4DEC669}.Release|ARM.ActiveCfg = Release|ARM + {BA69218F-DA5C-4D14-A78D-21A9E4DEC669}.Release|ARM.Build.0 = Release|ARM + {BA69218F-DA5C-4D14-A78D-21A9E4DEC669}.Release|Win32.ActiveCfg = Release|Win32 + {BA69218F-DA5C-4D14-A78D-21A9E4DEC669}.Release|Win32.Build.0 = Release|Win32 + {BA69218F-DA5C-4D14-A78D-21A9E4DEC669}.Release|x64.ActiveCfg = Release|x64 + {BA69218F-DA5C-4D14-A78D-21A9E4DEC669}.Release|x64.Build.0 = Release|x64 + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Debug|ARM.ActiveCfg = Debug|ARM + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Debug|ARM.Build.0 = Debug|ARM + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Debug|ARM.Deploy.0 = Debug|ARM + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Debug|Win32.ActiveCfg = Debug|x86 + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Debug|Win32.Build.0 = Debug|x86 + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Debug|Win32.Deploy.0 = Debug|x86 + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Debug|x64.ActiveCfg = Debug|x64 + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Debug|x64.Build.0 = Debug|x64 + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Debug|x64.Deploy.0 = Debug|x64 + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Release|Any CPU.Build.0 = Release|Any CPU + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Release|Any CPU.Deploy.0 = Release|Any CPU + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Release|ARM.ActiveCfg = Release|ARM + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Release|ARM.Build.0 = Release|ARM + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Release|ARM.Deploy.0 = Release|ARM + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Release|Win32.ActiveCfg = Release|x86 + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Release|Win32.Build.0 = Release|x86 + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Release|Win32.Deploy.0 = Release|x86 + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Release|x64.ActiveCfg = Release|x64 + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Release|x64.Build.0 = Release|x64 + {D70A3790-48CE-4E58-AF60-EBEFC22E9C7A}.Release|x64.Deploy.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/samples/winrt/JavaScript/MediaCaptureJavaScript_TemporaryKey.pfx b/samples/winrt/JavaScript/MediaCaptureJavaScript_TemporaryKey.pfx new file mode 100644 index 0000000000000000000000000000000000000000..242376d0edd4a63294d20055556a3b41ea2f632b GIT binary patch literal 2512 zcmY+Ec{r5o8^_;S%rv%=5wb63N-~T>qtw{fv4k9B8OFY4ZLBfb4~nB4k%VMPWQmj| zvNRFn2qU|6B4jDcWH@i<`u)zi&h=jR`+V=u_kN!1`RDm!X{cT(1cs%dk`Snq3Hk|J zJP;(LfQAZ#(@-HG4#3hlSpTs&zQAc5e}Z@ptSJQ7|8{Y6LZAgS_#T!9XJJJVod3t* z;k@tzV@UtNvD=)vP$+T$PJ@qrO5cC8DPbBh93IRS*JsQPh(oiEgjJnu7^5c7p2M&d7y6cP(N9M50g{d=$_u%# z*E^ZBH|e4D;Yyn4ShZ@K@G?x39uX(gRUzFc_7E!D7Ft{D7EmXAxVD8oqZ_qP;B%*s z$}t^e`Sv>rzR@BDN-y6=o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w{v@h(Clbx(K{dItp7T*+4%F3SCg{kDo3t(AD>s+FT$Sg zU}~L^HhBWzTq}^-jTj<5FwyrOUZ5UM+m73`mU~$LZXh8?Li0!TV z*bMc<|7JHnugRR8dlcX+;4~ScsvJF&+DQMZoB28Rc%80m0%$)PyLkE76QMV$<##Kvwh)fYr`3jCvX07oNIDdE}9# zO}@C@9hdUE|J_dT^uB#E7)8p4wn50!V9r^E2lu{~r0ovJCbiPCMgvNH$FC2@yF56u~NV}q_bED9aN{ ztD1CKz;l!&*CMGx55NP3U-+7YcXPJ<_exXJmwZ2Dc9cP8e z)ML@J$E*u?Vwp3fb}Sw%fkh%X + + + + + OpenCV for Windows RT + + + + + + + + + + + + + +
+
+

+ + OpenCV for Windows RT +

+

+
+
+
+ + diff --git a/samples/winrt/JavaScript/html/AdvancedCapture.html b/samples/winrt/JavaScript/html/AdvancedCapture.html new file mode 100644 index 0000000000..3f1b03c2d9 --- /dev/null +++ b/samples/winrt/JavaScript/html/AdvancedCapture.html @@ -0,0 +1,40 @@ + + + + + + + + +
+

+ This scenario shows how to enumerate cameras in the system. + Choose a camera from the list to start previewing from that camera. You can add additional effect + using the dropdown provided. +

+ + + + +
+
+ + + + + + + +
Preview
+ +
+
+ + diff --git a/samples/winrt/JavaScript/images/logo.scale-100.png b/samples/winrt/JavaScript/images/logo.scale-100.png new file mode 100644 index 0000000000000000000000000000000000000000..ea685d651ace9ce7ed2463b84bbff6ea2d891f9c GIT binary patch literal 4609 zcmV+c68`OpP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L04^f{04^f|c%?sf00007bV*G`2i*n} z3K|J({%g2XSww<@1dJVIOJMBShDvZ1 zwi5>zR3gB3IVvS~z)((6Nq{OVDa8rIl&cbA62~@ncqD;}9SlN_LV=8Mcm+{NmJ|@M z=z)YJ*wyY%pOZhjd!}c0c6T24_Vmo&qiXePHQRgpp5HyMd+s^l$&)8fo;-Q-RqCGV6A%(1#6-ZDrSL(8PXus@!crgrdMbXbU?5a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sG`4LZ%xU{qFVfZn}SO~KA*)R{6ZVbt*0rp(z`7t+Fjp9 z;7V+&HTEUdxQma~2t&D7jnT;d+WEZHH+ie${>pg;SOTaWAj@gVW}`fe z@J@y;dd=n_16 rvTwV2^5n^rCr_R{dGh4RQx*DuhTcF|6)JJM00000NkvXXu0mjftt+lf literal 0 HcmV?d00001 diff --git a/samples/winrt/JavaScript/images/microsoft-sdk.png b/samples/winrt/JavaScript/images/microsoft-sdk.png new file mode 100644 index 0000000000000000000000000000000000000000..380a0102660b7ad3a9ba5418dd1bb81da99bce2b GIT binary patch literal 3405 zcmV-T4YKlyP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?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jq^kH@8 UTIccK;hzT5*3#}uZuEx!0OwrBv;Y7A literal 0 HcmV?d00001 diff --git a/samples/winrt/JavaScript/images/squareTile-sdk.png b/samples/winrt/JavaScript/images/squareTile-sdk.png new file mode 100644 index 0000000000000000000000000000000000000000..126cf70d83e3973f6a4b040fb4af58f546692252 GIT binary patch literal 2482 zcmd5;Yg7|w8cxLvC|D2`1g$X?C`v99E-?Ybgb5G?fe;OBLNFwQ1WYE*BnA-0T1BWL zMnSEBiomi}7ez!wj7SZoLW{S9>mp!LQZc9$K@p>LCn)az@bsMBUpvp4neYAPeV_OG zoin*nt3zyNI?cr4a5kJ!kc+(!ns3YL*wg>BjSsQc0u?(}6$2-!G-3q8F{N-Kgy+b` z>me>AmZopK4*BD77E&26Ruvl&&XB-zlGv<6N|P%wYm6o^O(~Y7LMnVBv|gqNAPhD% z67Vu<0D<)tejG8aN&H6p?Kk>oOIjMeVX9hnueXc&=*3~P#b0|-mha!8@# zfB^*T3rQ-IGAK;84@jZ2*iPVL;(Q`NCyBP<|N0bY-zzv7By%&(~AXq z0RS6d0>M;_jYbLb@ecM{?mcPCQJ^ZZLIO?tm0^BA*wX*hmJx(NVik<=V0gpi1Vkmn zDi}?MmH40-A3R^Ckir_&+?@Bhf)FCx1WAJtSdO2lE<^SS?<|TJ)0@p^(y=fHktOG8PQkJR1KoDwA8-{F#>@2OkqY9vw)5ofiZ<81CJbt~lJZJ`Tv_rFA|n&f8e# zZ@W@WORzY%u6mJLVvFA)i~7r>AmGH>_)+3VyyBxWv!Q_^*Yg+TjCkuY*?EXJ%C&ZLc_TFUhB@tlPKZ ztuQIYLNMqid6%PJV$8LS%K7SL_)v88<3F-zz=d?{D?YBDk z(@kr0US82Vnfi$6EjP7mr9NXVqdWecyFu9bQ+-vz8~*Jvx9S@}PI#nNetuSS!i8wk z+2%t+i}JEQOZ7g#c_LBGC{o4ST9^^)NT7?J5)0N#T*h;_Wx;TqK{z%zf-s~q+YwB9u^OgKBG`gUUdml{92j!Tih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`Xqr9aHn7pUHd@)Un zYj5;f1(o7sYHzMT6tnTW>+t@;Wxnk!*_3;D;aQ7@>=7RYwcvWU3HaL8rD zamEmP#-v^oIY;GJrcGr_YyWP$|7PL>Nd~R3E+*rLwl`M(?ya};313mc{QT!#{=kD~ z*_z*~*>3GM0X=d#Wzp$P!Xu`&Pv literal 0 HcmV?d00001 diff --git a/samples/winrt/JavaScript/images/storelogo.scale-100.png b/samples/winrt/JavaScript/images/storelogo.scale-100.png new file mode 100644 index 0000000000000000000000000000000000000000..dcb672712c6823a0c91548ded70a8acb85536b4d GIT binary patch literal 429 zcmV;e0aE^nP)NtYJa1l)bQ5qwGXpZbs7%2oRMd4y35$s&66(fxhNg8W02!vSn zdlrL2h^Fx+3=$z;kK{0D#MyeJ8WRWZcLSf(PcQ_mLOhrmC}O-tX^0c>5`YvCUZVsc zG-6#78ubjJ5nA;OX&^K(q=i6ZNE3m?kTwE^AqxZoLskfB3|S&1F=UO9!cY$g2@Lgu z;9{sJ1P9|X2L`r1#Gs8R{E^$PRrMaC86q|HL$5^q~u7S+3& zTD-Ok5}6Q6nB-Pe79nQGbi)dHH^jK^u&Le8=e6%Xf1Kx>^ZS0kzu!6M_xYW3%GG6$ z)~d~`5D0{plcPNyfmlXV_0O-+RJHCMS4UL8O+p86p&J}1jAZa3gbfo8fB+{Bg9Xtc z22&LF5VAlZ)B(1;x6qsBOa@^NnlX<-M{#&6HUeQ`6~$wKA&?LVfLLrU1vz|IiUin9 z3ewArhNbcBpdhwmG#_${c5w%zLqKyT(#jIBh$5>5IFOJ5L~%m70&)}uxu8o{_2;KC zNMHdX451)@56YY73fRGX2rxrqQ6QFx1&BB_j|#1#k`To7`yryx~)G@H#N6A9)HW;k;^k$|?KuS)BlTqYX-%Ae=h|P1LEg9mWlnv{$CwipSRw5W!7=Gl{Lv|$c&&wI(fkRs zU|z&5m=`hsM?z)(;O1{jWK<1uq7yUx#%3OaYE=>Oc0k_VAnz%Ys)BE!w}l;RWk)8z z(VENs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{P(a>u6% zbshAL;`_fWk*`fVne`@i^!iZ$+wJrA7$N>k51Z_K`RLmbsqYJ5Ae zpDHirz501}!eNS?kO8L1^C!)ktV)`Jj^`)VJh@*TSEK%sN(#lz}UAsoG zRciR3+%kN&g+^=xSy?_x3snMB(~e+cy^QWP;%#Cq>n)f`f3<94`odnN$+D3+?MvMI zW0MyJYI6zx>iRu%7OIN=he92%^@l>eWF=PB=s(r^zbEmR*TvEjf4XsIX4m^8zOJ*{ V^V80WL-UV6CkGe%d|Utc-vFTWTn+#L literal 0 HcmV?d00001 diff --git a/samples/winrt/JavaScript/images/windows-sdk.png b/samples/winrt/JavaScript/images/windows-sdk.png new file mode 100644 index 0000000000000000000000000000000000000000..af64bf00ad4a8bfec7ee89ab8a7b61d55988dfd6 GIT binary patch literal 1426 zcmV;D1#S9?P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf00v@9M??Vs0RI60 zpuMM)00007bV*G`2i*n}3K|J({%opWa9o|%z`{{H+k-?{nD$#?FZ$C=4>1YrLIKI=rpojc5V z^Tvy7YM9gB?#7=5Igw21?-yd_O8M?+=5o7inGh#VP;z!)3hYQWk+Crf z4D8)YK?FN@Qea?ah5|d1P2|G|3UuU}Dwe36xj72#NH&q$S_*WW$B!wBV0@ec165TN zSVG5&9apcK4^-cAR92e%Nq2Wsk{#%o5K|GpTUsc|z>Xc}KE5A5q(nQ=Ga+l%=tU^z z&CQgkaPp)vx5Noa-t)!{y$IFQ)07y%l?+>56lG$9vF2uK#2~NW71$v%x~D07BI9D5%|P7Y ztOoi9T2RP|gmIpq7p)MEV57c*PC*L+<3z?Fwct3l@>c3;$BP&8LeHrc&*Y@Q&89hD zn@BhBo-eRm{R7!@@uGLEOUnYwp}xM@CrHUlKSOGP<>)8KmTT9F1xe>}^ot0tTq*4% ztuo*I15yhtSGLT~$|AT{)W85Ggb>V^ZfGd(W@vh-#g(hyAX}C%FD*uO7`?sbeCfVE zZ!!px2&n~z>077`lJOUiEjMrKg{YR-$RLG+IajsB-7sD()}+HwkiQ{Y+S*DB2)eVA z5*1#(5@OLJbH4A}x3QfN6H3Xt`k|~a72&(9EBZ8S>f?LYE^IH0%Szd$S_);w^XGa2 zs^d6wMn6ILZf_T&;sJX=*La;Dp{#iFgaQK_Hc${jXJ`1DY;qFIw)f&aHFds*;uwK) zP*Xs)P#5GQ-@7mtFQy=Zs3%AtKVl+{P9rsS2BA3qgbL79Kz~8AkWbW8o{

BDi;t z0t0n*_%S4gl%qmd9F>rouj&^_CAe>^zIBU|LfE)5{1}mU*4W4&;abPnxdWN_9#V6I z8i7=z9%o78{>;cJEU-=azR#Y;Rwg#`#`!;PQZ=s@zeAt+CwJgcs2);tObW7pzg|Sp zy}evKdnUx&w;b08F4nFM|0H~KoVl?PVh~abh*ZqQ)7No++%3M8_@Zpx(cz7Z(4&br z%@>hcm~0q_u}Cl#l+->-C>z;m8j51Yiqc||`qCvD5TIFPicifKlT^b{ImmkuQ*q@w z_~i+_R7wF-3oBdLo$`ugvs7N|}-R0ZNK|g1Qt-I&;ygx!AUi zIvGGpGy_lv^d;n;vEVA`JLp#^E1o_T;=lp#OAxsn$2EtGx;pNjl}?|IUKvZWeL(jg glKR>2!ho@V0n*p4SbNWbssI2007*qoM6N<$f*ydI?EnA( literal 0 HcmV?d00001 diff --git a/samples/winrt/JavaScript/js/AdvancedCapture.js b/samples/winrt/JavaScript/js/AdvancedCapture.js new file mode 100644 index 0000000000..6d168c79cc --- /dev/null +++ b/samples/winrt/JavaScript/js/AdvancedCapture.js @@ -0,0 +1,161 @@ +//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF +//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO +//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A +//// PARTICULAR PURPOSE. +//// +//// Copyright (c) Microsoft Corporation. All rights reserved + +(function () { + "use strict"; + + var cameraList = null; + var mediaCaptureMgr = null; + var captureInitSettings = null; + + var page = WinJS.UI.Pages.define("/html/AdvancedCapture.html", { + + ready: function (element, options) { + scenarioInitialize(); + }, + + unload: function (element, options) { + // release resources + releaseMediaCapture(); + } + }); + + function scenarioInitialize() { + // Initialize the UI elements + id("btnStartDevice").disabled = false; + id("btnStartDevice").addEventListener("click", startDevice, false); + id("btnStartPreview").disabled = true; + id("videoEffect").disabled = true; + id("btnStartPreview").addEventListener("click", startPreview, false); + id("cameraSelect").addEventListener("change", onDeviceChange, false); + + id("videoEffect").addEventListener('change', addEffectToImageStream, false); + + enumerateCameras(); + } + + function initCameraSettings() { + captureInitSettings = new Windows.Media.Capture.MediaCaptureInitializationSettings(); + captureInitSettings.streamingCaptureMode = Windows.Media.Capture.StreamingCaptureMode.video + + // If the user chose another capture device, use it by default + var selectedIndex = id("cameraSelect").selectedIndex; + var deviceInfo = cameraList[selectedIndex]; + captureInitSettings.videoDeviceId = deviceInfo.id; + } + + // this function takes care of releasing the resources associated with media capturing + function releaseMediaCapture() { + if (mediaCaptureMgr) { + mediaCaptureMgr.close(); + mediaCaptureMgr = null; + } + } + + //Initialize media capture with the current settings + function startDevice() { + displayStatus("Starting device"); + releaseMediaCapture(); + initCameraSettings(); + + mediaCaptureMgr = new Windows.Media.Capture.MediaCapture(); + mediaCaptureMgr.initializeAsync(captureInitSettings).done(function (result) { + // Update the UI + id("btnStartPreview").disabled = false; + id("btnStartDevice").disabled = true; + displayStatus("Device started"); + }); + } + + function startPreview() { + displayStatus("Starting preview"); + id("btnStartPreview").disabled = true; + id("videoEffect").disabled = false; + var video = id("previewVideo"); + video.src = URL.createObjectURL(mediaCaptureMgr, { oneTimeOnly: true }); + video.play(); + displayStatus("Preview started"); + } + + function addEffectToImageStream() { + var effectId = id("videoEffect").selectedIndex; + var props = new Windows.Foundation.Collections.PropertySet(); + props.insert("{698649BE-8EAE-4551-A4CB-3EC98FBD3D86}", effectId); + + mediaCaptureMgr.clearEffectsAsync(Windows.Media.Capture.MediaStreamType.videoPreview).then(function () { + return mediaCaptureMgr.addEffectAsync(Windows.Media.Capture.MediaStreamType.videoPreview, 'OcvTransform.OcvImageManipulations', props); + }).then(function () { + displayStatus('Effect has been successfully added'); + }, errorHandler); + } + + function enumerateCameras() { + displayStatus("Enumerating capture devices"); + var cameraSelect = id("cameraSelect"); + cameraList = null; + cameraList = new Array(); + + // Clear the previous list of capture devices if any + while (cameraSelect.length > 0) { + cameraSelect.remove(0); + } + + // Enumerate cameras and add them to the list + var deviceInfo = Windows.Devices.Enumeration.DeviceInformation; + deviceInfo.findAllAsync(Windows.Devices.Enumeration.DeviceClass.videoCapture).done(function (cameras) { + if (cameras.length === 0) { + cameraSelect.disabled = true; + displayError("No camera was found"); + id("btnStartDevice").disabled = true; + cameraSelect.add(new Option("No cameras available")); + } else { + cameras.forEach(function (camera) { + cameraList.push(camera); + cameraSelect.add(new Option(camera.name)); + }); + } + }, errorHandler); + } + + function onDeviceChange() { + releaseMediaCapture(); + id("btnStartDevice").disabled = false; + id("btnStartPreview").disabled = true; + id("videoEffect").disabled = true; + displayStatus(""); + } + + function suspendingHandler(suspendArg) { + displayStatus("Suspended"); + releaseMediaCapture(); + } + + function resumingHandler(resumeArg) { + displayStatus("Resumed"); + scenarioInitialize(); + } + + function errorHandler(err) { + displayError(err.message); + } + + function failedEventHandler(e) { + displayError("Fatal error", e.message); + } + + function displayStatus(statusText) { + SdkSample.displayStatus(statusText); + } + + function displayError(error) { + SdkSample.displayError(error); + } + + function id(elementId) { + return document.getElementById(elementId); + } +})(); diff --git a/samples/winrt/JavaScript/js/default.js b/samples/winrt/JavaScript/js/default.js new file mode 100644 index 0000000000..ffe7248bb3 --- /dev/null +++ b/samples/winrt/JavaScript/js/default.js @@ -0,0 +1,74 @@ +//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF +//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO +//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A +//// PARTICULAR PURPOSE. +//// +//// Copyright (c) Microsoft Corporation. All rights reserved + + +(function () { + "use strict"; + + var sampleTitle = "OpenCV Image Manipulations sample"; + + var scenarios = [ + { url: "/html/AdvancedCapture.html", title: "Enumerate cameras and add a video effect" }, + ]; + + function activated(eventObject) { + if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) { + // Use setPromise to indicate to the system that the splash screen must not be torn down + // until after processAll and navigate complete asynchronously. + eventObject.setPromise(WinJS.UI.processAll().then(function () { + // Navigate to either the first scenario or to the last running scenario + // before suspension or termination. + var url = WinJS.Application.sessionState.lastUrl || scenarios[0].url; + return WinJS.Navigation.navigate(url); + })); + } + } + + WinJS.Navigation.addEventListener("navigated", function (eventObject) { + var url = eventObject.detail.location; + var host = document.getElementById("contentHost"); + // Call unload method on current scenario, if there is one + host.winControl && host.winControl.unload && host.winControl.unload(); + WinJS.Utilities.empty(host); + eventObject.detail.setPromise(WinJS.UI.Pages.render(url, host, eventObject.detail.state).then(function () { + WinJS.Application.sessionState.lastUrl = url; + })); + }); + + WinJS.Namespace.define("SdkSample", { + sampleTitle: sampleTitle, + scenarios: scenarios, + mediaCaptureMgr: null, + photoFile: "photo.jpg", + deviceList: null, + recordState: null, + captureInitSettings: null, + encodingProfile: null, + storageFile: null, + photoStorage: null, + cameraControlSliders: null, + + + displayStatus: function (statusText) { + WinJS.log && WinJS.log(statusText, "MediaCapture", "status"); + }, + + displayError: function (error) { + WinJS.log && WinJS.log(error, "MediaCapture", "error"); + }, + + id: function (elementId) { + return document.getElementById(elementId); + }, + + }); + + WinJS.Application.addEventListener("activated", activated, false); + WinJS.Application.start(); + Windows.UI.WebUI.WebUIApplication.addEventListener("suspending", SdkSample.suspendingHandler, false); + Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", SdkSample.resumingHandler, false); +})(); diff --git a/samples/winrt/JavaScript/package.appxmanifest b/samples/winrt/JavaScript/package.appxmanifest new file mode 100644 index 0000000000..aa4526c2a4 --- /dev/null +++ b/samples/winrt/JavaScript/package.appxmanifest @@ -0,0 +1,35 @@ + + + + + MediaCaptureJavaScript + Sergei + images\storelogo.png + + + 6.3.0 + 6.3.0 + + + + + + + + + + + + + + + + + + + OcvTransform.dll + + + + + \ No newline at end of file diff --git a/samples/winrt/JavaScript/sample-utils/sample-utils.css b/samples/winrt/JavaScript/sample-utils/sample-utils.css new file mode 100644 index 0000000000..4baf32c80d --- /dev/null +++ b/samples/winrt/JavaScript/sample-utils/sample-utils.css @@ -0,0 +1,215 @@ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +html +{ + cursor: default; +} + +#featureLabel +{ + font: 20pt/24pt "Segoe UI Semilight"; + margin:0; + padding:5px 0 10px 0; + font-weight: normal; +} + +#inputLabel, #outputLabel +{ + font: 11pt/15pt "Segoe UI"; + margin:0; + padding:0; + font-weight: normal; +} + +#listLabel, #descLabel +{ + font: 11pt/15pt "Segoe UI Semilight"; + font-weight:normal; +} + +#rootGrid +{ + width: 100%; + height: 100%; + display: -ms-grid; + -ms-grid-columns: 100px 1fr 100px; + -ms-grid-rows: 20px auto 1fr auto 20px; +} + +#header +{ + -ms-grid-column: 2; + -ms-grid-row: 2; +} + +#content +{ + padding-right:20px; + padding-bottom:20px; + overflow:auto; + display:-ms-grid; + -ms-grid-columns:1fr; + -ms-grid-rows: auto 1fr; + -ms-grid-column: 2; + -ms-grid-row: 3; +} + +#footer +{ + -ms-grid-column: 2; + -ms-grid-row: 4; + padding-bottom:10px; +} + +#featureLabel +{ + -ms-grid-row: 1; +} + +#contentHost +{ + display:-ms-grid; + -ms-grid-columns:1fr; + -ms-grid-rows: auto auto auto 1fr; + -ms-grid-row: 2; +} + +#inputLabel +{ + -ms-grid-row: 1; +} + + +#input +{ + -ms-grid-row: 2; + display: -ms-grid; + -ms-grid-columns: auto auto; + -ms-grid-rows: auto; + margin-top:10px; +} + +#outputLabel +{ + -ms-grid-row: 3; + padding-top:10px; + padding-bottom:10px; +} + +#output +{ + height:100%; + -ms-grid-row: 4; + -ms-grid-row-align:stretch; +} + +.clear +{ + clear:both; +} + + +#footer span +{ + font-size:12px; +} + +#footer .company +{ + float:left; +} + +#footer .links +{ + float:right; +} + +#footer .links a +{ + font-size:12px; + margin-left:8px; + text-decoration:none; +} + +#footer .links .pipe +{ + font-size:9px; + margin-left:8px; +} + +#statusMessage +{ + margin-bottom:5px; +} + +#input .options +{ + -ms-grid-row: 1; + -ms-grid-column: 1; +} + +#input .details +{ + -ms-grid-row: 1; + -ms-grid-column: 2; + cursor:text; +} + +.imageHolder +{ + max-width:382px; +} + +.imageHolder.withText +{ + float:left; + margin-right:10px; +} + +#scenarios +{ + margin-right:20px; +} + + + +@media screen and (min-width: 800px) and (max-width: 1024px) +{ + #rootGrid + { + -ms-grid-columns: 40px 1fr 40px; + } +} + +@media screen and (max-width: 799px) +{ + #rootGrid + { + -ms-grid-columns: 20px 1fr 20px; + } + + #output + { + padding-bottom:20px; + } + + #input + { + -ms-grid-columns: auto; + -ms-grid-rows: auto auto; + } + + #input .options + { + -ms-grid-row: 1; + -ms-grid-column: 1; + margin-bottom:10px; + } + + #input .details + { + -ms-grid-row: 2; + -ms-grid-column: 1; + } +} + + diff --git a/samples/winrt/JavaScript/sample-utils/sample-utils.js b/samples/winrt/JavaScript/sample-utils/sample-utils.js new file mode 100644 index 0000000000..ad2834d8c8 --- /dev/null +++ b/samples/winrt/JavaScript/sample-utils/sample-utils.js @@ -0,0 +1,204 @@ +//// Copyright (c) Microsoft Corporation. All rights reserved + +// This file is a part of the SDK sample framework. For code demonstrating scenarios in this particular sample, +// please see the html, css and js folders. + +(function () { + + // + // Helper controls used in the sample pages + // + + // The ScenarioInput control inserts the appropriate markup to get labels & controls + // hooked into the input section of a scenario page so that it's not repeated in + // every one. + + var lastError = ""; + var lastStatus = ""; + var ScenarioInput = WinJS.Class.define( + function (element, options) { + element.winControl = this; + this.element = element; + + new WinJS.Utilities.QueryCollection(element) + .setAttribute("role", "main") + .setAttribute("aria-labelledby", "inputLabel"); + element.id = "input"; + + this.addInputLabel(element); + this.addDetailsElement(element); + this.addScenariosPicker(element); + }, { + addInputLabel: function (element) { + var label = document.createElement("h2"); + label.textContent = "Input"; + label.id = "inputLabel"; + element.parentNode.insertBefore(label, element); + }, + addScenariosPicker: function (parentElement) { + var scenarios = document.createElement("div"); + scenarios.id = "scenarios"; + var control = new ScenarioSelect(scenarios); + + parentElement.insertBefore(scenarios, parentElement.childNodes[0]); + }, + + addDetailsElement: function (sourceElement) { + var detailsDiv = this._createDetailsDiv(); + while (sourceElement.childNodes.length > 0) { + detailsDiv.appendChild(sourceElement.removeChild(sourceElement.childNodes[0])); + } + sourceElement.appendChild(detailsDiv); + }, + _createDetailsDiv: function () { + var detailsDiv = document.createElement("div"); + + new WinJS.Utilities.QueryCollection(detailsDiv) + .addClass("details") + .setAttribute("role", "region") + .setAttribute("aria-labelledby", "descLabel") + .setAttribute("aria-live", "assertive"); + + var label = document.createElement("h3"); + label.textContent = "Description"; + label.id = "descLabel"; + + detailsDiv.appendChild(label); + return detailsDiv; + }, + } + ); + + // The ScenarioOutput control inserts the appropriate markup to get labels & controls + // hooked into the output section of a scenario page so that it's not repeated in + // every one. + + var ScenarioOutput = WinJS.Class.define( + function (element, options) { + element.winControl = this; + this.element = element; + new WinJS.Utilities.QueryCollection(element) + .setAttribute("role", "region") + .setAttribute("aria-labelledby", "outputLabel") + .setAttribute("aria-live", "assertive"); + element.id = "output"; + + this._addOutputLabel(element); + this._addStatusOutput(element); + }, { + _addOutputLabel: function (element) { + var label = document.createElement("h2"); + label.id = "outputLabel"; + label.textContent = "Output"; + element.parentNode.insertBefore(label, element); + }, + _addStatusOutput: function (element) { + var statusDiv = document.createElement("div"); + statusDiv.id = "statusMessage"; + statusDiv.setAttribute("role", "textbox"); + element.insertBefore(statusDiv, element.childNodes[0]); + } + } + ); + + + // Sample infrastructure internals + + var currentScenarioUrl = null; + + WinJS.Navigation.addEventListener("navigating", function (evt) { + currentScenarioUrl = evt.detail.location; + }); + + WinJS.log = function (message, tag, type) { + var isError = (type === "error"); + var isStatus = (type === "status"); + + if (isError || isStatus) { + var statusDiv = /* @type(HTMLElement) */ document.getElementById("statusMessage"); + if (statusDiv) { + statusDiv.innerText = message; + if (isError) { + lastError = message; + statusDiv.style.color = "blue"; + } else if (isStatus) { + lastStatus = message; + statusDiv.style.color = "green"; + } + } + } + }; + + // Control that populates and runs the scenario selector + + var ScenarioSelect = WinJS.UI.Pages.define("/sample-utils/scenario-select.html", { + ready: function (element, options) { + var that = this; + var selectElement = WinJS.Utilities.query("#scenarioSelect", element); + this._selectElement = selectElement[0]; + + SdkSample.scenarios.forEach(function (s, index) { + that._addScenario(index, s); + }); + + selectElement.listen("change", function (evt) { + var select = evt.target; + if (select.selectedIndex >= 0) { + var newUrl = select.options[select.selectedIndex].value; + WinJS.Navigation.navigate(newUrl); + } + }); + selectElement[0].size = (SdkSample.scenarios.length > 5 ? 5 : SdkSample.scenarios.length); + if (SdkSample.scenarios.length === 1) { + // Avoid showing down arrow when there is only one scenario + selectElement[0].setAttribute("multiple", "multiple"); + } + + // Use setImmediate to ensure that the select element is set as active only after + // the scenario page has been constructed. + setImmediate(function () { + that._selectElement.setActive(); + }); + }, + + _addScenario: function (index, info) { + var option = document.createElement("option"); + if (info.url === currentScenarioUrl) { + option.selected = "selected"; + } + option.text = (index + 1) + ") " + info.title; + option.value = info.url; + this._selectElement.appendChild(option); + } + }); + + function activated(e) { + WinJS.Utilities.query("#featureLabel")[0].textContent = SdkSample.sampleTitle; + } + + WinJS.Application.addEventListener("activated", activated, false); + + // Export public methods & controls + WinJS.Namespace.define("SdkSample", { + ScenarioInput: ScenarioInput, + ScenarioOutput: ScenarioOutput + }); + + // SDK Sample Test helper + document.TestSdkSample = { + getLastError: function () { + return lastError; + }, + + getLastStatus: function () { + return lastStatus; + }, + + selectScenario: function (scenarioID) { + scenarioID = scenarioID >> 0; + var select = document.getElementById("scenarioSelect"); + var newUrl = select.options[scenarioID - 1].value; + WinJS.Navigation.navigate(newUrl); + } + }; +})(); diff --git a/samples/winrt/JavaScript/sample-utils/scenario-select.html b/samples/winrt/JavaScript/sample-utils/scenario-select.html new file mode 100644 index 0000000000..011fabee60 --- /dev/null +++ b/samples/winrt/JavaScript/sample-utils/scenario-select.html @@ -0,0 +1,15 @@ + + + + + + + +

+

Select scenario:

+ +
+ +