I want to get the Pixel value of an image.and here is my code
DynamicModule[{p = {50, 50}},
{Show[img, Graphics[Locator[Dynamic[p]]]],
ImageValue[img, Dynamic[p]]}]
and it came up with a warning that p is with a non integer value,
to solve the problem ,I used Floor to get an integer value
DynamicModule[{p = {50, 50}},
{Show[img, Graphics[Locator[Dynamic[p]]]],
ImageValue[img,Floor/@Dynamic[p]]}]
this time it still doesnt work, with a warning:
ImageValue::imgrng: The specified argument Floor[p$20303] should be a pair of real or integer numbers or a list of those.
My question is ,can I strict the loactor to Integer Domain?or is there any more elegent way to deal with this problem?

Dynamic[p]hasHeadDynamicand some functions are not able to cooperate with it so you have to moveDynamicoutside. You may also want to take a look at related locator on a png file. (pay attention to the coordinates which are relevant in your case) – Kuba Sep 10 '13 at 06:03