Need to create cursor with watermark image [closed]

匿名 (未验证) 提交于 2019-12-03 02:35:01

问题:

I need to create cursor with transparent(watermark) image, ie if I moving cursor under for example some text I need to see that text, can somebody help me with that?

回答1:

To create a custom cursor, use the java.awt.Toolkit.createCustomCursor method.



回答2:

public Cursor pointer() throws Exception {          int[] pixels = new int[16 * 16];          Image image = Toolkit.getDefaultToolkit().createImage(                 new MemoryImageSource(16, 16, pixels, 0, 16));          Cursor transparentCursor = Toolkit.getDefaultToolkit().createCustomCursor(                         image, new Point(0, 0), "invisibleCursor");         return transparentCursor; } 


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