到目前为止我已经学会了如何使用多边形路径剪切图像 和如何创建无边距的框架。
然而我无法将两者结合起来以获得所需的输出。
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\setbeamertemplate{navigation symbols}{}
\begin{frame}[plain,b]
\begin{tikzpicture}[remember picture, overlay]
\clip (0\paperwidth,0\paperheight)--(0.4\paperwidth,0\paperheight)--(0.6\paperwidth,1\paperheight)--(0\paperwidth,1\paperheight)--cycle;
\node[anchor=south west] at (0,0) {\includegraphics[width=\paperwidth]{photo-1463595373836-6e0b0a8ee322.jpeg}};
\end{tikzpicture}
\end{frame}
\end{document}
谢谢你!
答案1
paperwidth
我没有使用和,而是papweheight
使用了current page
锚点和calc
tikzlibrary 来定义剪切路径。
width
我没有将其作为两幅图像的比例因子,而是使用了height
它们,因为否则它们的高度不够,无法覆盖幻灯片。
最后inner sep=0pt
修复以避免图形周围有白边。
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\setbeamertemplate{navigation symbols}{}
\begin{frame}[plain,b]
\begin{tikzpicture}[remember picture, overlay]
\begin{scope}
\clip (current page.south west)|-
($(current page.north west)!0.6!(current page.north east)$) --
($(current page.south west)!0.4!(current page.south east)$) --
cycle;
\node [anchor=south west, inner sep=0pt] at
(current page.south west)
{\includegraphics[height=\paperheight]{photo-1463595373836-6e0b0a8ee322.jpg}};
\end{scope}
\begin{scope}
\clip (current page.south east)|-
($(current page.north west)!0.6!(current page.north east)$) --
($(current page.south west)!0.4!(current page.south east)$) --
cycle;
\node[anchor=south west, draw, inner sep=0pt]
at (current page.south west)
{\includegraphics[height=\paperheight]{photo-1464013778555-8e723c2f01f8.jpg}};
\end{scope}
\end{tikzpicture}
\end{frame}
\end{document}
答案2
使用15.6 Generalized Filling: Using Arbitrary Pictures to Fill a Path
,我设法做到:
\documentclass{beamer}
\usepackage{tikz}
\usepackage{mwe}
\begin{document}
\setbeamertemplate{navigation symbols}{}
\begin{frame}[plain,b,fragile]
\begin{tikzpicture}[path image/.style={
path picture={
\node at (path picture bounding box.center) {
\includegraphics[width=\paperwidth]{#1}
};}}]
\draw [path image=example-image-a] (0,0)--(0.4\paperwidth,0\paperheight)--(0.6\paperwidth,\paperheight)--(0\paperwidth,\paperheight)--cycle;
\draw [path image=example-image] (0.4\paperwidth,0\paperheight)--(\paperwidth,0\paperheight)--(\paperwidth,\paperheight)--(0.6\paperwidth,\paperheight)--cycle;
\end{tikzpicture}
\end{frame}
\end{document}