当前位置:网站首页>Uwp tablet inkcanvas
Uwp tablet inkcanvas
2022-06-21 22:34:00 【zLulus】
The effect is as shown in the picture 
Key code
<InkCanvas x:Name="inkCanvas" />
// Set painting information
inkCanvas.InkPresenter.InputDeviceTypes = Windows.UI.Core.CoreInputDeviceTypes.Mouse | Windows.UI.Core.CoreInputDeviceTypes.Pen | Windows.UI.Core.CoreInputDeviceTypes.Touch;
InkDrawingAttributes inkDrawingAttributes = inkCanvas.InkPresenter.CopyDefaultDrawingAttributes();
inkDrawingAttributes.Size = new Size(8, 8);
inkDrawingAttributes.Color = Windows.UI.Color.FromArgb(255, 112, 112, 112);
inkDrawingAttributes.FitToCurve = true;
inkDrawingAttributes.PenTip = PenTipShape.Rectangle;
inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(inkDrawingAttributes);
InkRecognizerContainer inkRecognizerContainer = new InkRecognizerContainer();
IReadOnlyList<InkRecognizer> recognizers = inkRecognizerContainer.GetRecognizers();
InkRecognizer recognizer = recognizers.SingleOrDefault(r => r.Name == "Microsoft chinese ( Simplified Chinese character ) Handwriting recognizer ");
inkRecognizerContainer.SetDefaultRecognizer(recognizer);
if (token.IsCancellationRequested)
return;
IReadOnlyList<InkRecognitionResult> results = await inkRecognizerContainer.RecognizeAsync(inkCanvas.InkPresenter.StrokeContainer, InkRecognitionTarget.All);
foreach (InkRecognitionResult result in results)
{
// Get recognition results
foreach (string text in result.GetTextCandidates())
{
}
}
Sample code
Reference material
边栏推荐
- WPF 启动带参数
- Verilog除法器的设计总结
- Notes on question brushing (17) -- binary search tree: about attribute problems
- ES7 create index template
- [deeply understand tcapulusdb technology] transaction execution of document acceptance
- 刷题笔记(十七)--二叉搜索树:关于属性问题
- Pi4j pin analog bus, several ideas of control transmission and data transmission
- GDB debugging practice (10) multi thread debugging
- WPF x:Static
- FPGA之道——FPGA开发流程之项目方案与FPGA设计方案
猜你喜欢

Learn vector -- how to use common interfaces

关于lg(n!)的渐进紧确界

电脑屏幕分辨率怎么调?电脑屏幕修改分辨率SwitchResX

【深入理解TcaplusDB技术】 Tmonitor模块架构

左手代码,右手开源,开源路上的一份子

IP-guard打印管控,防止打印渠道信息泄露
![[in depth understanding of tcapulusdb technology] tcapulusdb construction data](/img/64/4d7ec393d8469cdadc89078a8cf4b1.png)
[in depth understanding of tcapulusdb technology] tcapulusdb construction data

UEFI dual system + dual hard disk installation

nuxt ssr打包和部署

项目流程管理工具OmniPlan Pro 4
随机推荐
Electronic bidding procurement mall system: optimize traditional procurement business and speed up enterprise digital upgrading
GDB debugging practice (10) multi thread debugging
C# DataTable转换为Entity(反射&&泛型)
Technology sharing | introduction to kubernetes pod
Pi4j GPIO pin pull-up resistance, pull-down resistance concept
GDB debugging practice (7) signal processing
Apache ShardingSphere 5.1.2 发布|全新驱动 API + 云原生部署,打造高性能数据网关
Paml| Shengxin software for calculating dn/ds value
Sampler collection
可乐与凉茶加速互卷
Required books
刷题笔记(十七)--二叉搜索树:关于属性问题
celery+rabbit分布式任务处理
Matlab2020a使用App Designer如何导出exe
Learn vector -- how to use common interfaces
[deeply understand tcapulusdb technology] table management of document acceptance
About Eureka starting successfully but accessing 404
WPF ComboBox设置选项与反显
Five minutes, Xie Yunyuan
Use the do while loop to calculate the odd and even sums in 1-100 [method 2]