Second or 'Ghost' Mouse Pointer

3 views (last 30 days)
Chris
Chris on 30 Jun 2012
Hello all,
I am working on a GUI which contains two axes with different images. I want to create a 'ghost mouse pointer' which appears above axes2 when I move the primary mouse pointer over axes1. The second mouse pointer should move parallel to the primary mouse pointer.
So far I am using the WindowButtonMotionFcn to capture the mouse coordinates. For the second mouse pointer, I use a small grayscale matrix representing a mouse arrow. This image is displayed in a third axes, and the axes is moved by the WindowButtonMotionFcn using set(handles.AxesPointer, 'Position', ...) when the mouse arrow is above axes1. So far so good, however, two problems remain:
1. The 'ghost mouse' is a little slower than the primary mouse (which I could live with).
2. The background of the 'ghost mouse' is black, transparent would be nicer.
Any ideas how I can render my 'ghost mouse' axes transparent, or any other way to achieve the 'ghost mouse'?
Thanks Chris

Accepted Answer

Jan
Jan on 30 Jun 2012
I suggest to keep the axes, which contains the ghost pointer fixed and move the coordinates of the image instead. I assume, this would be faster.
NaN-Values in the image's CData are displayed transparently.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!