6

I have a large image that I want to show in my presentation. I have four panels on the graph. What I want to do is in each slide, I want to show each panel. How do we show the certain portion of the image only at each time ?

For example I have a graph like this

enter image description here

How can I show each panel as full screen ?

percusse
  • 157,807
Jdbaba
  • 2,643

2 Answers2

7

Remarks

When including an image using \includegraphics from the garphicx package (preloaded by beamer), then you can specify the options clip and trim, where trim takes additional parameters for the borders. In conjunction with clip the trimmed borders are cut off. When omitting clip only the borders are shift (i.e. the bounding box changes).

The trim parameters are

\includegraphics[clip,trim = left bottom right top]{...}

The units are bp (big point is 1/72 inch).

Implementation

Image111.png is the file from your link, placed in the same directory.

\documentclass{beamer}
\begin{document}

\begin{frame}{Upper left}
    \centering
    \includegraphics[clip,trim=0 90 120 0]{Image111}
\end{frame}

\begin{frame}{Lower left}
    \centering
    \includegraphics[clip,trim=0 0 125 90]{Image111}
\end{frame}

\begin{frame}{Upper right}
    \centering
    \includegraphics[clip,trim=125 90 0 0]{Image111}
\end{frame}

\begin{frame}{Lower right}
    \centering
    \includegraphics[clip,trim=125 0 0 90]{Image111}
\end{frame}

\end{document}

Output (First slide)

enter image description here

Henri Menke
  • 109,596
  • Would you please tell what are the units on trim parameters ? – Jdbaba Jun 21 '13 at 20:56
  • The trim parameters are: trim = left bottom right top. The units are bp (big point is 1/72 inch). – Henri Menke Jun 21 '13 at 20:59
  • One quick question: How can we know the total length of the of the image and width of the image in bp ? – Jdbaba Jun 21 '13 at 21:54
  • I always use trial&error here. Calculating cutoffs in advance might be possible, but I don't think you will save time doing so. This post may also help you: http://tex.stackexchange.com/questions/41370/what-are-the-possible-dimensions-sizes-units-latex-understands – Henri Menke Jun 21 '13 at 21:58
3

A TikZ solution that doesn't require manual specification of trim parameters.

enter image description here

\documentclass{beamer}

\usepackage{tikz}

\begin{document}

\newcommand\scale{2}

\newcommand\clippic[1]{
  \begin{tikzpicture}[inner sep=0]
    % extract dimensions of image
    \node{\phantom{\includegraphics[scale=\scale]{image111}}};
    \coordinate(nw)at(current bounding box.north west);
    \coordinate(se)at(current bounding box.south east);
    \coordinate(ne)at(current bounding box.north east);
    \coordinate(sw)at(current bounding box.south west);
    \coordinate(cent)at(current bounding box.center);

    % insert specific panel of image
    \pgfresetboundingbox
    \clip[use as bounding box](#1)rectangle(cent);
    \node{\includegraphics[scale=\scale]{image111}};
  \end{tikzpicture}
}

\newcommand\makeframe[2]{
  \begin{frame}{#1}

    \centering
    \clippic{#2}

  \end{frame}
}

%%%%%%%%%%%

\makeframe{Top Left}{nw}
\makeframe{Top Right}{ne}
\makeframe{Bottom Left}{sw}
\makeframe{Bottom Right}{se}

\end{document}

You may also adjust the parameter of \scale{} to achieve scaling effect.

Herr K.
  • 17,946
  • 4
  • 61
  • 118