How can i change my pointer mouse by a image?

I have to do a program which create a music partiture, and i need select a note (by a gui interface) and introduce this note into a empty partiture. I'm looking the way that when you click on the note the mouse pointer change to this note (the image).... Somebody can help me?, please

 採用された回答

Alberto
Alberto 2013 年 3 月 18 日

0 投票

Yes but with this option i need declare the 16x16 matrix pixel by pixel, if i use a image the function crash.

4 件のコメント

Walter Roberson
Walter Roberson 2013 年 3 月 18 日
imresize() to 16 x 16. rgb2bw() that. Add 1 so that the black are 1 and the white are 2.
Alberto
Alberto 2013 年 3 月 21 日
I tried with this code step by step: ------------------------------------------------------------------- X=imread('negra.jpg'); umbral=graythresh(X);
P=im2bw(X,umbral); P = imresize(P,[16,16]); [m n]=size(P)
set(gcf,'Pointer','custom','PointerShapeCData',P,... 'PointerShapeHotSpot',[9 9]) --------------------------------------------------------------------
And Matlab crash with this error:
??? Error using ==> set Value must be numeric
Image Analyst
Image Analyst 2013 年 3 月 21 日
Add comments to Walter's answer, not to "your" answer, which really should have been a comment to Walter, not an Answer of your own to your original question.
Alberto
Alberto 2013 年 3 月 23 日
Thank you Walter I did it, and it`s worked

サインインしてコメントする。

質問済み:

2013 年 3 月 14 日

コメント済み:

2020 年 6 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by