Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How should a custom cursor image be constructed?

908695Jan 19 2013 — edited Jan 19 2013
This relates to Java 1.7_u11 and JFX 2.2.4 on Windows 7 64 bit.

When I set a Node's cursor to Cursor.CROSSHAIR, the crosshair is displayed with complementary colour to its screen background (e.g. black on white, blue on yellow, etc.) However when I construct my own custom crosshair image, 32 pixels square, with transparent-white background pixels and opaque-black crosshair pixels, and create an ImageCursor from it to use as the cursor, it works fine, but always displays as black, irrespective of the background that it's being displayed over. I've tried various ways of creating the image.

So my question is, is there something special about the built-in Cursor images, and how should we emulate it for an ImageCursor? More generally, how does the 'blend mode' for cursor images work?

(Apologies if I'm displaying dismaying ignorance here.)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 16 2013
Added on Jan 19 2013
1 comment
213 views