[Tex/LaTex] How to make framezoom zoomed image fit the slide

beamer

I'm currently trying to zoom in to (more or less) the top half of an image on a slide in latex beamer class. How can I tell LaTeX to make the zoomed image fit the slide (see attached image)? This is an MWE. In my actual presentation I see that the right area is selected, but the left border of the zoomed image is in the center of the slide. Both the size and the position of the zoomed image make it go off-screen. How can i prevent this behavior, e.g. specify size and position of the zoomed image on the new slide?

MWE

\documentclass{beamer}
\usepackage{mwe}

\begin{document}

\begin{frame}

\frametitle{\huge Title}
\framezoom<1><2>[border=0](0.3cm,0.7cm)(5.6cm,3.1cm)
\begin{figure}[ht]
\includegraphics[width=0.77\textwidth,height=0.77\textheight,keepaspectratio]{example-image}
\end{figure}

\end{frame}

\end{document}

Sorry for the large image, I don't know how to make it smaller.

Best Answer

Use border=1 in order to see what you are actually about to zoom. Right now, you have been zooming some white area as well. The following MWE should do what you want.

% arara: pdflatex

\documentclass{beamer}

\begin{document}    
\begin{frame}       
    \frametitle{\huge Spectrum}
    \framezoom<1><2>(1.3cm,0.5cm)(8.2cm,3cm)
    \begin{figure}
        \includegraphics[width=0.77\textwidth,height=0.77\textheight,keepaspectratio]{example-image}
    \end{figure}        
\end{frame} 
\end{document}

enter image description here