# Kindly explain use of framezoom in beamer

I want to use framezoom to zoom in on India in this map. How can I do it? Can someone explain in a simple language (non-technical) the use of \framezoom function in beamer?

The general syntax for \framezoom is the following:

\framezoom<⟨button overlay specification⟩><⟨zoomed overlay specification⟩>[⟨options⟩](⟨upper left x⟩,⟨upper left y⟩)(⟨zoom area width⟩,⟨zoom area depth⟩)


The general idea of \framezoom is to generate a clickable rectangular area (a "button", if you will) over an image, so that when you click on the area, the zoomed detail will appear.

<⟨button overlay specification⟩> controls on which slide(s) of the frame should the button be created.

<⟨zoomed overlay specification⟩> allows you to specify on which slide(s) should the zoomed detail appear. The value(s) used here should not overlap the value(s) given in <⟨button overlay specification⟩>.

In the optional argument [⟨options⟩] you can use border or border=<number> to draw a frame around the part of the image that will be zoomed. The thickness of the rules used for the frame is controlled by the value specified in <number>; by default (i.e., if no options are specified) no frame is drawn; the color of the frame can also be changed, using linkbordercolor from hyperref (see second example below).

The clickable button has rectangular shape; the coordinates of the upper left corner of this rectangular area are given by (⟨upper left x⟩,⟨upper left y⟩).

The width and the depth are given by (⟨zoom area width⟩,⟨zoom area depth⟩).

### Some examples:

(For some reason, the animations created from the resulting PDFs don't show the colored frame; however, processing the example codes, one in fact sees the frames).

First, a simple example: the clickable area is produced in slide 1; it has a rather thick grey border; the upper left corner of the rectangular area is at (6.8cm,1.2cm) the width and depth of the clickable area are 1.4cm and 1.5cm, respectively. The zoomed area wll appear on slide 2.

\documentclass{beamer}

\begin{document}

\begin{frame}
\framezoom<1><2>[border=4](6.8cm,1.2cm)(1.4cm,1.5cm)
\includegraphics[height=\textheight,width=\textwidth,keepaspectratio]{map}
\end{frame}

\end{document}


Here's a more sophisticated example; the frame around the clickable area has now a customized color produced using \hypersetup{linkbordercolor={red!70!black}}; the frame will appear on slide 2 and the zoomed image will appear on slide 3; notice that slide 3 is now a plain one, so it contains no title nor headline/footline, and the zoomed image occupies all the frame:

\documentclass{beamer}
\usetheme{CambridgeUS}

\begin{document}

\begin{frame}<1,2>[label=india]
\frametitle<1,2>{A zoom over India}
\framezoom<2><3>[border=2](7.6cm,1.4cm)(1.4cm,1.4cm)
\includegraphics[height=\textheight,width=\textwidth,keepaspectratio]{map.jpg}
\end{frame}

\againframe<3>[plain]{india}

\end{document}


An alternative to \framezoom is to use the spy library from PGF/TikZ; here's a little example, showing the image and the zoomed area side-by-side (for details on the spy library, please refer to Section 49 Spy Library: Magnifying Parts of Pictures of the pgf manual):

\documentclass{beamer}
\usetheme{CambridgeUS}
\usepackage{tikz}
\usetikzlibrary{spy}

\begin{document}

\begin{frame}
\frametitle{A zoom over India}
\begin{tikzpicture}[
spy using outlines={
circle,
magnification=10,
size=5cm,
connect spies}]
\node[inner sep=0pt] {\pgfimage[width=0.4\textwidth]{map}};
\only<2>{\spy[red!70!black] on (0.88,0.15) in node at (.5\textwidth,0);}
\end{tikzpicture}
\end{frame}

\end{document}


The image I used in my examples is not the best one; the zoomed areas are pixelated. If possible, use a better image in your actual code.