gpt4 book ai didi

c++ - 在 OpenCV 中从 Point 数据类型转换为 int

转载 作者:太空宇宙 更新时间:2023-11-04 13:51:58 25 4
gpt4 key购买 nike

我正在编写一个程序,使用 windows.h 中定义的 SetCursorPos() 移动鼠标指针。 SetCursorPos 的参数应该是int。我有从矩形获得的 Point 数据结构。如何转换?提前致谢:)

最佳答案

SetCursorPos 定义为:

BOOL WINAPI SetCursorPos(
_In_ int X,
_In_ int Y
);

所以你可以使用:

 Point p;
....some code
SetCursorPos(p.x,p.y);

关于c++ - 在 OpenCV 中从 Point 数据类型转换为 int,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23156635/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com