Create a semi-transparent cursor from an image

后端 未结 4 1022
感情败类
感情败类 2021-02-14 23:20

Is it possible to create a cursor from an image and have it be semi-transparent?

I\'m currently taking a custom image and overylaying the mouse cursor image. It would b

4条回答
  •  忘了有多久
    2021-02-15 00:15

    On the top of my head (I would try that first):

    1. create new bitmap with same size as original, but with ARGB structure
    2. drawimage: existing bitmap to the new bitmap
    3. access raw bitmap data, and replace A bytes with 128

    You should have nice semitransparent bitmap there.

    If performance allows, you can scan for fully transparent pixels and set A to zero for them!

提交回复
热议问题