I tried to build a simple 'blink comparator' - where you can click on an image repeatedly to switch between two similar images. (An old-fashioned notion in the days of powerful image processing software, it's true.) I think the problem with what I've done so far is the behaviour of the symbols inside a DynamicModule
:
image1 = Thumbnail[ExampleData[{"TestImage", "Mandrill"}], 300];
image2 = Thumbnail[
ColorNegate[ExampleData[{"TestImage", "Mandrill"}]], 300];
DynamicModule[{imageList = {image1, image2}},
EventHandler[
Show[
First[imageList],
Graphics[
{
Text[
Style[
"name of First[imageList]]?",
14, White],
ImageDimensions[First[imageList]]/2]
}
]],
{"MouseDown" :>
{
RotateLeft[imageList],
Beep[]
}
}]]
The Beep
confirms the EventHandler
action, but the image doesn't change.
RotateLeft
doesn't change the list inplace rather it creates a new one, so yourimageList
is never updated $\endgroup$imageList = RotateLeft[imageList],
doesn't seem to work... $\endgroup$FlipView[{image1, image2}]
? $\endgroup$Dynamic
is always a good thing... :) $\endgroup$