确定当前选定主题的光标大小 [英] Determine cursor size of currently selected theme

查看:84
本文介绍了确定当前选定主题的光标大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示一个自定义鼠标光标,其大小与用户当前的设置(在控制面板中)相匹配。

I want to show a custom mouse cursor, in a size that matches the current settings (in the control panel) of the user.

正在执行Cursor.Current。大小总是返回32x32(尽管我猜想它们总是技术上,尽管不是视觉上的),无论控制面板的设置是什么,无论是较小的还是较大的光标外观都可以正确地反映出来。

Doing Cursor.Current.Size always returns 32x32 (as I guess they always are technically, though not visually), no matter what the control panel settings, which are correctly reflected by smaller or bigger cursor appearances.

那我怎么算出大小呢?

推荐答案

对于我发现的内容,您必须获取光标的图标(可能带有一些win32-API),然后使用ICONINFO找出掩码位图。之后,您可以检查图标的像素并计数,直到找到透明颜色,然后找出实际大小为止。

For what I have found out, you have to get the Icon for the cursor (probably with some win32-API) and then using ICONINFO to find out the mask bitmap. After that you can check the pixels of the icon and count until you find the transparent color and that way find out the real size.

我已经看到了几个答案其他指向该方向的站点,但是我找不到完整的解决方案,只是在这里和那里分段。

I have seen a couple of answers on other sites that point to this direction, but I cant find a complet solution, just fragments here and there..

这个stackoverflow问题对于所使用的位图蒙版有很好的答案通过光标,然后您可能会从那里找到解决方案。

This stackoverflow question have a good answer about the bitmap masks used by the cursor and from there maybe you can work your way to the solution.

C#-捕获鼠标光标图像

这个问题很旧,我从2003年开始就在其他网站上看到了这个问题,因此,如果您成功了,请把在这里回答,很多人都会很高兴找到这个问题的解决方案。

This question is old, I have seen this question on other sites from year 2003, so if you have success, then please put the answer here, many would be glad to se the solution to this question.

这篇关于确定当前选定主题的光标大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