doug
(Douglas Youvan)
November 22, 2015, 2:49pm
1
I am trying to get the rgb values of the rose while the mouse is moving. As you see, this doesn’t work:
rose = Import["ExampleData/rose.gif"];
idrose = ImageDate[rose];
rrose = Rasterize[rose]
dmp = Dynamic[MousePosition[]]
ImageData[rose[[Flatten[dmp] ]] ]
sghuisman
(Sander Huisman)
November 22, 2015, 4:30pm
2
This doesn’t work for a number of reasons:
MousePosition is in Pixels form the entire screen, not from the image. And you assigned your dmp to something Dynamic, but it can then not be used like that in the last line.
It would be something like:
Dynamic[ImageData[rose[[Flatten[MousePosition[]]]]]
I’m not sure though that you can get the MouseCoordinates back in Pixels! Perhaps try using MousePosition["Graphics"]