CrazyIter 4 years ago
parent
commit
1f563b9ad7

+ 7 - 0
App1/App.xaml

@@ -0,0 +1,7 @@
+<Application
+    x:Class="App1.App"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:local="using:App1">
+
+</Application>

+ 116 - 0
App1/App.xaml.cpp

@@ -0,0 +1,116 @@
+//
+// App.xaml.cpp
+// App 类的实现。
+//
+
+#include "pch.h"
+#include "MainPage.xaml.h"
+
+using namespace App1;
+
+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;
+
+/// <summary>
+/// 初始化单一实例应用程序对象。这是执行的创作代码的第一行,
+/// 已执行,逻辑上等同于 main() 或 WinMain()。
+/// </summary>
+App::App()
+{
+    InitializeComponent();
+    Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
+}
+
+/// <summary>
+/// 在应用程序由最终用户正常启动时进行调用。
+/// 将在启动应用程序以打开特定文件等情况下使用。
+/// </summary>
+/// <param name="e">有关启动请求和过程的详细信息。</param>
+void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e)
+{
+    auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
+
+    // 不要在窗口已包含内容时重复应用程序初始化,
+    // 只需确保窗口处于活动状态
+    if (rootFrame == nullptr)
+    {
+        // 创建一个 Frame 以用作导航上下文并将其与
+        // SuspensionManager 键关联
+        rootFrame = ref new Frame();
+
+        rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed);
+
+        if (e->PreviousExecutionState == ApplicationExecutionState::Terminated)
+        {
+            // TODO: 仅当适用时还原保存的会话状态,并安排
+            // 还原完成后的最终启动步骤
+
+        }
+
+        if (e->PrelaunchActivated == false)
+        {
+            if (rootFrame->Content == nullptr)
+            {
+                // 当导航堆栈尚未还原时,导航到第一页,
+                // 并通过将所需信息作为导航参数传入来配置
+                // 新页面
+                rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
+            }
+            // 将框架放在当前窗口中
+            Window::Current->Content = rootFrame;
+            // 确保当前窗口处于活动状态
+            Window::Current->Activate();
+        }
+    }
+    else
+    {
+        if (e->PrelaunchActivated == false)
+        {
+            if (rootFrame->Content == nullptr)
+            {
+                // 当导航堆栈尚未还原时,导航到第一页,
+                // 并通过将所需信息作为导航参数传入来配置
+                // 参数
+                rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
+            }
+            // 确保当前窗口处于活动状态
+            Window::Current->Activate();
+        }
+    }
+}
+
+/// <summary>
+/// 在将要挂起应用程序执行时调用。  在不知道应用程序
+/// 无需知道应用程序会被终止还是会恢复,
+/// 并让内存内容保持不变。
+/// </summary>
+/// <param name="sender">挂起的请求的源。</param>
+/// <param name="e">有关挂起请求的详细信息。</param>
+void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e)
+{
+    (void) sender;  // 未使用的参数
+    (void) e;   // 未使用的参数
+
+    //TODO: 保存应用程序状态并停止任何后台活动
+}
+
+/// <summary>
+/// 导航到特定页失败时调用
+/// </summary>
+///<param name="sender">导航失败的框架</param>
+///<param name="e">有关导航失败的详细信息</param>
+void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e)
+{
+    throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name);
+}

+ 27 - 0
App1/App.xaml.h

@@ -0,0 +1,27 @@
+//
+// App.xaml.h
+// App 类的声明。
+//
+
+#pragma once
+
+#include "App.g.h"
+
+namespace App1
+{
+	/// <summary>
+	/// 提供特定于应用程序的行为,以补充默认的应用程序类。
+	/// </summary>
+	ref class App sealed
+	{
+	protected:
+		virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
+
+	internal:
+		App();
+
+	private:
+		void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
+		void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e);
+	};
+}

+ 240 - 0
App1/App1.vcxproj

