[update] readme & uiaccess

This commit is contained in:
Dubi906w 2024-09-07 21:43:16 +08:00
parent 6b4d1be962
commit 14cae3814c
33 changed files with 1208 additions and 712 deletions

8
.gitignore vendored
View File

@ -2,7 +2,11 @@
/InkCanvasForClass/bin /InkCanvasForClass/bin
/InkCanvasForClassX/obj /InkCanvasForClassX/obj
/InkCanvasForClassX/bin /InkCanvasForClassX/bin
/InkCanvasForClassPPTVsto/obj /InkCanvasForClass.IACoreHelper/obj
/InkCanvasForClassPPTVsto/bin /InkCanvasForClass.IACoreHelper/bin
/InkCanvasForClass.PowerPoint.InteropHelper/obj
/InkCanvasForClass.PowerPoint.InteropHelper/bin
/InkCanvasForClass.PowerPoint.Vsto/obj
/InkCanvasForClass.PowerPoint.Vsto/bin
/.vs /.vs
/.idea /.idea

View File

@ -7,7 +7,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InkCanvasForClassX", "InkCa
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InkCanvasForClass", "InkCanvasForClass\InkCanvasForClass.csproj", "{2474F5B0-6FA7-4D70-8A00-167BBB03264D}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InkCanvasForClass", "InkCanvasForClass\InkCanvasForClass.csproj", "{2474F5B0-6FA7-4D70-8A00-167BBB03264D}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InkCanvasForClassPPTVsto", "InkCanvasForClassPPTVsto\InkCanvasForClassPPTVsto.csproj", "{E494CFFE-D2EC-4BAD-82D9-C92FE29616A7}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InkCanvasForClass.IACoreHelper", "InkCanvasForClass.IACoreHelper\InkCanvasForClass.IACoreHelper.csproj", "{693973B6-69C1-4A37-B329-F366A07BF60A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InkCanvasForClass.PowerPoint.InteropHelper", "InkCanvasForClass.PowerPoint.InteropHelper\InkCanvasForClass.PowerPoint.InteropHelper.csproj", "{2D8A9217-465A-4F57-BD58-CE02450390C4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InkCanvasForClass.PowerPoint.Vsto", "InkCanvasForClass.PowerPoint.Vsto\InkCanvasForClass.PowerPoint.Vsto.csproj", "{E494CFFE-D2EC-4BAD-82D9-C92FE29616A7}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -88,6 +92,66 @@ Global
{2474F5B0-6FA7-4D70-8A00-167BBB03264D}.x86 Debug|x64.Build.0 = x86 Debug|Any CPU {2474F5B0-6FA7-4D70-8A00-167BBB03264D}.x86 Debug|x64.Build.0 = x86 Debug|Any CPU
{2474F5B0-6FA7-4D70-8A00-167BBB03264D}.x86 Debug|x86.ActiveCfg = x86 Debug|Any CPU {2474F5B0-6FA7-4D70-8A00-167BBB03264D}.x86 Debug|x86.ActiveCfg = x86 Debug|Any CPU
{2474F5B0-6FA7-4D70-8A00-167BBB03264D}.x86 Debug|x86.Build.0 = x86 Debug|Any CPU {2474F5B0-6FA7-4D70-8A00-167BBB03264D}.x86 Debug|x86.Build.0 = x86 Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|ARM.ActiveCfg = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|ARM.Build.0 = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|ARM64.Build.0 = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|x64.ActiveCfg = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|x64.Build.0 = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|x86.ActiveCfg = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|x86.Build.0 = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Release|Any CPU.Build.0 = Release|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Release|ARM.ActiveCfg = Release|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Release|ARM.Build.0 = Release|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Release|ARM64.ActiveCfg = Release|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Release|ARM64.Build.0 = Release|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Release|x64.ActiveCfg = Release|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Release|x64.Build.0 = Release|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Release|x86.ActiveCfg = Release|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.Release|x86.Build.0 = Release|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|Any CPU.ActiveCfg = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|Any CPU.Build.0 = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|ARM.ActiveCfg = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|ARM.Build.0 = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|ARM64.ActiveCfg = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|ARM64.Build.0 = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|x64.ActiveCfg = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|x64.Build.0 = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|x86.ActiveCfg = Debug|Any CPU
{693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|x86.Build.0 = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|ARM.ActiveCfg = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|ARM.Build.0 = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|ARM64.Build.0 = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|x64.ActiveCfg = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|x64.Build.0 = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|x86.ActiveCfg = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|x86.Build.0 = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|Any CPU.Build.0 = Release|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|ARM.ActiveCfg = Release|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|ARM.Build.0 = Release|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|ARM64.ActiveCfg = Release|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|ARM64.Build.0 = Release|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|x64.ActiveCfg = Release|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|x64.Build.0 = Release|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|x86.ActiveCfg = Release|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|x86.Build.0 = Release|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|Any CPU.Build.0 = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|ARM.ActiveCfg = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|ARM.Build.0 = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|ARM64.ActiveCfg = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|ARM64.Build.0 = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|x64.ActiveCfg = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|x64.Build.0 = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|x86.ActiveCfg = Debug|Any CPU
{2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|x86.Build.0 = Debug|Any CPU
{E494CFFE-D2EC-4BAD-82D9-C92FE29616A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E494CFFE-D2EC-4BAD-82D9-C92FE29616A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E494CFFE-D2EC-4BAD-82D9-C92FE29616A7}.Debug|Any CPU.Build.0 = Debug|Any CPU {E494CFFE-D2EC-4BAD-82D9-C92FE29616A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E494CFFE-D2EC-4BAD-82D9-C92FE29616A7}.Debug|ARM.ActiveCfg = Debug|Any CPU {E494CFFE-D2EC-4BAD-82D9-C92FE29616A7}.Debug|ARM.ActiveCfg = Debug|Any CPU

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{693973B6-69C1-4A37-B329-F366A07BF60A}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>InkCanvasForClass.IACoreHelper</RootNamespace>
<AssemblyName>InkCanvasForClass.IACoreHelper</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace InkCanvasForClass.IACoreHelper {
internal class Program {
static void Main(string[] args) {
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("InkCanvasForClass.IACoreHelper")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("InkCanvasForClass.IACoreHelper")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("693973b6-69c1-4a37-b329-f366a07bf60a")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,3 @@
# InkCanvasForClass.IACoreHelper
该项目实现了基于 .NET Framework 4.7.2 和 x86 运行环境的墨迹识别库 IACore 的封装

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2D8A9217-465A-4F57-BD58-CE02450390C4}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>InkCanvasForClass.PowerPoint.InteropHelper</RootNamespace>
<AssemblyName>InkCanvasForClass.PowerPoint.InteropHelper</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace InkCanvasForClass.PowerPoint.InteropHelper {
internal class Program {
static void Main(string[] args) {
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("InkCanvasForClass.PowerPoint.InteropHelper")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("InkCanvasForClass.PowerPoint.InteropHelper")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("2d8a9217-465a-4f57-bd58-ce02450390c4")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,31 +1,35 @@
using Hardcodet.Wpf.TaskbarNotification; using Hardcodet.Wpf.TaskbarNotification;
using Ink_Canvas.Helpers; using Ink_Canvas.Helpers;
using iNKORE.UI.WPF.Modern.Controls; using iNKORE.UI.WPF.Modern.Controls;
using Newtonsoft.Json;
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Windows; using System.Windows;
using iNKORE.UI.WPF.Helpers;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using MessageBox = System.Windows.MessageBox;
using Window = System.Windows.Window;
using System.Windows.Shell; using System.Windows.Shell;
using Ookii.Dialogs.Wpf; using Ookii.Dialogs.Wpf;
using System.Diagnostics; using System.Diagnostics;
using Ink_Canvas.Popups;
using Ink_Canvas.Windows; using Ink_Canvas.Windows;
using Lierda.WPFHelper; using Lierda.WPFHelper;
using System.Runtime.InteropServices;
using System.Security.Principal;
using Windows.Data.Xml.Dom;
using Windows.UI.Notifications;
namespace Ink_Canvas {
namespace Ink_Canvas
{
/// <summary> /// <summary>
/// Interaction logic for App.xaml /// Interaction logic for App.xaml
/// </summary> /// </summary>
public partial class App : Application public partial class App : Application {
{
[DllImport("UIAccessDLL_x86.dll", EntryPoint = "PrepareUIAccess", CallingConvention = CallingConvention.Cdecl)]
public static extern Int32 PrepareUIAccessX86();
[DllImport("UIAccessDLL_x64.dll", EntryPoint = "PrepareUIAccess", CallingConvention = CallingConvention.Cdecl)]
public static extern Int32 PrepareUIAccessX64();
System.Threading.Mutex mutex; System.Threading.Mutex mutex;
public static string[] StartArgs = null; public static string[] StartArgs = null;
@ -46,8 +50,16 @@ namespace Ink_Canvas
private TaskbarIcon _taskbar; private TaskbarIcon _taskbar;
private MainWindow mainWin = null; private MainWindow mainWin = null;
void App_Startup(object sender, StartupEventArgs e) void App_Startup(object sender, StartupEventArgs e) {
{
var identity = WindowsIdentity.GetCurrent();
var principal = new WindowsPrincipal(identity);
if (Environment.Is64BitProcess && principal.IsInRole(WindowsBuiltInRole.Administrator)) {
Trace.WriteLine(PrepareUIAccessX64());
} else if (principal.IsInRole(WindowsBuiltInRole.Administrator)) {
PrepareUIAccessX86();
}
RootPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; RootPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
LogHelper.NewLog(string.Format("Ink Canvas Starting (Version: {0})", Assembly.GetExecutingAssembly().GetName().Version.ToString())); LogHelper.NewLog(string.Format("Ink Canvas Starting (Version: {0})", Assembly.GetExecutingAssembly().GetName().Version.ToString()));
@ -101,6 +113,8 @@ namespace Ink_Canvas
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error);
} }
mainWin = new MainWindow(); mainWin = new MainWindow();
if (isUsingWindowChrome && DwmCompositionHelper.DwmIsCompositionEnabled()) { if (isUsingWindowChrome && DwmCompositionHelper.DwmIsCompositionEnabled()) {

File diff suppressed because it is too large Load Diff

View File

@ -38,14 +38,10 @@ namespace Ink_Canvas {
if (e.Property.Name == nameof(Topmost) && isLoaded) { if (e.Property.Name == nameof(Topmost) && isLoaded) {
if (Topmost && Settings.Advanced.IsEnableForceFullScreen) { if (Topmost && Settings.Advanced.IsEnableForceFullScreen) {
Trace.WriteLine("Topmost true"); Trace.WriteLine("Topmost true");
SetWindowPos(new WindowInteropHelper(this).Handle, new IntPtr(-1), 0, 0, SetWindowPos(new WindowInteropHelper(this).Handle, new IntPtr(-1), 0, 0, 0, 0, 0x0002|0x0040|0x0001);
System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width,
System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height, 0x0040);
} else if (!Topmost && Settings.Advanced.IsEnableForceFullScreen) { } else if (!Topmost && Settings.Advanced.IsEnableForceFullScreen) {
Trace.WriteLine("Topmost false"); Trace.WriteLine("Topmost false");
SetWindowPos(new WindowInteropHelper(this).Handle, new IntPtr(-2), 0, 0, SetWindowPos(new WindowInteropHelper(this).Handle, new IntPtr(-2), 0, 0, 0, 0, 0x0002|0x0040|0x0001);
System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width,
System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height, 0x0040);
} }
} }
} }
@ -232,7 +228,9 @@ namespace Ink_Canvas {
isLoaded = true; isLoaded = true;
FloatingToolBarV2 = new FloatingToolBarV2(); FloatingToolBarV2 = new FloatingToolBarV2();
FloatingToolBarV2.Topmost = false;
FloatingToolBarV2.Show(); FloatingToolBarV2.Show();
FloatingToolBarV2.Owner = this;
BlackBoardLeftSidePageListView.ItemsSource = blackBoardSidePageListViewObservableCollection; BlackBoardLeftSidePageListView.ItemsSource = blackBoardSidePageListViewObservableCollection;
BlackBoardRightSidePageListView.ItemsSource = blackBoardSidePageListViewObservableCollection; BlackBoardRightSidePageListView.ItemsSource = blackBoardSidePageListViewObservableCollection;
@ -276,6 +274,8 @@ namespace Ink_Canvas {
}); });
UpdateIndexInfoDisplay(); UpdateIndexInfoDisplay();
SetWindowPos(new WindowInteropHelper(this).Handle, new IntPtr(-1), 0, 0, 0, 0, 0x0002|0x0040|0x0001);
} }
private void SystemEventsOnDisplaySettingsChanged(object sender, EventArgs e) { private void SystemEventsOnDisplaySettingsChanged(object sender, EventArgs e) {

View File

@ -92,7 +92,7 @@ namespace Ink_Canvas {
RunAsAdminButton.Visibility = Visibility.Collapsed; RunAsAdminButton.Visibility = Visibility.Collapsed;
RunAsUserButton.Visibility = Visibility.Visible; RunAsUserButton.Visibility = Visibility.Visible;
RegistryKey localKey; RegistryKey localKey;
if(Environment.Is64BitOperatingSystem) if (Environment.Is64BitOperatingSystem)
localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64); localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
else else
localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32); localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32);

View File

@ -128,6 +128,15 @@
</Popup> </Popup>
</Grid> </Grid>
<!--这一部分是用于展示工具栏的对齐和贴边提示的Popup-->
<Grid Name="PlacementFeedbackPopups">
<Popup Name="PlacementFeedbackPopup" Placement="Absolute" StaysOpen="True" AllowsTransparency="True" IsOpen="False">
<Border Background="#883b82f6" IsHitTestVisible="False" Name="PlaceFeedbackBorder">
<TextBlock Name="PlacementFeedbackTipText" FontSize="16" FontWeight="Bold" Foreground="#dbeafe" Margin="6"/>
</Border>
</Popup>
</Grid>
<Grid Name="ToolbarV2" RenderTransformOrigin=".5,.5"> <Grid Name="ToolbarV2" RenderTransformOrigin=".5,.5">
<Grid Name="ToolBarV2Grid" HorizontalAlignment="Left" Margin="24" Height="48"> <Grid Name="ToolBarV2Grid" HorizontalAlignment="Left" Margin="24" Height="48">
<DockPanel Name="FallbackBackgroundLayer"> <DockPanel Name="FallbackBackgroundLayer">

View File

@ -741,6 +741,8 @@ namespace Ink_Canvas
_mouseDownButton = null; _mouseDownButton = null;
} }
#region icc按钮
public Point prevPoint = new Point(0,0); public Point prevPoint = new Point(0,0);
public bool isInMovingMode = false; public bool isInMovingMode = false;
public double winLeft = 0; public double winLeft = 0;
@ -779,58 +781,126 @@ namespace Ink_Canvas
ToolbarV2.RenderTransform = null; ToolbarV2.RenderTransform = null;
ToolBarV2Grid.RenderTransform = null; ToolBarV2Grid.RenderTransform = null;
HeadIconImage.RenderTransform = null; HeadIconImage.RenderTransform = null;
UpdateToolbarPlacementFeedback();
Top = Math.Max(Math.Min(mp.Y * ScalingFactor - prevPoint.Y - 24, Top = Math.Max(Math.Min(mp.Y * ScalingFactor - prevPoint.Y - 24,
System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight +24),-24); System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight +24),-24);
Left = Math.Max(Math.Min(mp.X * ScalingFactor - prevPoint.X - 24, Left = Math.Max(Math.Min(mp.X * ScalingFactor - prevPoint.X - 24,
System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth +24),-24); System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth +24),-24);
} else { } else {
double tbMovingX = deltaX/3, tbMovingY = deltaY/3; double tbMovingX = deltaX/3, tbMovingY = deltaY/3;
if (_snapTypeTemp == ToolBarSnapType.LeftSide) { tbMovingX = (new int[] { 1, 3, 6 }).Contains((int)_snapTypeTemp)?Math.Max(deltaX / 3, 0):tbMovingX;
tbMovingX = Math.Max(deltaX / 3, 0); tbMovingX = (new int[] { 2, 4, 5 }).Contains((int)_snapTypeTemp)?Math.Min(deltaX / 3, 0):tbMovingX;
ToolBarV2Grid.RenderTransformOrigin = new Point(0, 0.5); tbMovingY = (new int[] { 1, 2, 8 }).Contains((int)_snapTypeTemp)?Math.Max(deltaY / 3, 0):tbMovingY;
ToolBarV2Grid.RenderTransform = new ScaleTransform(1 + tbMovingX /350, 1); tbMovingY = (new int[] { 3, 4, 7 }).Contains((int)_snapTypeTemp)?Math.Min(deltaY / 3, 0):tbMovingY;
} else if (_snapTypeTemp == ToolBarSnapType.RightSide) { ToolBarV2Grid.RenderTransformOrigin = new Point(
tbMovingX = Math.Min(deltaX / 3, 0); (new int[] { 1, 3, 6 }).Contains((int)_snapTypeTemp) ? 0 :
ToolBarV2Grid.RenderTransformOrigin = new Point(1, 0.5); (new int[] { 7, 8 }).Contains((int)_snapTypeTemp) ? 0.5 : 1,
ToolBarV2Grid.RenderTransform = new ScaleTransform(1 - tbMovingX /350, 1); (new int[] { 1, 2, 8 }).Contains((int)_snapTypeTemp) ? 0 :
} else if (_snapTypeTemp == ToolBarSnapType.TopSide) { (new int[] { 5, 6 }).Contains((int)_snapTypeTemp) ? 0.5 : 1
tbMovingY = Math.Max(deltaY / 3, 0); );
ToolBarV2Grid.RenderTransformOrigin = new Point(0.5, 0); ToolBarV2Grid.RenderTransform = new ScaleTransform(
ToolBarV2Grid.RenderTransform = new ScaleTransform(1, 1 + tbMovingY /120); 1 + (tbMovingX /350)*((new int[] { 1, 3, 6 }).Contains((int)_snapTypeTemp)?1:(new int[] { 2, 4, 5 }).Contains((int)_snapTypeTemp)?-1:0),
} else if (_snapTypeTemp == ToolBarSnapType.BottomSide) { 1 + (tbMovingY /120)*((new int[] { 1, 2, 8 }).Contains((int)_snapTypeTemp)?1:(new int[] { 3, 4, 7 }).Contains((int)_snapTypeTemp)?-1:0));
tbMovingY = Math.Min(deltaY / 3, 0);
ToolBarV2Grid.RenderTransformOrigin = new Point(0.5, 1);
ToolBarV2Grid.RenderTransform = new ScaleTransform(1, 1 - tbMovingY /120);
} else if (_snapTypeTemp == ToolBarSnapType.LeftTopCorner) {
tbMovingX = Math.Max(deltaX / 3, 0);
tbMovingY = Math.Max(deltaY / 3, 0);
ToolBarV2Grid.RenderTransformOrigin = new Point(0, 0);
ToolBarV2Grid.RenderTransform = new ScaleTransform(1 + tbMovingX /350, 1 + tbMovingY /120);
} else if (_snapTypeTemp == ToolBarSnapType.LeftBottomCorner) {
tbMovingX = Math.Max(deltaX / 3, 0);
tbMovingY = Math.Min(deltaY / 3, 0);
ToolBarV2Grid.RenderTransformOrigin = new Point(0, 1);
ToolBarV2Grid.RenderTransform = new ScaleTransform(1 + tbMovingX /350, 1 - tbMovingY /120);
} else if (_snapTypeTemp == ToolBarSnapType.RightTopCorner) {
tbMovingX = Math.Min(deltaX / 3, 0);
tbMovingY = Math.Max(deltaY / 3, 0);
ToolBarV2Grid.RenderTransformOrigin = new Point(1, 0);
ToolBarV2Grid.RenderTransform = new ScaleTransform(1 - tbMovingX /350, 1 + tbMovingY /120);
} else if (_snapTypeTemp == ToolBarSnapType.RightBottomCorner) {
tbMovingX = Math.Min(deltaX / 3, 0);
tbMovingY = Math.Min(deltaY / 3, 0);
ToolBarV2Grid.RenderTransformOrigin = new Point(1, 1);
ToolBarV2Grid.RenderTransform = new ScaleTransform(1 - tbMovingX /350, 1 - tbMovingY /120);
}
ToolbarV2.RenderTransform = new TranslateTransform(tbMovingX, tbMovingY); ToolbarV2.RenderTransform = new TranslateTransform(tbMovingX, tbMovingY);
HeadIconImage.RenderTransform = new TranslateTransform(tbMovingX / 2, tbMovingY / 2); HeadIconImage.RenderTransform = new TranslateTransform(tbMovingX / 2, tbMovingY / 2);
} }
} }
#endregion
private CornerRadius _ltCornerRadius = new CornerRadius(0, 0, 4, 0);
private CornerRadius _lbCornerRadius = new CornerRadius(0, 4, 0, 0);
private CornerRadius _rtCornerRadius = new CornerRadius(0, 0, 0, 4);
private CornerRadius _rbCornerRadius = new CornerRadius(4, 0, 0, 0);
private CornerRadius _tsCornerRadius = new CornerRadius(0, 0, 4, 4);
private CornerRadius _bsCornerRadius = new CornerRadius(4, 4, 0, 0);
private void UpdateToolbarPlacementFeedback() {
var snapT = SnapType;
var xSideCenter = (System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth) / 2;
var xDeltaCenter = xSideCenter - Left;
PlaceFeedbackBorder.Width = ActualWidth - 16;
PlaceFeedbackBorder.Height = ActualHeight - 16;
PlacementFeedbackPopup.IsOpen = true;
if (Math.Abs(24 + Top) <= 24 && Math.Abs(24 + Left) <= 24) {
PlacementFeedbackPopup.VerticalOffset = 0;
PlacementFeedbackPopup.HorizontalOffset = 0;
PlaceFeedbackBorder.CornerRadius = _ltCornerRadius;
PlacementFeedbackTipText.VerticalAlignment = VerticalAlignment.Bottom;
PlacementFeedbackTipText.HorizontalAlignment = HorizontalAlignment.Left;
PlacementFeedbackTipText.Text = "左上角";
} else if (Math.Abs(24 + Left) <= 24 && 24 - (Top + ActualHeight - System.Windows.SystemParameters.PrimaryScreenHeight) <= 24) {
PlacementFeedbackPopup.VerticalOffset = System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight + 16;
PlacementFeedbackPopup.HorizontalOffset = 0;
PlaceFeedbackBorder.CornerRadius = _lbCornerRadius;
PlacementFeedbackTipText.VerticalAlignment = VerticalAlignment.Top;
PlacementFeedbackTipText.HorizontalAlignment = HorizontalAlignment.Left;
PlacementFeedbackTipText.Text = "左下角";
} else if (24 - (Left + ActualWidth - System.Windows.SystemParameters.PrimaryScreenWidth) <= 24 && Math.Abs(24 + Top) <= 24) {
PlacementFeedbackPopup.VerticalOffset = 0;
PlacementFeedbackPopup.HorizontalOffset = System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 16;
PlaceFeedbackBorder.CornerRadius = _rtCornerRadius;
PlacementFeedbackTipText.VerticalAlignment = VerticalAlignment.Bottom;
PlacementFeedbackTipText.HorizontalAlignment = HorizontalAlignment.Right;
PlacementFeedbackTipText.Text = "右上角";
} else if (24 - (Left + ActualWidth - System.Windows.SystemParameters.PrimaryScreenWidth) <= 24 &&
24 - (Top + ActualHeight - System.Windows.SystemParameters.PrimaryScreenHeight) <= 24) {
PlacementFeedbackPopup.VerticalOffset = System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight + 16;
PlacementFeedbackPopup.HorizontalOffset = System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 16;
PlaceFeedbackBorder.CornerRadius = _rbCornerRadius;
PlacementFeedbackTipText.VerticalAlignment = VerticalAlignment.Top;
PlacementFeedbackTipText.HorizontalAlignment = HorizontalAlignment.Right;
PlacementFeedbackTipText.Text = "右下角";
} else if (snapT == ToolBarSnapType.TopSide && Math.Abs(xDeltaCenter)<=50) {
PlacementFeedbackPopup.VerticalOffset = 0;
PlacementFeedbackPopup.HorizontalOffset =
(System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 16) / 2;
PlaceFeedbackBorder.CornerRadius = _tsCornerRadius;
PlacementFeedbackTipText.VerticalAlignment = VerticalAlignment.Bottom;
PlacementFeedbackTipText.HorizontalAlignment = HorizontalAlignment.Center;
PlacementFeedbackTipText.Text = "顶部居中";
} else if (snapT == ToolBarSnapType.BottomSide && Math.Abs(xDeltaCenter)<=90) {
PlacementFeedbackPopup.VerticalOffset = System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight + 16;
PlacementFeedbackPopup.HorizontalOffset =
(System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 16) / 2;
PlaceFeedbackBorder.CornerRadius = _bsCornerRadius;
PlacementFeedbackTipText.VerticalAlignment = VerticalAlignment.Top;
PlacementFeedbackTipText.HorizontalAlignment = HorizontalAlignment.Center;
PlacementFeedbackTipText.Text = "底部居中";
} else {
PlacementFeedbackPopup.IsOpen = false;
}
}
public FloatingBarItem SelectedItem { public FloatingBarItem SelectedItem {
get => ToolbarItems.Single(item => item.Selected); get => ToolbarItems.Single(item => item.Selected);
} }
private void UseNearSnap() {
if (Math.Abs(24 + Top) <= 24 && Math.Abs(24 + Left) <= 24) {
Top = -24;
Left = -24;
} else if (
24 - (Left + ActualWidth - System.Windows.SystemParameters.PrimaryScreenWidth) <= 24 &&
Math.Abs(24 + Top) <= 24
) {
Top = -24;
Left = System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 24;
} else if (
Math.Abs(24 + Left) <= 24 &&
24 - (Top + ActualHeight - System.Windows.SystemParameters.PrimaryScreenHeight) <= 24
) {
Top = System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight + 24;
Left = -24;
} else if (
24 - (Left + ActualWidth - System.Windows.SystemParameters.PrimaryScreenWidth) <= 24 &&
24 - (Top + ActualHeight - System.Windows.SystemParameters.PrimaryScreenHeight) <= 24
) {
Top = System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight + 24;
Left = System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 24;
}
}
private void HeadIconButton_MouseUp(object sender, MouseButtonEventArgs e) { private void HeadIconButton_MouseUp(object sender, MouseButtonEventArgs e) {
if (_isMouseDownHeadIcon == false) return; if (_isMouseDownHeadIcon == false) return;
_isMouseDownHeadIcon = false; _isMouseDownHeadIcon = false;
@ -840,10 +910,12 @@ namespace Ink_Canvas
ToolbarV2.RenderTransform = null; ToolbarV2.RenderTransform = null;
ToolBarV2Grid.RenderTransform = null; ToolBarV2Grid.RenderTransform = null;
HeadIconImage.RenderTransform = null; HeadIconImage.RenderTransform = null;
PlacementFeedbackPopup.IsOpen = false;
UseNearSnap();
if (!isInMovingMode) { if (!isInMovingMode) {
var mp = System.Windows.Forms.Control.MousePosition; var mp = System.Windows.Forms.Control.MousePosition;
var mpLogical = new Point(mp.X * ScalingFactor, mp.Y * ScalingFactor); var mpLogical = new Point(mp.X * ScalingFactor, mp.Y * ScalingFactor);
if (Math.Abs(mpLogical.X - prevPoint.X - winLeft - 24) < 4 || Math.Abs(mpLogical.Y - prevPoint.Y - winTop - 24) < 4) { if (Math.Abs(mpLogical.X - prevPoint.X - winLeft - 24) < 2.5 || Math.Abs(mpLogical.Y - prevPoint.Y - winTop - 24) < 2.5) {
if (ToolBarNowVariantMode == 3) { if (ToolBarNowVariantMode == 3) {
if (SelectedItem.ToolType != MainWindow.ICCToolsEnum.CursorMode) if (SelectedItem.ToolType != MainWindow.ICCToolsEnum.CursorMode)
UpdateToolBarVariant(0); UpdateToolBarVariant(0);

Binary file not shown.

Binary file not shown.

View File

@ -555,7 +555,7 @@
</Grid> </Grid>
</Border> </Border>
<!--AboutPanel--> <!--AboutPanel-->
<Grid Margin="250,48,0,0" Visibility="Visible" Name="AboutPane"> <Grid Margin="250,48,0,0" Visibility="Collapsed" Name="AboutPane">
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="AboutScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2"> <ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="AboutScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2">
<StackPanel Margin="60,12,60,24"> <StackPanel Margin="60,12,60,24">
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8"> <Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
@ -1314,7 +1314,7 @@
</ScrollViewer> </ScrollViewer>
</Grid> </Grid>
<!--StartupPanel--> <!--StartupPanel-->
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="StartupPane"> <Grid Margin="250,48,0,0" Visibility="Visible" Name="StartupPane">
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="StartupScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2"> <ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="StartupScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2">
<StackPanel Orientation="Vertical"> <StackPanel Orientation="Vertical">
<Border Height="44" Background="#d7e5f6"> <Border Height="44" Background="#d7e5f6">
@ -1404,6 +1404,34 @@
</Border> </Border>
</Grid> </Grid>
<Border Height="1" Background="#ebebeb"/> <Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="总是以管理员身份启动" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="如果以普通用户身份启动则自动重启为管理员权限" HorizontalAlignment="Left"/>
</StackPanel>
<Border Width="48" Height="25" Background="#3584e4" VerticalAlignment="Center" HorizontalAlignment="Right" CornerRadius="12" Margin="0,0,15,0" Padding="3,0">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"></DropShadowEffect>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="使用基于UIAccess和输入线程抢夺强制置顶 ICC" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="非管理员使用输入线程抢夺和置顶守护,管理员使用 UIAccess" HorizontalAlignment="Left"/>
</StackPanel>
<Border Width="48" Height="25" Background="#3584e4" VerticalAlignment="Center" HorizontalAlignment="Right" CornerRadius="12" Margin="0,0,15,0" Padding="3,0">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"></DropShadowEffect>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54"> <Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left"> <StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="总是允许多开实例" HorizontalAlignment="Left"/> <TextBlock Foreground="#2e3436" FontSize="14.5" Text="总是允许多开实例" HorizontalAlignment="Left"/>

124
README.md
View File

@ -6,11 +6,14 @@
Elegant by Default. Based on `ChangSakura/InkCanvas` . Elegant by Default. Based on `ChangSakura/InkCanvas` .
**这将会是最后一次基于InkCanvas控件的倔强** 一款开源易用的电子教鞭软件,专为课堂教学场景优化设计
**这将会是最后一次基于 `InkCanvas` 控件的倔强**
[![UPSTREAM](https://img.shields.io/badge/UpStream-InkCanvas%2FInk--Canvas--Artistry-purple.svg "LICENSE")](https://github.com/InkCanvas/Ink-Canvas-Artistry) [![UPSTREAM](https://img.shields.io/badge/UpStream-InkCanvas%2FInk--Canvas--Artistry-purple.svg "LICENSE")](https://github.com/InkCanvas/Ink-Canvas-Artistry)
![Gitea Last Commit](https://img.shields.io/gitea/last-commit/kriastans/InkCanvasForClass?gitea_url=https%3A%2F%2Fgitea.bliemhax.com%2F) ![Gitea Last Commit](https://img.shields.io/gitea/last-commit/kriastans/InkCanvasForClass?gitea_url=https%3A%2F%2Fgitea.bliemhax.com%2F)
[![LICENSE](https://img.shields.io/badge/License-GPL--3.0-red.svg "LICENSE")](https://gitea.bliemhax.com/kriastans/InkCanvasForClass/src/branch/master/LICENSE) [![LICENSE](https://img.shields.io/badge/License-GPL--3.0-red.svg "LICENSE")](https://gitea.bliemhax.com/kriastans/InkCanvasForClass/src/branch/master/LICENSE)
<br/>
[![交流群](https://img.shields.io/badge/-%E4%BA%A4%E6%B5%81%E7%BE%A4%20825759306-blue?style=flat&logo=TencentQQ)]() [![交流群](https://img.shields.io/badge/-%E4%BA%A4%E6%B5%81%E7%BE%A4%20825759306-blue?style=flat&logo=TencentQQ)]()
[![Telegram](https://img.shields.io/badge/-Telegram%20@InkCanvasForClass-blue?style=flat&logo=Telegram)](https://t.me/InkCanvasForClass) [![Telegram](https://img.shields.io/badge/-Telegram%20@InkCanvasForClass-blue?style=flat&logo=Telegram)](https://t.me/InkCanvasForClass)
@ -28,7 +31,8 @@ Elegant by Default. Based on `ChangSakura/InkCanvas` .
--- ---
- 佛系更新,仅供个人使用,禁止用于商业用途<br/> - 佛系更新,仅供个人使用,禁止用于商业用途<br/>
- 如有需求请自行修改项目,欢迎您的 Pull Request 和 Issue 提出 <br/> - 开学后更新比较缓慢,请不要催更!<br/>
- 如有需求请自行修改项目,同时也欢迎您的 Pull Request 和 Issue 提出 <br/>
- **基于 [https://github.com/InkCanvas/Ink-Canvas-Artistry](https://github.com/InkCanvas/Ink-Canvas-Artistry) 开发** - **基于 [https://github.com/InkCanvas/Ink-Canvas-Artistry](https://github.com/InkCanvas/Ink-Canvas-Artistry) 开发**
> [!important] > [!important]
@ -45,11 +49,11 @@ Elegant by Default. Based on `ChangSakura/InkCanvas` .
InkCanvasForClass 通过为教学环境下班班通设备的使用做出优化,让教学效率大幅度提升: InkCanvasForClass 通过为教学环境下班班通设备的使用做出优化,让教学效率大幅度提升:
1. 使用**屏幕批注**功能快速在任何地方书写标记 1. 使用 **`屏幕批注`** 功能快速在任何地方书写标记
2. 使用**快捷白板**迅速开始上课,提升课堂效率 2. 使用 **`快捷白板`** 迅速开始上课,提升课堂效率
3. 使用**形状识别**自动纠正手绘形状,提升各教学场景下的作图效率 3. 使用 **`形状识别`** 自动纠正手绘形状,提升各教学场景下的作图效率
4. 使用**形状绘制**进行精确绘图,方便易上手的操作提升了教学作图效率 4. 使用 **`形状绘制`** 进行精确绘图,方便易上手的操作提升了教学作图效率
5. 使用**随机点名**功能可以活跃课堂气氛,提升学生主动性...... 5. 使用 **`随机点名`** 功能可以活跃课堂气氛,提升学生主动性......
## 功能 ## 功能
@ -59,31 +63,33 @@ InkCanvasForClass 通过为教学环境下班班通设备的使用做出优化
- [X] PPT 模式下的每页批注 - [X] PPT 模式下的每页批注
### ICC 的优化和改进 ### ICC 的优化和改进
- [ ] 浮动工具栏 UI 改进(正在填屎坑) - 浮动工具栏 UI 改进(正在填屎坑)
- [ ] 白板模式 UI 改进(还有背景色和稿纸模式) - 白板模式 UI 改进(还有背景色和稿纸模式)
- [ ] **鼠标手势**,可以让画布移动缩放,甚至是旋转,都变得更加轻松(正在开发) - **鼠标手势**,可以让画布移动缩放,甚至是旋转,都变得更加轻松(正在开发)
- [ ] **全新的设置 UI**,正在逐步清理原项目的屎山 - **全新的设置 UI**,正在逐步清理原项目的屎山
- [ ] **强制置顶**,保证 ICC 永远显示在所有软件的最顶层 - **强制置顶**,基于 UIAccess + 输入线程抢夺的方法,保证 ICC 永远显示在所有软件的最顶层
- [ ] **分辨率和DPI变化监听**,保证 ICC 界面正常显示 - **分辨率和DPI变化监听**,保证 ICC 界面正常显示
- [ ] **高性能透明**,绘制使用多线程 UI + WindowChrome摆脱低性能体验 - **高性能透明**,绘制使用多线程 UI + WindowChrome摆脱低性能体验
- [ ] **画面冻结**,使当前画面定格 - **画面冻结**,使当前画面定格
- [ ] **重写形状绘制**,让绘图体验更舒适方便,还会支持函数绘制和物理图绘制 - **重写形状绘制**,让绘图体验更舒适方便,还会支持函数绘制和物理图绘制
- [ ] **PPT COM+VSTO双接口融合**,缓解 Office 和 WPS 共存导致的 COM 接口被占用的问题 - **PPT COM+VSTO双接口融合**,缓解 Office 和 WPS 共存导致的 COM 接口被占用的问题
- [ ] **PPT 系统优化**,高效 PPT 放映状态检测,不丢页不跳页 - **PPT 系统优化**,高效 PPT 放映状态检测,不丢页不跳页
- [ ] **禁用边缘手势**,禁用烦人的 Windows10/11 的边缘触摸手势 - **禁用边缘手势**,禁用烦人的 Windows10/11 的边缘触摸手势
- [ ] **点名器优化**,将会支持历史记录和多名单抽选,同时支持特殊配置 - **点名器优化**,将会支持历史记录和多名单抽选,同时支持特殊配置
- [ ] **内置小工具**,内置计算器,英汉词典,倒计时,秒表,放大镜,截图等实用小工具 - **内置小工具**,内置计算器,英汉词典,倒计时,秒表,放大镜,截图等实用小工具
- [ ] **QuickPanel**,方便快捷的从 ICC 打开所有应用和调整系统设置 - **QuickPanel**,方便快捷的从 ICC 打开所有应用和调整系统设置
- [ ] **情境化配置**,每位老师都有专属的配置文件 - **情境化配置**,每位老师都有专属的配置文件
- [ ] **插件和脚本系统**,支持使用 dotNet Framework 开发原生扩展或使用 Javascript 开发脚本来实现自动化操作或其他扩充功能 - **插件和脚本系统**,支持使用 dotNet Framework 开发原生扩展或使用 Javascript 开发脚本来实现自动化操作或其他扩充功能
- [ ] **形状识别**,基于微软清朝老库的手绘形状自动识别,并提供形状绘制纠正功能 - **形状识别**,基于微软清朝老库的手绘形状自动识别,并提供形状绘制纠正功能
- [ ] **板书库**,高效管理所有板书,课程自动分类,提供云端同步 - **板书库**,高效管理所有板书,课程自动分类,提供云端同步
- [ ] **自动收纳**,检测到教学软件自动开启时会自动隐藏 ICC 界面到屏幕侧边 - **自动收纳**,检测到教学软件自动开启时会自动隐藏 ICC 界面到屏幕侧边
- [ ] **自动查杀**,检测到指定软件可以让 ICC 大打出手直接查杀并自动使用 ICC 进行替代 - **自动查杀**,检测到指定软件可以让 ICC 大打出手直接查杀并自动使用 ICC 进行替代
- [ ] **桌面悬浮窗屏蔽**,隐藏画板悬浮窗,还您一个干净的电脑桌面 - **桌面悬浮窗屏蔽**,隐藏画板悬浮窗,还您一个干净的电脑桌面
还有其他没有列出... 还有其他没有列出...
_注以上功能不能保证全部都出现在正式版中..._
## FAQ ## FAQ
### 壹 - ICC对PPT的相容性如何呢 ### 壹 - ICC对PPT的相容性如何呢
@ -105,22 +111,72 @@ ICC 可以支持 WPS但目前无法同时支持 MSOffice 和 WPS。若要启
## 特别鸣谢 ## 特别鸣谢
🍰 **感谢下列同学对本项目的支持因为有了你们ICC 才能继续发展下去:** 🍰 **感谢下列同学对本项目的支持因为有了你们ICC 才能继续发展下去:**
<img src="./InkCanvasForClass/Resources/contributors.png" width=328> <img src="./InkCanvasForClass/Resources/contributors.png" width=328>
🍰 **ICC 使用了下面的开源代码库:**
1. [**`Hardcodet.NotifyIcon.Wpf`**](https://github.com/hardcodet/wpf-notifyicon) <br/> _An implementation of a NotifyIcon (aka system tray icon or taskbar icon) for the WPF platform._
2. [**`JetBrains.Annotations`**](https://github.com/JetBrains/JetBrains.Annotations) <br/> _JetBrains.Annotations help reduce false positive warnings, explicitly declare purity and nullability in your code, deal with implicit usages of members, support special semantics of APIs in ASP.NET and XAML frameworks and otherwise increase accuracy of JetBrains Rider and ReSharper code inspections._
3. [**`Newtonsoft.Json`**](https://github.com/JamesNK/Newtonsoft.Json) <br/> _Popular high-performance JSON framework for .NET_
4. [**`NHotkey`**](https://github.com/thomaslevesque/NHotkey) <br/> _Easily handle shortcut keys even when your WPF or WinForms app doesn't have focus. Declare hotkeys in XAML with the familiar `KeyBinding` syntax._
5. [**`Ookii.Dialogs.Wpf`**](https://github.com/ookii-dialogs/ookii-dialogs-wpf) <br/> _A class library for WPF applications providing several common dialogs. Included are classes for task dialogs, credential dialog, progress dialog, and common file dialogs._
6. [**`OSVersionExt`**](https://github.com/pruggitorg/detect-windows-version) <br/> _Allows you to determine the correct Windows version, since System.Environment.OSVersion.Version in .NET Framework and .NET Core until version 4.8 respectively 3.1 returns wrong results on Windows 10. It works starting with Windows 2000 and also on Windows 11/Windows 10/Server 2022/Server 2019/Server 2016 right away._
7. [**`PixiEditor.ColorPicker`**](https://github.com/PixiEditor/ColorPicker) <br/> _A collection of various WPF controls used to select colors. Supports .NET Framework 4.5.1+, .NET Core 3.1+, .NET 5 - 7._
8. [**`Vanara.PInvoke`**](https://github.com/dahall/Vanara) <br/> _This project contains various .NET assemblies that contain P/Invoke functions, interfaces, enums and structures from Windows libraries._
🍰 **ICC 被下列开源项目推荐:**
1. [kriastans/Awesome-Iwb](https://github.com/kriastans/Awesome-Iwb)
2. [Jursin/Awesome-Class-Softwares](https://github.com/Jursin/Awesome-Class-Softwares)
🍰 **ICC 小量的使用了由 iNKORE Studios 开发的控件库:[`iNKORE.UI.WPF.Modern`](https://github.com/iNKORE-NET/UI.WPF.Modern/)**
<br/>_Modern (Fluent 2) styles and controls for your WPF applications._
![alt text](https://github.com/iNKORE-NET/UI.WPF.Modern/raw/main/assets/images/banners/UI.WPF.Modern_Main_1280w.png?raw=true)
<a href="https://github.com/iNKORE-NET/UI.WPF.Modern/network/members"><img src="https://img.shields.io/github/forks/iNKORE-NET/UI.WPF.Modern?style=social" alt="Forks"></a>
<a href="https://github.com/iNKORE-NET/UI.WPF.Modern/stargazers"><img src="https://img.shields.io/github/stars/iNKORE-NET/UI.WPF.Modern?style=social" alt="Stars"></a>
<a href="https://github.com/iNKORE-NET/UI.WPF.Modern/watchers"><img src="https://img.shields.io/github/watchers/iNKORE-NET/UI.WPF.Modern?style=social" alt="Watches"></a>
<a href="https://github.com/iNKORE-NET/UI.WPF.Modern/discussions"><img src="https://img.shields.io/github/discussions/iNKORE-NET/UI.WPF.Modern?style=social" alt="Discussions"></a>
<a href="https://discord.gg/m6NPNVk4bs"><img src="https://img.shields.io/discord/1092738458805608561?style=social&label=Discord&logo=discord" alt="Discord"></a>
<a href="https://twitter.com/NotYoojun"><img src="https://img.shields.io/twitter/follow/NotYoojun?style=social" alt="NotYoojun's Twitter"></a>
## 开发 ## 开发
本项目目前开发状态: 本项目目前开发状态:
- 正在 [`master`](https://github.com/InkCanvasForClass/InkCanvasForClass/tree/master) 分支上开发第一个正式版本 **v20241001R - Black Mamba** - 正在 [`master`](https://github.com/InkCanvasForClass/InkCanvasForClass/tree/master) 分支上开发第一个正式版本 **v6.0.0**。
要在本地编译应用,您需要安装以下负载和工具: 要在本地编译应用,您需要安装以下负载和工具:
- [.NET Framework 4.7.2](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net472) 1. **[.NET Framework 4.7.2](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net472)**
- [Visual Studio](https://visualstudio.microsoft.com/) 2. [Visual Studio](https://visualstudio.microsoft.com/)
对于 Visual Studio您需要在安装时勾选以下工作负载 对于 Visual Studio您需要在安装时勾选以下工作负载
- .NET 桌面开发 - .NET 桌面开发
## 子项目
**`InkCanvasForClass.IACoreHelper`** <br/>
该项目实现了基于 .NET Framework 4.7.2 和 x86 运行环境的墨迹识别库 IACore 的封装
**`InkCanvasForClass.PowerPoint.InteropHelper`** <br/>
该项目将 ICC 的 PPT 适配功能给单独提取了出来,并下方 ZPH 的部分功能到本项目上面
**`InkCanvasForClass.PowerPoint.Vsto`** <br/>
该项目实现了 ICC 对 PPT 的 VSTO 插件支持,可以缓解 Office 和 WPS 共存导致的 COM 接口被占用的问题(或者其他任何有关 COM 接口的疑难杂症只要软件正常文档不是被保护文档或兼容模式或只读文档VSTO都能行
**`InkCanvasForClassX`** <br/>
该项目已废弃,皆在重写 ICC💀bro以为自己能够摆脱 IC 的💩山)
## 开源许可 ## 开源许可
本项目基于 GNU General Public License Version 3 进行开源 **本项目基于 GNU General Public License Version 3 进行开源**
1. 你可以免费使用、复制、修改、分发受保护程序,但分发时一定要提供源码。
2. 你可以收费。比如可以针对目标码、源码的分发收费,可以针对软件的维修保养(主要是提供技术支持,以下简称“维保”)收费;但不能收许可费、版税、专利许可费、授权费这类费用。
3. GPL程序的所有贡献者自动免费提供了专利许可承诺不会告人侵犯专利权前提是你遵守了GPL
4. GPL程序允许别人破解。如果是用在消费类硬件上要允许人修改并安装程序。
## 开发者
Doubx690i(Dubi906w/kriastans) `逗比的九百有六大不留`