Data cursor in GUI

6 Ansichten (letzte 30 Tage)
Zemax
Zemax am 8 Dez. 2011
I am loading an image in GUI and turning ON data cursor. I want user to point at some location in the image and the GUI should automatically record X and Y position of the datacursor in two text boxes. I have tried
but it only works on the figure and even on the figure I am not able to automatically transfer datacursor position to my GUI's text boxes. I would appreciate any help.
Thanks.

Antworten (2)

Walter Roberson
Walter Roberson am 8 Dez. 2011
Sounds to me as if ginput() would be more appropriate than datacursormode
  1 Kommentar
Sean de Wolski
Sean de Wolski am 8 Dez. 2011
Or windowbuttondownfcn in the figure properties if you don't want cross hairs or the requirement of a timer or while loop calling ginput.

Melden Sie sich an, um zu kommentieren.


Sean de Wolski
Sean de Wolski am 8 Dez. 2011
Use the WindowButtonMotionFcn option of the figure to get the position of the cursor every time it's moved. If it's in the range of the axes, display the current position (know the axes position in the figure) then update your edit fields.
docsearch figure properties
And here's a fun example:

Kategorien

Mehr zu Data Exploration finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by