@@ -0,0 +1,240 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{ab4b36ee-3992-4f35-9fab-ba27b57603dc}</ProjectGuid>
+    <RootNamespace>App1</RootNamespace>
+    <DefaultLanguage>zh-CN</DefaultLanguage>
+    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
+    <AppContainerApplication>true</AppContainerApplication>
+    <ApplicationType>Windows Store</ApplicationType>
+    <WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformMinVersion>10.0.17763.0</WindowsTargetPlatformMinVersion>
+    <ApplicationTypeRevision>10.0</ApplicationTypeRevision>
+    <AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|ARM">
+      <Configuration>Debug</Configuration>
+      <Platform>ARM</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|ARM64">
+      <Configuration>Debug</Configuration>
+      <Platform>ARM64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|ARM">
+      <Configuration>Release</Configuration>
+      <Platform>ARM</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|ARM64">
+      <Configuration>Release</Configuration>
+      <Platform>ARM64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <PlatformToolset>v142</PlatformToolset>
+    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <PlatformToolset>v142</PlatformToolset>
+    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <PlatformToolset>v142</PlatformToolset>
+    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <PlatformToolset>v142</PlatformToolset>
+    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
+  </PropertyGroup>
+
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+
+  <PropertyGroup Label="UserMacros" />
+
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
+    <ClCompile>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+      <DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+    <ClCompile>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+      <DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+    <ClCompile>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+      <DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+    <ClCompile>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+      <DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+      <DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+      <DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+      <DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
+      <DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
+    </ClCompile>
+  </ItemDefinitionGroup>
+
+  <ItemGroup>
+    <ClInclude Include="pch.h" />
+    <ClInclude Include="App.xaml.h">
+        <DependentUpon>App.xaml</DependentUpon>
+    </ClInclude>
+    <ClInclude Include="MainPage.xaml.h">
+        <DependentUpon>MainPage.xaml</DependentUpon>
+    </ClInclude>
+  </ItemGroup>
+
+  <ItemGroup>
+    <ApplicationDefinition Include="App.xaml">
+      <SubType>Designer</SubType>
+    </ApplicationDefinition>
+    <Page Include="MainPage.xaml">
+      <SubType>Designer</SubType>
+    </Page>
+  </ItemGroup>
+
+  <ItemGroup>
+    <AppxManifest Include="Package.appxmanifest">
+      <SubType>Designer</SubType>
+    </AppxManifest>
+  </ItemGroup>
+
+  <ItemGroup>
+    <Image Include="Assets\LockScreenLogo.scale-200.png" />
+    <Image Include="Assets\SplashScreen.scale-200.png" />
+    <Image Include="Assets\Square150x150Logo.scale-200.png" />
+    <Image Include="Assets\Square44x44Logo.scale-200.png" />
+    <Image Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
+    <Image Include="Assets\StoreLogo.png" />
+    <Image Include="Assets\Wide310x150Logo.scale-200.png" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ClCompile Include="App.xaml.cpp">
+        <DependentUpon>App.xaml</DependentUpon>
+    </ClCompile>
+    <ClCompile Include="MainPage.xaml.cpp">
+        <DependentUpon>MainPage.xaml</DependentUpon>
+    </ClCompile>
+
+    <ClCompile Include="pch.cpp">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
+    </ClCompile>
+  </ItemGroup>
+
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+
+</Project>

+ 24 - 0
App1/App1.vcxproj.filters

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Common">
+      <UniqueIdentifier>ab4b36ee-3992-4f35-9fab-ba27b57603dc</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Assets">
+      <UniqueIdentifier>f936953e-3ddc-486f-a087-f67ee7659e36</UniqueIdentifier>
+      <Extensions>bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png</Extensions>
+    </Filter>
+    <Image Include="Assets\Logo.scale-100.png">
+      <Filter>Assets</Filter>
+    </Image>
+    <Image Include="Assets\SmallLogo.scale-100.png">
+      <Filter>Assets</Filter>
+    </Image>
+    <Image Include="Assets\StoreLogo.scale-100.png">
+      <Filter>Assets</Filter>
+    </Image>
+    <Image Include="Assets\SplashScreen.scale-100.png">
+      <Filter>Assets</Filter>
+    </Image>
+  </ItemGroup>
+</Project>

BIN
App1/Assets/LockScreenLogo.scale-200.png


BIN
App1/Assets/SplashScreen.scale-200.png


BIN
App1/Assets/Square150x150Logo.scale-200.png


BIN
App1/Assets/Square44x44Logo.scale-200.png


BIN
App1/Assets/Square44x44Logo.targetsize-24_altform-unplated.png


BIN
App1/Assets/StoreLogo.png


BIN
App1/Assets/Wide310x150Logo.scale-200.png


+ 14 - 0
App1/MainPage.xaml

@@ -0,0 +1,14 @@
+<Page
+    x:Class="App1.MainPage"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:local="using:App1"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    mc:Ignorable="d"
+    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
+
+    <Grid>
+
+    </Grid>
+</Page>

+ 27 - 0
App1/MainPage.xaml.cpp

@@ -0,0 +1,27 @@
+//
+// MainPage.xaml.cpp
+// MainPage 类的实现。
+//
+
+#include "pch.h"
+#include "MainPage.xaml.h"
+
+using namespace App1;
+
+using namespace Platform;
+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::Media;
+using namespace Windows::UI::Xaml::Navigation;
+
+// https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x804 上介绍了“空白页”项模板
+
+MainPage::MainPage()
+{
+	InitializeComponent();
+}

