Second or 'Ghost' Mouse Pointer
3 views (last 30 days)
Show older comments
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
0 Comments
Accepted Answer
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.
0 Comments
More Answers (0)
See Also
Categories
Find more on Lighting, Transparency, and Shading in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!