Shadow for custom mouse cursor

北城余情 提交于 2019-12-07 07:30:45

问题


On "newer" Windows systems there is an option to make the OS draw a shadow beneath the mouse cursor:

However the custom cursors in my Delphi app don't show a shadow even if this setting is enabled. Do you have any idea how to arrange it so that Windows adds the shadow automagically? Or do I really have to check the user's preferences and conditionally draw the shadow myself like Mike Lischke did?

(This is a question that has been bugging me and others for some time:

  • Custom mouse cursor shadow
  • Custom cursor shadow
  • Custom cursor with shadow)

回答1:


No, you don't need to check the user's global setting and draw the cursor yourself. You just need to provide a cursor with the alpha channel. Windows will either use alpha blending to draw your cursor or not, depending on the user's setting. Your cursors probably don't include the alpha channel so the shadow is never shown.



来源:https://stackoverflow.com/questions/5550467/shadow-for-custom-mouse-cursor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!