+ 21 - 0
App1/MainPage.xaml.h

@@ -0,0 +1,21 @@
+//
+// MainPage.xaml.h
+// MainPage 类的声明。
+//
+
+#pragma once
+
+#include "MainPage.g.h"
+
+namespace App1
+{
+	/// <summary>
+	/// 可用于自身或导航至 Frame 内部的空白页。
+	/// </summary>
+	public ref class MainPage sealed
+	{
+	public:
+		MainPage();
+
+	};
+}

+ 49 - 0
App1/Package.appxmanifest

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<Package
+  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
+  xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
+  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
+  IgnorableNamespaces="uap mp">
+
+  <Identity
+    Name="29ea17d7-e2b1-4501-895f-5ab31d922d74"
+    Publisher="CN=CrazyIter"
+    Version="1.0.0.0" />
+
+  <mp:PhoneIdentity PhoneProductId="29ea17d7-e2b1-4501-895f-5ab31d922d74" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
+
+  <Properties>
+    <DisplayName>App1</DisplayName>
+    <PublisherDisplayName>CrazyIter</PublisherDisplayName>
+    <Logo>Assets\StoreLogo.png</Logo>
+  </Properties>
+
+  <Dependencies>
+    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
+  </Dependencies>
+
+  <Resources>
+    <Resource Language="x-generate"/>
+  </Resources>
+
+  <Applications>
+    <Application Id="App"
+      Executable="$targetnametoken$.exe"
+      EntryPoint="App1.App">
+      <uap:VisualElements
+        DisplayName="App1"
+        Square150x150Logo="Assets\Square150x150Logo.png"
+        Square44x44Logo="Assets\Square44x44Logo.png"
+        Description="App1"
+        BackgroundColor="transparent">
+        <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
+        <uap:SplashScreen Image="Assets\SplashScreen.png" />
+      </uap:VisualElements>
+    </Application>
+  </Applications>
+
+  <Capabilities>
+    <Capability Name="internetClient" />
+  </Capabilities>
+</Package>

+ 5 - 0
App1/pch.cpp

@@ -0,0 +1,5 @@
+//
+// pch.cpp
+//
+
+#include "pch.h"

+ 10 - 0
App1/pch.h

@@ -0,0 +1,10 @@
+//
+// pch.h
+//
+
+#pragma once
+
+#include <collection.h>
+#include <ppltasks.h>
+
+#include "App.xaml.h"

+ 85 - 0
ConsoleApplication1/ConsoleApplication1.vcxproj

@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|ARM">
+      <Configuration>Debug</Configuration>
+      <Platform>ARM</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|ARM">
+      <Configuration>Release</Configuration>
+      <Platform>ARM</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|ARM64">
+      <Configuration>Debug</Configuration>
+      <Platform>ARM64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|ARM64">
+      <Configuration>Release</Configuration>
+      <Platform>ARM64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x86">
+      <Configuration>Debug</Configuration>
+      <Platform>x86</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x86">
+      <Configuration>Release</Configuration>
+      <Platform>x86</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{8d75cb36-4f7d-4d7e-ab82-ae2723a31752}</ProjectGuid>
+    <Keyword>Linux</Keyword>
+    <RootNamespace>ConsoleApplication1</RootNamespace>
+    <MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
+    <ApplicationType>Linux</ApplicationType>
+    <ApplicationTypeRevision>1.0</ApplicationTypeRevision>
+    <TargetLinuxPlatform>Generic</TargetLinuxPlatform>
+    <LinuxProjectType>{D51BCBC9-82E9-4017-911E-C93873C4EA2B}</LinuxProjectType>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
+    <UseDebugLibraries>true</UseDebugLibraries>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+    <UseDebugLibraries>false</UseDebugLibraries>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'" Label="Configuration">
+    <UseDebugLibraries>true</UseDebugLibraries>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'" Label="Configuration">
+    <UseDebugLibraries>false</UseDebugLibraries>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <UseDebugLibraries>true</UseDebugLibraries>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <UseDebugLibraries>false</UseDebugLibraries>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+    <UseDebugLibraries>false</UseDebugLibraries>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+    <UseDebugLibraries>true</UseDebugLibraries>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings" />
+  <ImportGroup Label="Shared" />
+  <ImportGroup Label="PropertySheets" />
+  <PropertyGroup Label="UserMacros" />
+  <ItemGroup>
+    <ClCompile Include="main.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+  </ItemGroup>
+  <ItemDefinitionGroup />
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets" />
+</Project>

+ 7 - 0
ConsoleApplication1/main.cpp

@@ -0,0 +1,7 @@
+#include <cstdio>
+
+int main()
+{
+    printf("%s 向你问好!\n", "ConsoleApplication1");
+    return 0;
+}

