
MWE를 고려해보세요.
\documentclass{article}
\usepackage{tikz}
\usepackage{graphicx}
% % COMPILED WITH PDFLATEX
\newif\ifdeveloppath
\tikzset{/tikz/develop clipping path/.is if=developpath,
/tikz/develop clipping path=true}
\newcommand{\clippicture}[2]{
\begin{tikzpicture}
\ifdeveloppath
\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=1.0\linewidth,keepaspectratio]{example-image-a}};
\else
\node[anchor=south west,inner sep=0] (image) at (0,0) {\phantom{\includegraphics[width=1.0\linewidth,keepaspectratio]{example-image-a}}};
\fi
\pgfresetboundingbox
\begin{scope}[x={(image.south east)},y={(image.north west)}]
% Draw grid
\ifdeveloppath
\draw[help lines,xstep=.02,ystep=.02] (0,0) grid (1,1);
\foreach \x in {0,1,...,9} { \node [anchor=north] at (\x/10,0) {0.\x}; }
\foreach \y in {0,1,...,9} { \node [anchor=east] at (0,\y/10) {0.\y}; }
\draw[red, ultra thick] #2 -- cycle;
\else
% Use the path to clip
\path[clip] #2 -- cycle;
\node[anchor=south west,inner sep=0pt] {\includegraphics[width=1.0\linewidth,keepaspectratio]{example-image-a}};
\fi
\end{scope}
\end{tikzpicture}
}
\begin{document}
\thispagestyle{empty}
\clippicture{[width=1.0\textwidth]{some-image}}{(0.359,0.268) -- (0.48,0.73) -- (0.52,0.73) -- (0.64,0.27) -- (0.60,0.27) -- (0.562,0.403) -- (0.43,.403) -- (0.395, 0.268) -- (0.359,0.268)}
\newpage
\thispagestyle{empty}
\tikzset{develop clipping path=false}
\begin{center}
\clippicture{[width=1.0\textwidth]{some-image}}{(0.359,0.268) -- (0.48,0.73) -- (0.52,0.73) -- (0.64,0.27) -- (0.60,0.27) -- (0.562,0.403) -- (0.43,.403) -- (0.395, 0.268) -- (0.359,0.268)}
\end{center}
\end{document}
출력:
질문: 내 클리핑 경로는 폐쇄 회로입니다. 따라서 생산량은 자본의 외부 부분입니다.ㅏ. 편지 추출을 완료하려면 어떻게 해야 하나요?ㅏ---또한 잘라내기---문자의 적절한 내부 부분ㅏ?
감사합니다.
답변1
경로에 시계 반대 방향으로 "A"의 내부 삼각형을 추가합니다("0이 아닌 규칙" 사용).
(0.359,0.268) -- (0.48,0.73) -- (0.52,0.73) -- (0.64,0.27) -- (0.60,0.27) -- (0.562,0.403) -- (0.43,.403) -- (0.395, 0.268) -- (0.359,0.268) (0.440,0.438) -- (0.555,0.438) -- (0.498,0.675) -- (0.44,0.44)
cycle
닫힌 경로를 만들 때 첫 번째 좌표를 반복하는 대신 사용하는 것이 좋습니다 . 이렇게 하면 경로가 다음과 같이 됩니다.
(0.359,0.268) -- (0.48,0.73) -- (0.52,0.73) -- (0.64,0.27) -- (0.60,0.27) -- (0.562,0.403) -- (0.43,.403) -- (0.395, 0.268) -- cycle (0.440,0.438) -- (0.555,0.438) -- (0.498,0.675) -- cycle