C# 更改光标的点击/指向位置?

标签 c# winforms mouse-cursor

所以默认光标是“箭头”光标,箭头的左上角(点所在)是点击或与其他控件交互的部分。我怎样才能改变指向部分说出箭头的尾部?

我有一个自定义光标(位图图像​​),它是一个 16x16 大小的圆圈,我希望它的正中心成为指针。我有另一个类似箭头的自定义光标,它也指向左下方 16x16,我希望光标的左下角成为指针。我认为游标类中有一个属性用于此,但我不确定它叫什么。

最佳答案

这实际上是在 CUR 中指定的 file format .

The CUR file format is an almost identical image file format for non-animated cursors in Microsoft Windows. The only differences between these two file formats are the bytes used to identify them and the addition of a hotspot in the CUR format header; the hotspot is defined as the pixel offset (in x,y coordinates) from the top-left corner of the cursor image where the user is actually pointing the mouse.

可以编辑 CUR 文件的程序通常允许您指定热点。更多信息可以在 this question 中找到.

关于C# 更改光标的点击/指向位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6797884/

相关文章:

html - 如何使光标在CSS的边距区域保持不变

c# - 通过 C# 进行 Apache spark 查询

java - 与异常处理相关的查询

c# - 把一个aspx页面变成一个链接?

c# - 如何在选择或取消选择其父节点时自动选择或取消选择所有子节点?

c# - 隐藏截断复选框的工具提示

c++ - 将 HICON/HCURSOR 复制到字节数组

c# - 是否可以创建使用可空 int 作为泛型参数的类?

c# - 使用 Windows 范围内的 Beta UTF-8 支持功能时在 Winforms 中调整 RTF 的错误

windows - 从 Windows 上的另一个进程更改窗口上的鼠标光标