Is scaling the cursor possible?

R

rbaulbin

Hello -

Can anyone tell me, is there a means -- either in flash, java, or other
commonly installed medium -- of mapping a bitmapped image to the mouse
cursor/pointer, and then when the cursor is moved, have the image scale
either larger or smaller? E.g., when moved upwards, the image gets
smaller, when moved downwards, the image gets bigger?

Thanks,

RB
 
N

Niels Dybdahl

Can anyone tell me, is there a means -- either in flash, java, or other
commonly installed medium -- of mapping a bitmapped image to the mouse
cursor/pointer, and then when the cursor is moved, have the image scale
either larger or smaller? E.g., when moved upwards, the image gets
smaller, when moved downwards, the image gets bigger?

Yes. From Java 1.4 you can map a bitmap to the cursor and replace it as you
like.

Niels Dybdahl
 
N

Niels Dybdahl

Can anyone tell me, is there a means -- either in flash, java, or other
commonly installed medium -- of mapping a bitmapped image to the mouse
cursor/pointer, and then when the cursor is moved, have the image scale
either larger or smaller? E.g., when moved upwards, the image gets
smaller, when moved downwards, the image gets bigger?

Yes. From Java 1.4 you assign a bitmap to the cursor and replace it when you
like.

Niels Dybdahl
 
L

Larry Barowski

Hello -

Can anyone tell me, is there a means -- either in flash, java, or other
commonly installed medium -- of mapping a bitmapped image to the mouse
cursor/pointer, and then when the cursor is moved, have the image scale
either larger or smaller? E.g., when moved upwards, the image gets
smaller, when moved downwards, the image gets bigger?

You could do it in Java (1.2 or higher) when the cursor is
over a Java component. Use Toolkit.getBestCursorSize() to
find the biggest possible cursor, add a mouse listener, and
change the cursor using Component.setCursor() when the
mouse moves. Create your scaled cursors using
Toolkit.createCustomCursor(). Depending on the system,
the results might not look very smooth though.
 
A

Andrew Thompson

Can anyone tell me, is there a means -- either in flash, java,

do you mean a Java applet? Are you thinking of a web-page?

If that is the case then there are possibly security implications
of allowing the mouse pointer to be changed while it is not directly
over the Java applet.

OTOH, this applet can make the mouse 'disappear' while over the applet,
though since it is a kludgy carry over from the actual purpose of making
a screen-saver, I cannot say it really 'works' for the applet and have
considered overriding the behaviour to give te user back their pointer,
or it would be possible to replace it with any small image of my choosing.

BTW - are you actually thinking of Javascript, when you write 'java'?
<http://www.physci.org/codes/javafaq.jsp#js>
 
A

Andrew Thompson

OTOH, this applet ..

Oops! See below.[1]
..can make the mouse 'disappear' while over the applet,
though since it is a kludgy carry over from the actual purpose of making
a screen-saver, I cannot say it really 'works' for the applet and have
considered overriding the behaviour to give te user back their pointer,
or it would be possible to replace it with any small image of my choosing.

[1] <http://www.physci.org/saver/>
 
R

rbaulbin

Larry said:
You could do it in Java (1.2 or higher) when the cursor is
over a Java component. Use Toolkit.getBestCursorSize() to
find the biggest possible cursor, add a mouse listener, and
change the cursor using Component.setCursor() when the
mouse moves. Create your scaled cursors using
Toolkit.createCustomCursor(). Depending on the system,
the results might not look very smooth though.

Interesting.. thank you all for your responses. This would be for a
web page applet.

Is there a way to limit the direction that the mouse pointer can move?
I.e., when clicked on object X, it is only allowed to move 2 inches
vertically and 6 inches horizontally?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top