I've built a small manipulate widget to extract a pixel value from an image whereever the mouse is clicked:
img = ExampleData[{"TestImage", "Lena"}];
{w, h} = ImageDimensions@img;
Manipulate[
Grid[{{img,
Grid[{{"Point Value", pt}, {"RGB Value",
ImageData[img][[Round[pt[[1]]]]][[Round[pt[[2]]]]]}},
Frame -> All]}}], {pt, {0, 0}, {w, h}, Locator}]
This works really well. Now, my images of interest are quite large, and I'd like to be able to zoom into the image. So, I tried replacing my image, with a DynamicImage:
img = ExampleData[{"TestImage", "Lena"}];
{w, h} = ImageDimensions@img;
Manipulate[
Grid[{{DynamicImage[img],
Grid[{{"Point Value", pt}, {"RGB Value",
ImageData[img][[Round[pt[[1]]]]][[Round[pt[[2]]]]]}},
Frame -> All]}}], {pt, {0, 0}, {w, h}, Locator}]
DynamicImage, and Mainpulate appear to be fighting for control of the mouse, so when I click on a pixel in the zoomed in image, the image rescales to full size, and I lose the zooming.
Is there an easy way to fix this?