Second or 'Ghost' Mouse Pointer

3 ビュー (過去 30 日間)
Chris
Chris 2012 年 6 月 30 日
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

採用された回答

Jan
Jan 2012 年 6 月 30 日
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 件)

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by