Interaction avec un graphe
Bonjour,
J'aimerais pouvoir cliquer à l'intérieur d'axes et afficher l'image correspondant au time point de l'endroit cliqué. Je fais comme ceci:
Code:
1 2 3 4 5 6 7 8 9
| graphSignal = axes('Position',[.21 .83 .50 .15],'ButtonDownFcn',@ButtonDown);
function ButtonDown(hObject, eventData)
global graphSignal graphVideo
global fileNameAVI pathAVI
pt = get(graphSignal,'CurrentPoint')
%msgbox(sprintf('Cliqué sur graph %d',find(graphSignal==hObject)))
% *** Display 1st image of the video
pt(1,1)
imshow(read(mmreader([pathAVI fileNameAVI]),pt(1,1)),'Parent',graphVideo); |
Mais cela marche que de temps en temps sur certains clics... Est-ce que vous savez pourquoi? Comment pourrais-je améliorer ca?
Merci.