2011-12-27 19 views
1

我需要創建具有透明(水印)圖像的光標,例如,如果我將光標移動到例如某些文本中,我需要看到該文本,有人可以幫我解決這個問題嗎?需要用水印圖像創建光標

+1

這個問題非常含糊。你能否提供你想要實現的更多細節? – 2011-12-27 13:59:26

+0

您的需求與工具提示提供的功能有何不同? – 2011-12-27 14:00:18

+0

我不太明白,不要移動光標_over_東西嗎?你能提供一個你想要實現的圖像嗎? – Thomas 2011-12-27 14:00:40

回答

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; 
}