我怎样才能获得多个衰落方向?

我怎样才能获得多个衰落方向?

我试图在这里获得南北两个衰落方向:

\documentclass{beamer}
\usetheme{Warsaw}
\usepackage{tikz}
\usetikzlibrary{fadings}


\setbeamertemplate{background}{%
\begin{tikzpicture}
\path (0,0) rectangle (\paperwidth,\paperheight);
\node[scope fading=north,inner sep=0pt,outer sep=0pt,anchor=north east] at(\paperwidth,\paperheight) {\includegraphics[height=\paperheight]{frog.jpg}};
\end{tikzpicture}
}

\author{Kermit}
\title{Autobiography}
\begin{document}
\maketitle

\end{document}

答案1

以下是一些肮脏的方法:

\documentclass{beamer}
\usetheme{Warsaw}
\usepackage{tikz}
\usetikzlibrary{fadings}

\setbeamertemplate{background}{%
\begin{tikzpicture}
\path (0,0) rectangle (\paperwidth,\paperheight);
\begin{scope}
\clip (0,0.5\paperheight) rectangle (\paperwidth,\paperheight);
\path[scope fading=north,] (0,0.5\paperheight) rectangle (\paperwidth,\paperheight);
\node[inner sep=0pt,outer sep=0pt,anchor=north east] at(\paperwidth,\paperheight) {\includegraphics[height=\paperheight]{example-image-a}};
\end{scope}
\begin{scope}
\clip (0,0) rectangle ([yshift=-0.5\pgflinewidth]\paperwidth,0.5\paperheight);
\path[scope fading=south,] (0,0.5\paperheight) rectangle (\paperwidth,0);
\node[inner sep=0pt,outer sep=0pt,anchor=north east] at(\paperwidth,\paperheight) {\includegraphics[height=\paperheight]{example-image-a}};
\end{scope}
\end{tikzpicture}
}

\author{Kermit}
\title{Autobiography}
\begin{document}
\maketitle
\begin{frame}
  Me here
\end{frame}

\end{document}

在此处输入图片描述

相关内容