+ 10 - 0
ImageOcr/ImageOcr.csproj

@@ -0,0 +1,10 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>netcoreapp3.1</TargetFramework>
+  </PropertyGroup>
+  <ItemGroup>
+    <PackageReference Include="OpenCvSharp4" Version="4.4.0.20200915" />
+  </ItemGroup>
+</Project>

+ 49 - 0
ImageOcr/Program.cs

@@ -0,0 +1,49 @@
+using OpenCvSharp;
+using System;
+
+namespace ImageOcr
+{
+    class Program
+    {
+        static void Main(string[] args)
+        {
+            Mat img = new Mat();
+            img = Cv2.ImRead("F:/IMG_20200927_150909.jpg");
+            Cv2.ImShow("src", img);
+            Mat grayImage = new Mat();
+            Cv2.CvtColor(img, grayImage, ColorConversionCodes.BGR2GRAY);
+            var Width= grayImage.Width;
+            var Height = grayImage.Height;
+            Mat binaryImage = new Mat();
+            Cv2.AdaptiveThreshold(grayImage, binaryImage,255, AdaptiveThresholdTypes.GaussianC, ThresholdTypes.Binary,35,10);
+            Cv2.ImShow("binaryImage", binaryImage);
+            Mat hierarchy = new Mat();
+            Cv2.FindContours(binaryImage,out Mat[] contours, hierarchy, RetrievalModes.Tree, ContourApproximationModes.ApproxSimple);
+            Cv2.DrawContours(img, contours, 0, new Scalar(0,0,255),1);
+            Cv2.ImShow("imgray", img);
+            foreach (var i in contours) {
+                double arclen = Cv2.ArcLength( i, true);
+                double epsilon = Math.Max(2, arclen * 0.02);
+                Mat approx = new Mat();
+                Cv2.ApproxPolyDP(i, approx, epsilon, true);
+                double area =Cv2.ContourArea(i);
+                Console.WriteLine("面积:" + area);
+                RotatedRect rect = Cv2.MinAreaRect(i);
+                Console.WriteLine("rect:" + rect);
+                Point2f[] re= Cv2.BoxPoints(rect);
+                var w = re[1].X;
+                var h = re[1].Y;
+                var rotion = 0F;
+                if (Math.Min(h, w) == 0)
+                {
+                    rotion = 0;
+                }
+                else {
+                    rotion = Math.Max(h, w) / Math.Min(h, w);
+                }
+                var imageArea = Width * Height;
+                if(rotion<10  && area>imageArea*0.2  && area< Width* Height * 0.99 && approx==4)
+            }
+        }
+    }
+}

+ 92 - 2
OpenCVDemo.sln

