#736 – 通过代码获取硬件支持的最大触摸点数(Finding the Maximum Number of Touch Points at Run-time)

news/2024/12/22 13:03:11/

原文地址;https://wpf.2000things.com/2013/01/17/736-finding-the-maximum-number-of-touch-points-at-run-time/

我们可以使用Win32的API函数GetSystemMetrics 获取硬件支持的最大触摸点数。

class Program
{[DllImport("user32.dll")]static extern int GetSystemMetrics(int nIndex);// Index passed in to GetSystemMetrics() indicates// what data we're asking for.private const int SM_DIGITIZER = 94;private const int SM_MAXIMUMTOUCHES = 95;// Masks used to check results from SM_DIGITIZER checkprivate const int NID_READY = 0x80;private const int NID_MULTI_INPUT = 0x40;static void Main(string[] args){string info;int digitizer = GetSystemMetrics(SM_DIGITIZER);if ((digitizer & (NID_READY + NID_MULTI_INPUT)) == NID_READY + NID_MULTI_INPUT){int numTouchPoints = GetSystemMetrics(SM_MAXIMUMTOUCHES);info = string.Format("Multitouch ready, {0} inputs supported", numTouchPoints);}elseinfo = "Multitouch not supported";Console.WriteLine(info);Console.ReadLine();}
}

打印出结果如下:

736-001

你可以在“控制面板”->“系统”页中查看。


http://www.ppmy.cn/news/648376.html

相关文章

Python实例分割 YOLOv5 segment使用教程(完善中)

目录 一、直接试用方式 1、准备工作 2、代码测试 (1)、模型训练(可以跳过) (2)、模型预测 二、制作自己的数据集 1、格式 2、labelme制作标签 3、json转txt 4、修改数据集参数 三、用YOLOv5跑自己…

Cybersecurity Challenges In The Uptake Of Artifitial Intelligence in Autonomous Driving [1]

“Cybersecurity Challenges In The Uptake Of Artifitial Intelligence in Autonomous Driving”是ENISA发布的关于自动驾驶汽车中,由于AI技术的大量应用所带来的网络安全问题的技术白皮书。 全文可以分为三大部分:第一部分是对自动驾驶汽车的软硬件&a…

Sizes of tensors must match except in dimension 1. Expected size 24 but got size 25 for tensor numbe

在做图像分割的时候遇到了错误&#xff0c;错误如下&#xff1a; File "D:/segmentation/Pytorch-UNet-master/train.py", line 193, in <module>ampargs.amp)File "D:/segmentation/Pytorch-UNet-master/train.py", line 88, in train_netmasks_pr…

Yolact源码解析

数据加载 with timer.env(Load Data):# img:(550, 550, 3)# gt:(3, 5)&#xff0c;3是3个物体&#xff0c;5是中心点&#xff0c;宽高&#xff0c;类别# gt_mask: (3, 1080, 1920),1080*1920是加载的原图大小# h, w:1080, 1920# num_crowd:0img, gt, gt_masks, h, w, num_crow…

YOLOv5图像分割--SegmentationModel类代码详解

目录 ​编辑 SegmentationModel类 DetectionModel类 推理阶段 DetectionModel--forward() BaseModel--forward() Segment类 Detect--forward SegmentationModel类 定义model将会调用models/yolo.py中的类SegmentationModel。该类是继承父类--DetectionModel类。 cl…

yolov5-seg的ort部署

本文主要是简单写了一个yolov5-seg的onnxruntime推理工程,python版本的,分享给大家。验证了预处理和解码过程,并进行了简单地属性和方法封装。 Descripttion: version: @Company: Author: Date: 2022-09-28 00:07:30 LastEditors: LastEditTime: 2022-09-29 09:05:01…

nginx配置:woker_processes number与worker_cpu_affinity

nginx一般只做高并发代理&#xff0c;属于cpu密集型处理。过多的进程数在多核处理器中需要排队&#xff0c;没有意义 一般woker_processes设置为逻辑核心数&#xff0c;查看逻辑核心数 [rootVM_0_17_centos worker01]# cat /proc/cpuinfo | grep "processor" proces…

binary masks_Python中的Masks概念

binary masks All men are sculptors, constantly chipping away the unwanted parts of their lives, trying to create their idea of a masterpiece … Eddie Murphy 所有的人都是雕塑家,不断地消除生活中不必要的部分,试图建立自己的杰作理念……埃迪墨菲(Eddie Murphy) …