# Inserting button in image

Can I insert a button in an image at specified location? I have tried but it shows Button is not a graphic function.

-

Lets get an image:

img = ExampleData[{"TestImage", "Lena"}];


Overlay is pretty easy to use for location specification. In the case below I used scaled coordinates:

Overlay[{img, Button[Style["Image Histogram", Blue, Italic, 34],
CreateDialog[ImageHistogram[img]]]}, All, 2, Alignment -> {.7, -.8}]


Here is a simple line to understand better how to place the button in different locations:

Overlay[{img, Button[Style["Image Histogram", Blue, Italic, 8],
CreateDialog[ImageHistogram[img]]]}, All, 2, Alignment -> #] & /@Tuples[{.7,-.7}, 2]


-

You can use an inset:

Graphics[{Inset[
RandomImage[CauchyDistribution[0, .2], {100, 100},
ColorSpace -> "RGB"], Center],
Frame -> True]

-

or maybe you don't want to put it on the image, but somewhere near it use this :

Column[
{Button["Transform", CreateDialog[ImageHistogram[img]]], Show[
img]]


Which works exactly the same but looks a little different.

-