# animate controls as part of the image

This is a "nice to have"-question, I guess:

I'm using the animate package to show a sequence of software dialog screenshots. In getting through the series I added that useful but ugly looking controls panel (yes, I have tried different fg/bg-colors ... it didn't make the thing better). The screenshots are these usual <BACK/NEXT> dialogs.

Is it possible to get the animation command FORWARD/BACKWARD in these NEXT> and <BACK button areas in the screenshots, so that -- similar to the real software -- the reader must click to 'NEXT' in the sceenshot to get the next pic and clicking 'BACK' shows the previous screenshot?

Hope, I could express it understandable ...

This is a nice example of using the JavaScript API of animate and the \mediabutton command of media9.

User Caramdir's excellent onimage package is used to place the buttons onto the animation. However, we have to patch onimage.sty in order to not use \includegraphics.

For the code below to compile, copy the example image files from package mwe into the current directory as

cp $TEXMF/tex/latex/mwe/example-image-a.png ./example-image-1.png cp$TEXMF/tex/latex/mwe/example-image-b.png ./example-image-2.png
cp \$TEXMF/tex/latex/mwe/example-image-c.png ./example-image-3.png


since we need numbered images for \animategraphics.

\documentclass{beamer}

\usepackage{animate}
\usepackage{media9} % buttons via \mediabutton

\usepackage{onimage}

%patch onimage.sty not to use \includegraphics
\makeatletter
\def\tikzonimage@opt[#1]#2{%
\begin{tikzpicture}
%\node[inner sep=0] (image) {\includegraphics[#1]{#2}};
\node[inner sep=0] (image) {#2};
\begin{tikzonnode}{image}%
}
\makeatother

\begin{document}
\begin{frame}

\begin{tikzonimage}{%
\animategraphics[method=ocg,label=myGUI,step,nomouse,width=0.8\linewidth]{1}{example-image-}{1}{3}
}[tsx/show help lines]
\node at (0.8 , 0.8) [anchor=south east, inner sep=0pt, outer sep=0pt] {
\mediabutton[