当前位置:网站首页>WPF 手写板
WPF 手写板
2022-06-21 20:41:00 【zLulus】
效果如图
引用
IACore.dll
IALoader.dll
IAWinFX.dll
Microsoft.Ink.Analysis.dll
Microsoft.Ink.dll
System.Windows.Interactivity.dll
关键代码
通过RecognizeCommand获得StrokeCollection,笔画集合
<InkCanvas x:Name="inkCanvas" Background="Transparent">
<i:Interaction.Triggers>
<i:EventTrigger EventName="StrokeCollected">
<i:InvokeCommandAction Command="{Binding RecognizeCommand}" CommandParameter="{Binding Strokes, ElementName=inkCanvas}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<InkCanvas.DefaultDrawingAttributes>
<DrawingAttributes>
<DrawingAttributes.Width>8</DrawingAttributes.Width>
<DrawingAttributes.Height>8</DrawingAttributes.Height>
<DrawingAttributes.Color>#707070</DrawingAttributes.Color>
<DrawingAttributes.StylusTip>Rectangle</DrawingAttributes.StylusTip>
<DrawingAttributes.FitToCurve>True</DrawingAttributes.FitToCurve>
</DrawingAttributes>
</InkCanvas.DefaultDrawingAttributes>
</InkCanvas>
使用InkAnalyzer得到预测多个结果
Stroke stroke = GetCombinedStore(strokes);
using (InkAnalyzer analyzer = new InkAnalyzer())
{
analyzer.AddStroke(stroke, ChsLanguageId);
analyzer.SetStrokeType(stroke, StrokeType.Writing);
AnalysisStatus status = analyzer.Analyze();
if (status.Successful)
{
foreach (string item in analyzer.GetAlternates().OfType<AnalysisAlternate>().Select(x => x.RecognizedString).ToArray())
if (Alternates.Count < MAX_Alternates_COUNT)
Alternates.Add(new AlternateViewModel(this,item));
}
}
示例代码
参考资料
官方资料
Get Started with Ink in WPF
Handwriting Recognition
引用问题
WPF Handwriting .NET 4.5 Windows 8: Missing IAWinFX.dll and others
边栏推荐
猜你喜欢

采样器合集
![[deeply understand tcapulusdb technology] tcapulusdb import data](/img/a8/04c4c6703a6137d17666f211d7988d.png)
[deeply understand tcapulusdb technology] tcapulusdb import data

InstaDeep Ltd:Arthur Flajolet | 单机上基于群体的快速强化学习

Five minutes, Xie Yunyuan

Thresholdtypes of opencvsharp threshold segmentation threshold function

Jeu de boutons de force 4 (version MySQL)

【深入理解TcaplusDB技术】TcaplusDB业务数据备份

【深入理解TcaplusDB技术】TcaplusDB导入数据
![[deeply understand tcapulusdb technology] one click installation of tmonitor background](/img/33/7d390732d6e441a4311189b6e49474.png)
[deeply understand tcapulusdb technology] one click installation of tmonitor background

nuxt ssr打包和部署
随机推荐
leetcode刷题:顺丰科技智慧物流校园技术挑战赛
利用do while循环,分别计算1-100中奇数的和、偶数的和【方法二】
Use the do while loop to calculate the odd and even sums in 1-100 [method 2]
[deeply understand tcapulusdb technology] table management of document acceptance
Iqtree| software for constructing evolutionary tree
Use the while loop to calculate the odd and even sums in 1-100 [method 1]
nuxt ssr打包和部署
Dotter| dot method sequence pairwise comparison software
技术分享 | kubernetes pod 简介
如何卸载用conda命令安装的包
力扣:零钱兑换
gdb调试技巧(0)gdb入门
刷题笔记(十七)--二叉搜索树:关于属性问题
Sampler collection
A callback was made to a garbage collected delegate of type "xxx:: invoke". This can cause application crashes, corruption, and data loss. When passing delegates to unmanaged code, the managed applica
利用tRNAscan-SE做tRNA分析
【深入理解TcaplusDB技术】TcaplusDB构造数据
mafft|多序列比对工具
Pycharm下可以正常运行,Pyinstaller打包软件报出Fatal error
【深入理解TcaplusDB技术】TcaplusDB导入数据