@@ -3,24 +3,114 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio Version 16
 VisualStudioVersion = 16.0.30413.136
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenCVDemo", "OpenCVDemo\OpenCVDemo.csproj", "{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenCVDemo", "OpenCVDemo\OpenCVDemo.csproj", "{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenCVTest", "OpenCVTest\OpenCVTest.csproj", "{76B8C618-B391-444A-806F-22DD6B9C923B}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenCVTest", "OpenCVTest\OpenCVTest.csproj", "{76B8C618-B391-444A-806F-22DD6B9C923B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleApplication1", "ConsoleApplication1\ConsoleApplication1.vcxproj", "{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageOcr", "ImageOcr\ImageOcr.csproj", "{682124EA-F744-4593-A293-F0EAB8DFFA60}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
+		Debug|ARM = Debug|ARM
+		Debug|ARM64 = Debug|ARM64
+		Debug|x64 = Debug|x64
+		Debug|x86 = Debug|x86
 		Release|Any CPU = Release|Any CPU
+		Release|ARM = Release|ARM
+		Release|ARM64 = Release|ARM64
+		Release|x64 = Release|x64
+		Release|x86 = Release|x86
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Debug|ARM.ActiveCfg = Debug|Any CPU
+		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Debug|ARM.Build.0 = Debug|Any CPU
+		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Debug|ARM64.Build.0 = Debug|Any CPU
+		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Debug|x64.Build.0 = Debug|Any CPU
+		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Debug|x86.Build.0 = Debug|Any CPU
 		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Release|Any CPU.Build.0 = Release|Any CPU
+		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Release|ARM.ActiveCfg = Release|Any CPU
+		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Release|ARM.Build.0 = Release|Any CPU
+		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Release|ARM64.ActiveCfg = Release|Any CPU
+		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Release|ARM64.Build.0 = Release|Any CPU
+		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Release|x64.ActiveCfg = Release|Any CPU
+		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Release|x64.Build.0 = Release|Any CPU
+		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Release|x86.ActiveCfg = Release|Any CPU
+		{DE3B6D6A-FC3A-4FCB-AE58-1EAFB9838029}.Release|x86.Build.0 = Release|Any CPU
 		{76B8C618-B391-444A-806F-22DD6B9C923B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{76B8C618-B391-444A-806F-22DD6B9C923B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{76B8C618-B391-444A-806F-22DD6B9C923B}.Debug|ARM.ActiveCfg = Debug|Any CPU
+		{76B8C618-B391-444A-806F-22DD6B9C923B}.Debug|ARM.Build.0 = Debug|Any CPU
+		{76B8C618-B391-444A-806F-22DD6B9C923B}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+		{76B8C618-B391-444A-806F-22DD6B9C923B}.Debug|ARM64.Build.0 = Debug|Any CPU
+		{76B8C618-B391-444A-806F-22DD6B9C923B}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{76B8C618-B391-444A-806F-22DD6B9C923B}.Debug|x64.Build.0 = Debug|Any CPU
+		{76B8C618-B391-444A-806F-22DD6B9C923B}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{76B8C618-B391-444A-806F-22DD6B9C923B}.Debug|x86.Build.0 = Debug|Any CPU
 		{76B8C618-B391-444A-806F-22DD6B9C923B}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{76B8C618-B391-444A-806F-22DD6B9C923B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{76B8C618-B391-444A-806F-22DD6B9C923B}.Release|ARM.ActiveCfg = Release|Any CPU
+		{76B8C618-B391-444A-806F-22DD6B9C923B}.Release|ARM.Build.0 = Release|Any CPU
+		{76B8C618-B391-444A-806F-22DD6B9C923B}.Release|ARM64.ActiveCfg = Release|Any CPU
+		{76B8C618-B391-444A-806F-22DD6B9C923B}.Release|ARM64.Build.0 = Release|Any CPU
+		{76B8C618-B391-444A-806F-22DD6B9C923B}.Release|x64.ActiveCfg = Release|Any CPU
+		{76B8C618-B391-444A-806F-22DD6B9C923B}.Release|x64.Build.0 = Release|Any CPU
+		{76B8C618-B391-444A-806F-22DD6B9C923B}.Release|x86.ActiveCfg = Release|Any CPU
+		{76B8C618-B391-444A-806F-22DD6B9C923B}.Release|x86.Build.0 = Release|Any CPU
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Debug|Any CPU.ActiveCfg = Debug|x86
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Debug|ARM.ActiveCfg = Debug|ARM
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Debug|ARM.Build.0 = Debug|ARM
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Debug|ARM.Deploy.0 = Debug|ARM
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Debug|ARM64.ActiveCfg = Debug|ARM64
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Debug|ARM64.Build.0 = Debug|ARM64
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Debug|ARM64.Deploy.0 = Debug|ARM64
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Debug|x64.ActiveCfg = Debug|x64
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Debug|x64.Build.0 = Debug|x64
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Debug|x64.Deploy.0 = Debug|x64
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Debug|x86.ActiveCfg = Debug|x86
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Debug|x86.Build.0 = Debug|x86
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Debug|x86.Deploy.0 = Debug|x86
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Release|Any CPU.ActiveCfg = Release|x86
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Release|ARM.ActiveCfg = Release|ARM
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Release|ARM.Build.0 = Release|ARM
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Release|ARM.Deploy.0 = Release|ARM
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Release|ARM64.ActiveCfg = Release|ARM64
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Release|ARM64.Build.0 = Release|ARM64
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Release|ARM64.Deploy.0 = Release|ARM64
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Release|x64.ActiveCfg = Release|x64
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Release|x64.Build.0 = Release|x64
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Release|x64.Deploy.0 = Release|x64
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Release|x86.ActiveCfg = Release|x86
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Release|x86.Build.0 = Release|x86
+		{8D75CB36-4F7D-4D7E-AB82-AE2723A31752}.Release|x86.Deploy.0 = Release|x86
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Debug|ARM.ActiveCfg = Debug|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Debug|ARM.Build.0 = Debug|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Debug|ARM64.Build.0 = Debug|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Debug|x64.Build.0 = Debug|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Debug|x86.Build.0 = Debug|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Release|Any CPU.Build.0 = Release|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Release|ARM.ActiveCfg = Release|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Release|ARM.Build.0 = Release|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Release|ARM64.ActiveCfg = Release|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Release|ARM64.Build.0 = Release|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Release|x64.ActiveCfg = Release|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Release|x64.Build.0 = Release|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Release|x86.ActiveCfg = Release|Any CPU
+		{682124EA-F744-4593-A293-F0EAB8DFFA60}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 112 - 4
OpenCVTest/Program.cs

@@ -1,15 +1,105 @@
 using OpenCvSharp;
 using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.IO;
 
 namespace OpenCVTest
 {
     class Program
     {
+        /// <summary>
+        /// http://wiki.opencv.org.cn/index.php/Cxcore%E6%95%B0%E7%BB%84%E6%93%8D%E4%BD%9C#CreateImage  教程
+        /// </summary>
+        /// <param name="args"></param>
         static void Main(string[] args)
         {
+            Color FgClr= ColorTranslator.FromHtml("#FFBF53");
+            Color BgClr=ColorTranslator.FromHtml("#0040AC");
+            Bitmap  bm = new System.Drawing.Bitmap(8, 8);
+            bm.SetPixel(0, 0, FgClr);
+            bm.SetPixel(0, 1, BgClr);
+            bm.SetPixel(0, 2, BgClr);
+            bm.SetPixel(0, 3, BgClr);
+            bm.SetPixel(0, 4, FgClr);
+            bm.SetPixel(0, 5, BgClr);
+            bm.SetPixel(0, 6, BgClr);
+            bm.SetPixel(0, 7, BgClr);
+            bm.SetPixel(1, 0, BgClr);
+            bm.SetPixel(1, 1, BgClr);
+            bm.SetPixel(1, 2, BgClr);
+            bm.SetPixel(1, 3, BgClr);
+            bm.SetPixel(1, 4, BgClr);
+            bm.SetPixel(1, 5, BgClr);
+            bm.SetPixel(1, 6, BgClr);
+            bm.SetPixel(1, 7, BgClr);
+            bm.SetPixel(2, 0, BgClr);
+            bm.SetPixel(2, 1, BgClr);
+            bm.SetPixel(2, 2, FgClr);
+            bm.SetPixel(2, 3, BgClr);
+            bm.SetPixel(2, 4, BgClr);
+            bm.SetPixel(2, 5, BgClr);
+            bm.SetPixel(2, 6, FgClr);
+            bm.SetPixel(2, 7, BgClr);
+            bm.SetPixel(3, 0, BgClr);
+            bm.SetPixel(3, 1, BgClr);
+            bm.SetPixel(3, 2, BgClr);
+            bm.SetPixel(3, 3, BgClr);
+            bm.SetPixel(3, 4, BgClr);
+            bm.SetPixel(3, 5, BgClr);
+            bm.SetPixel(3, 6, BgClr);
+            bm.SetPixel(3, 7, BgClr);
+            bm.SetPixel(4, 0, FgClr);
+            bm.SetPixel(4, 1, BgClr);
+            bm.SetPixel(4, 2, BgClr);
+            bm.SetPixel(4, 3, BgClr);
+            bm.SetPixel(4, 4, FgClr);
+            bm.SetPixel(4, 5, BgClr);
+            bm.SetPixel(4, 6, BgClr);
+            bm.SetPixel(4, 7, BgClr);
+            bm.SetPixel(5, 0, BgClr);
+            bm.SetPixel(5, 1, BgClr);
+            bm.SetPixel(5, 2, BgClr);
+            bm.SetPixel(5, 3, BgClr);
+            bm.SetPixel(5, 4, BgClr);
+            bm.SetPixel(5, 5, BgClr);
+            bm.SetPixel(5, 6, BgClr);
+            bm.SetPixel(5, 7, BgClr);
+            bm.SetPixel(6, 0, BgClr);
+            bm.SetPixel(6, 1, BgClr);
+            bm.SetPixel(6, 2, FgClr);
+            bm.SetPixel(6, 3, BgClr);
+            bm.SetPixel(6, 4, BgClr);
+            bm.SetPixel(6, 5, BgClr);
+            bm.SetPixel(6, 6, FgClr);
+            bm.SetPixel(6, 7, BgClr);
+            bm.SetPixel(7, 0, BgClr);
+            bm.SetPixel(7, 1, BgClr);
+            bm.SetPixel(7, 2, BgClr);
+            bm.SetPixel(7, 3, BgClr);
+            bm.SetPixel(7, 4, BgClr);
+            bm.SetPixel(7, 5, BgClr);
+            bm.SetPixel(7, 6, BgClr);
+            bm.SetPixel(7, 7, BgClr);
+            Graphics graphics = Graphics.FromImage(bm);
+            //graphics.Clear(Color.Transparent);
+            //HatchBrush myHatchBrush = new HatchBrush(HatchStyle.Percent10, Color.Blue, Color.Transparent);
+            //graphics.FillRectangle(myHatchBrush, 0, 0,300, 300);
+            graphics.Save();
+            graphics.Dispose();
+            MemoryStream ms = new MemoryStream();
+            bm.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
+            byte[] arr = new byte[ms.Length];
+            ms.Position = 0;
+            ms.Read(arr, 0, (int)ms.Length);
+            ms.Close();
+          var a = "data:image/png;base64," + Convert.ToBase64String(arr);
+            //Graphics 类还有很多绘图方法可以绘制 直线、曲线、圆等等 
+            //image.Save(sIconFileName, System.Drawing.Imaging.ImageFormat.Png);
+
             //源码  https://gitee.com/CrazyIterBin/opencvsharp.git
-            Mat base_img = Cv2.ImRead(@"F:/20191204104138.jpg");
-            get_answer_from_sheet(base_img);
+            //  Mat base_img = Cv2.ImRead(@"F:/20191204104138.jpg");
+            //get_answer_from_sheet(base_img);
         }
         public static void get_answer_from_sheet(Mat base_img)
         {
@@ -25,8 +115,26 @@ namespace OpenCVTest
             Mat img = new Mat();
             Cv2.Add(h, v,img);
             Cv2.ConvertScaleAbs(img,img);
-            Cv2.GaussianBlur(img, img, new Size { Width = 3, Height = 3 }, 0);
-            //Cv2.Threshold(img, img, 120, 255, cv2);
+            Cv2.GaussianBlur(img, img, new OpenCvSharp.Size { Width = 3, Height = 3 }, 0);
+            Cv2.Threshold(img, img, 120, 255, ThresholdTypes.Binary);
+            Cv2.Erode(img, img, InputArray.Create(new int[1, 1]),iterations:1);
+            Cv2.Dilate(img, img, InputArray.Create(new int[1, 1]), iterations: 2);
+            Cv2.Erode(img, img, InputArray.Create(new int[1, 1]), iterations: 1);
+            Cv2.Dilate(img, img, InputArray.Create(new int[1, 1]), iterations:2); 
+        }
+
+        public static void auto_canny(Mat image, double sigma = 0.33) { 
+
+        }
+
+        public static void median(Mat image) {
+            float[] buf = new float[image.Rows* image.Cols];
+            for (int i = 0; i < image.Rows; i++) {
+                for (int j = 0; j < image.Cols; j++)
+                {
+                    buf[i * image.Cols + j] = (float)image.Ptr(i, j);
+                }
+            }
         }
     }
 }

BIN
OpenCVTest/答题卡(主观题).pdf


BIN
OpenCVTest/答题卡(客观题).pdf


BIN
OpenCVTest/答题卡.xlsx


BIN
readme/images/ArchOptions.gif


BIN
readme/images/ChangeRemote.gif


BIN
readme/images/ManageConnections.gif


BIN
readme/images/OutputTypes.gif


BIN
readme/images/debuggerexport.png


BIN
readme/images/firstconnection.png


BIN
readme/images/linker.png


BIN
readme/images/postbuild.png


+ 77 - 0
readme/readme.html

@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset='utf-8'>
+
+    <link rel="stylesheet" type="text/css" href="stylesheet.css" media="screen">
+
+    <title>入门</title>
+  </head>
+
+<body>
+
+    <div class="container">
+        <div id="header">
+            <h1>入门</h1>
+            <h2>适用于 Linux 开发的 Visual C++</h2>
+        </div>
+    
+    <table>
+    <tr>    
+    <div id="main_content">
+        
+        <td>
+        <div id="lpanel">
+            <h1>正在设置用于 Linux 开发的项目</h1>
+
+            <p>使用此工作负荷,可创作适用于 Linux 服务器、桌面和设备的 C++ 代码。可从 VS 中管理与这些计算机的连接。VS 将自动复制和远程生成源,并可使用调试器启动应用程序。我们的项目系统支持以特定体系结构(包括 ARM)为目标。</p>
+            <img src="images\ArchOptions.gif"/>
+            
+            <h1>正在连接到 Linux</h1>
+            <h2>系统必备</h2>
+            <p>现在仅支持在 Linux 目标计算机上远程构建。我们不受特定 Linux 发行版的限制,但确实依赖于某些工具的存在。具体说来,我们需要 openssh-server、g++、gdb 和 gdbserver。请使用你喜爱的包管理器安装它们,例如,在基于 Debian 的系统上,可以使用 sudo apt-get install openssh-server g++ gdb gdbserver</p>
+            
+            <h2>第一个连接</h2>
+            <p>第一次以 Linux 计算机为目标时,系统将提示你输入连接信息。此操作由生成项目触发。</p>
+            <img src="images\firstconnection.png"/>
+                
+            <h2>添加和删除连接</h2>
+            <p>若要添加新连接,请转到“工具”>“选项”并搜索“连接”,连接管理器将显示在“跨平台”下。可从此处添加和删除连接。</p>
+            <img src="images\ManageConnections.gif"/>
+            
+            <p>若要更改项目使用的连接,请转到项目属性常规设置并更新“远程生成计算机”选项。</p>
+            <img src="images\ChangeRemote.gif"/>
+            
+            <h1>项目属性</h1>
+            <p>控制 C++ 编译所需的所有选项都在项目属性页上公开。我们将具体介绍 Linux 的一些工作原理。在常规设置下,你将看到远程根已默认设置为 ~/projects/,我们要将远程项目目录设置为与该位置的项目名称匹配。</p>
+            <img src="images\OutputTypes.gif"/>
+            
+            <p>查看项目的“常规设置”,可以看到输出目录和中间目录的配置情况。此外,还会看到此项目已配置为应用程序,因此可执行文件位于 bin/x64/Debug/ 下,名为 ConsoleApplication1.out。请注意,对于配置类型,我们也支持静态和动态库。</p>
+            
+            <p>在“链接器”>“输入属性”页上添加其他库依赖项。</p>
+            <img src="images\linker.png"/>
+            
+            <p>可将额外的预启动命令传递给调试器,以执行在远程 linux 计算机上启动图形应用等操作。</p>
+            <img src="images\debuggerexport.png"/>
+            
+            <p>还可发送生成后事件以控制远程行为,比如在本例中,导出 gpio pin 以便在不要求可执行文件以超级用户身份运行的情况下使用。</p>
+            <img src="images\postbuild.png"/>
+            
+        </div>
+        </td>
+        <td>
+        <div id="rpanel">
+
+            <h1>资源</h1>
+
+            <p>请查看 <a href="http://aka.ms/vslinux">VC++ for Linux 开发页</a>,我们将持续发布更新并提供更多深入介绍使用方法的详细信息。</p>
+            <h1>给我们提供反馈</h1>
+            <p>使用 Visual Studio 中的发送反馈功能,或通过<a href=" https://developercommunity.visualstudio.com/">开发人员社区</a>与我们联系</p>
+        </div>
+        </td>   
+    </div>
+    </tr>
+    </table>
+    </div>
+</body>
+</html>

+ 119 - 0
readme/stylesheet.css

@@ -0,0 +1,119 @@
+body {
+  margin: 0;
+  padding: 0;
+  border: 0;
+  color: #1E1E1E;
+  font-size: 13px;
+  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
+  line-height: 1.45;
+  word-wrap: break-word;
+}
+
+/* General & 'Reset' Stuff */
+
+
+.container {
+  width: 1100px;
+  margin: 0 auto;
+}
+
+section {
+  display: block;
+  margin: 0;
+}
+
+h1, h2, h3, h4, h5, h6 {
+  margin: 0;
+}
+
+table, tr {
+    width: 1100px;
+    padding: 0px;
+    vertical-align: top;
+  }
+
+/* Header, <header>
+   header   - container
+   h1       - project name
+   h2       - project description
+*/
+
+#header {
+  color: #FFF;
+  background: #68217a;
+  position:relative;
+}
+h1, h2 {
+  font-family: "Segoe UI Light", "Segoe UI", Helvetica, Arial, sans-serif;
+  line-height: 1;
+  margin: 0 18px;;
+  padding: 0;
+}
+#header h1 {
+  font-size: 3.4em;
+  padding-top: 18px;
+  font-weight: normal;
+  margin-left: 15px;
+}
+
+#header h2 {
+  font-size: 1.5em;
+  margin-top: 10px;
+  padding-bottom: 18px;
+  font-weight: normal;
+}
+
+#main_content {
+  width: 100%;
+  display: flex;
+  flex-direction: row;
+}
+
+
+h1, h2, h3, h4, h5, h6 {
+  font-weight: bolder;
+}
+
+#main_content h1 {
+  font-size: 1.8em;
+  margin-top: 34px;
+}
+
+    #main_content h1:first-child {
+        margin-top: 30px;
+    }
+
+#main_content h2 {
+  font-size: 1.8em;
+}
+p, ul {
+    margin: 11px 18px;
+}
+
+#main_content a {
+    color: #06C;
+    text-decoration: none;
+}
+ul {
+        margin-top: 13px;
+    margin-left: 18px;
+    padding-left: 0;
+}
+    ul li {
+        margin-left: 18px;
+        padding-left: 0;
+    }
+#lpanel {
+    width: 870px;
+    float: left;
+}
+#rpanel ul {
+    list-style-type: none;
+}
+    #rpanel ul li {
+        line-height: 1.8em;
+    }
+#rpanel {
+    background: #e7e7e7;
+    width: 230px;
+}