영화 필름 스트립 이미지

영화 필름 스트립 이미지

포함된 PDF 이미지로 영화 필름 스트립을 만들 수 있습니까?

스트립 1

답변1

필름 스트립

\documentclass{article}

\usepackage{color,graphicx}

\newcommand{\whitebox}{\hfill\textcolor{white}{\rule[1mm]{1.8mm}{2.8mm}}\hfill}
\newcommand{\filmbox}[1]{%
    \setlength{\fboxsep}{0pt}%
    \colorbox{black}{%
        \begin{minipage}{3.2cm}
            \rule{0mm}{4.8mm}\whitebox\whitebox\whitebox\whitebox\whitebox%
            \whitebox\whitebox\whitebox\whitebox\null\\%
            \null\hfill\includegraphics[width=3cm]{#1}\hfill\null\\[1mm]%
            \null\whitebox\whitebox\whitebox\whitebox\whitebox%
            \whitebox\whitebox\whitebox\whitebox\null
        \end{minipage}}}

\begin{document}

\noindent
\filmbox{1}\filmbox{2}\filmbox{3}\\
\filmbox{4}\filmbox{5}\filmbox{6}

\end{document}

SDrolet이 지적했듯이 포함된 사진의 화면 비율이 다른 경우 프레임이 고르지 않게 됩니다. 이 문제는 두 가지 방법으로 해결할 수 있습니다.

  • SDrolet의 솔루션을 사용하여 특정 크기로 트리밍합니다. 이는 그림의 일부를 잃는 것을 의미합니다.
  • 의 정의에 height옵션을 추가하여 특정 크기로 확장합니다 . 이는 그림을 왜곡한다는 의미입니다.\importgraphics\filmbox

답변2

Jonas Granholm은 영리한 솔루션을 제공했습니다. 그러나 이미지의 크기가 동일하지 않으면 동영상 스트립이 고르지 않게 됩니다(예: 아래 첫 번째 동영상 필름 스트립). "adjustbox" 패키지(Martin Sharrer)와 Amaru/Paul Gaborit가 제공한 코드는 해당 문제를 해결하는 데 도움이 됩니다(예: 아래 두 번째 영화 필름 스트립). 최종 코드는 다음과 같습니다.

\documentclass{book}

\usepackage{color}
\usepackage{graphicx}
\usepackage{adjustbox} %  Martin Sharrer package
\usepackage{calc}
\usepackage{ifthen}

% % % Method to adjust images to the same dimensions
% % % By Amaru / Paul Gaborit / based on Martin Sharrer package "adjustbox" http://tex.stackexchange.com/questions/60918/how-to-scale-and-then-trim-an-image/61073#61073

\newlength{\oH}
\newlength{\oW}
\newlength{\rH}
\newlength{\rW}
\newlength{\cH}
\newlength{\cW}

\newcommand\ClipImage[3]{% width, height, image
\settototalheight{\oH}{\includegraphics{#3}}%
\settowidth{\oW}{\includegraphics{#3}}%
\setlength{\rH}{\oH * \ratio{#1}{\oW}}%
\setlength{\rW}{\oW * \ratio{#2}{\oH}}%
\ifthenelse{\lengthtest{\rH < #2}}{%
    \setlength{\cW}{(\rW-#1)*\ratio{\oH}{#2}}%
    \adjincludegraphics[height=#2,clip,trim=0 0 \cW{} 0]{#3}%
}{%
    \setlength{\cH}{(\rH-#2)*\ratio{\oW}{#1}}%
    \adjincludegraphics[width=#1,clip,trim=0 \cH{} 0 0]{#3}%
}%
}


% %
% % Explanation for movie film strip cells: 
% %
% %  The basic cell is made of a black colorbox (colorbox).
% %              \colorbox{color}{text} : same color as \textcolor{color}{text}
% %  Multiple lines of text can be placed inside a colorbox providing that they are included in a minipage of a specified width.
% %              \begin{minipage}{width} text \end{minipage}
% %  The first and last lines of text are composed of nine small colored (white) rules (boxes) equally spaced with \hfill. The color of each rule is the same as the textcolor.
% %              \textcolor{color}{text}
% %              \rule[depth]{width}{height}
% %              \null is the same as \hbox{} and it can be used for a material which reserves no space but shows TeX that there is a box which is taken into account for typesetting (Herbert: http://tex.stackexchange.com/questions/24919/what-is-null-and-when-do-we-need-to-use-it)
% %
% %
% %

\newcommand{\whitebox}{\hfill\textcolor{white}{\rule[1mm]{1.8mm}{2.8mm}}\hfill}

\newcommand{\SetColorForColoredSmallBoxes}[1]{ %
\def\ColoredSmallBox{\hfill\textcolor{#1}{\rule[1mm]{1.8mm}{2.8mm}}\hfill}}

\SetColorForColoredSmallBoxes{red}

\newcommand{\filmbox}[1]{%  ( Jonas Granholm )
    \setlength{\fboxsep}{0pt}%
    \colorbox{black}{%
        \begin{minipage}{3.2cm}
            \rule{0mm}{4.8mm}\whitebox\whitebox\whitebox\whitebox\whitebox%
            \whitebox\whitebox\whitebox\whitebox\null\\%
            \null\hfill\includegraphics[width=3cm]{#1}\hfill\null\\[1mm]%
            \null\whitebox\whitebox\whitebox\whitebox\whitebox%
            \whitebox\whitebox\whitebox\whitebox\null
        \end{minipage}}}

\newcommand{\filmboxClipImage}[1]{%
    \setlength{\fboxsep}{0pt}%
    \colorbox{black}{%
        \begin{minipage}{3.2cm}
            \rule{0mm}{4.8mm}
            \ColoredSmallBox\whitebox\ColoredSmallBox\whitebox\ColoredSmallBox
            \whitebox\ColoredSmallBox\whitebox\ColoredSmallBox\null\\%
            \null\hfill\ClipImage{3cm}{3cm}{#1}\hfill\null\\[1mm]%
            \null\whitebox\whitebox\whitebox\whitebox\whitebox%
            \whitebox\whitebox\whitebox\whitebox\null
        \end{minipage}}}

\begin{document}

\noindent
\filmbox{First-rectangle}\filmbox{Second-rectangle}\filmbox{Third-rectangle}\\

\noindent
\filmboxClipImage{First-rectangle}\filmboxClipImage{Second-rectangle}\filmboxClipImage{Third-rectangle}\\

\end{document}

여기에 이미지 설명을 입력하세요

답변3

Jonas Granholm이 제안한 수정 사항을 포함한 최종 코드는 다음과 같습니다.

\documentclass{book}

\usepackage{color}
\usepackage{graphicx}
\usepackage{adjustbox} %  Martin Sharrer package
\usepackage{calc}
\usepackage{ifthen}

% % % Method to adjust images to the same dimensions
% % % By Amaru / Paul Gaborit / based on Martin Sharrer package "adjustbox" http://tex.stackexchange.com/questions/60918/how-to-scale-and-then-trim-an-image/61073#61073

\newlength{\oH}
\newlength{\oW}
\newlength{\rH}
\newlength{\rW}
\newlength{\cH}
\newlength{\cW}

\newcommand\ClipImage[3]{% width, height, image
\settototalheight{\oH}{\includegraphics{#3}}%
\settowidth{\oW}{\includegraphics{#3}}%
\setlength{\rH}{\oH * \ratio{#1}{\oW}}%
\setlength{\rW}{\oW * \ratio{#2}{\oH}}%
\ifthenelse{\lengthtest{\rH < #2}}{%
    \setlength{\cW}{(\rW-#1)*\ratio{\oH}{#2}}%
    \adjincludegraphics[height=#2,clip,trim=0 0 \cW{} 0]{#3}%
}{%
    \setlength{\cH}{(\rH-#2)*\ratio{\oW}{#1}}%
    \adjincludegraphics[width=#1,clip,trim=0 \cH{} 0 0]{#3}%
}%
}


% %
% % Explanation for movie film strip cells: 
% %
% %  The basic cell is made of a black colorbox (colorbox).
% %              \colorbox{color}{text} : same color as \textcolor{color}{text}
% %  Multiple lines of text can be placed inside a colorbox providing that they are included in a minipage of a specified width.
% %              \begin{minipage}{width} text \end{minipage}
% %  The first and last lines of text are composed of nine small colored (white) rules (boxes) equally spaced with \hfill. The color of each rule is the same as the textcolor.
% %              \textcolor{color}{text}
% %              \rule[depth]{width}{height}
% %              \null is the same as \hbox{} and it can be used for a material which reserves no space but shows TeX that there is a box which is taken into account for typesetting (Herbert: http://tex.stackexchange.com/questions/24919/what-is-null-and-when-do-we-need-to-use-it)
% %
% %
% %

\newcommand{\whitebox}{\hfill\textcolor{white}{\rule[1mm]{1.8mm}{2.8mm}}\hfill}

\newcommand{\SetColorForColoredSmallBoxes}[1]{%
\def\ColoredSmallBox{\hfill\textcolor{#1}{\rule[1mm]{1.8mm}{2.8mm}}\hfill}}

\SetColorForColoredSmallBoxes{red}

\newcommand{\filmbox}[1]{%  ( Jonas Granholm )
    \setlength{\fboxsep}{0pt}%
    \colorbox{black}{%
        \begin{minipage}{3.2cm}
            \rule{0mm}{4.8mm}\whitebox\whitebox\whitebox\whitebox\whitebox%
            \whitebox\whitebox\whitebox\whitebox\null\\%
            \null\hfill\includegraphics[width=3cm]{#1}\hfill\null\\[1mm]%
            \null\whitebox\whitebox\whitebox\whitebox\whitebox%
            \whitebox\whitebox\whitebox\whitebox\null
        \end{minipage}}}

\newcommand{\filmboxClipImage}[1]{%
    \setlength{\fboxsep}{0pt}%
    \colorbox{black}{%
        \begin{minipage}{3.2cm}
            \rule{0mm}{4.8mm}%
            \ColoredSmallBox\whitebox\ColoredSmallBox\whitebox\ColoredSmallBox
            \whitebox\ColoredSmallBox\whitebox\ColoredSmallBox\null\\%
            \null\hfill\ClipImage{3cm}{3cm}{#1}\hfill\null\\[1mm]%
            \null\whitebox\whitebox\whitebox\whitebox\whitebox%
            \whitebox\whitebox\whitebox\whitebox\null
        \end{minipage}}}

\begin{document}

\noindent
\filmbox{First-rectangle}\filmbox{Second-rectangle}\filmbox{Third-rectangle}\\

\noindent
\filmboxClipImage{First-rectangle}\filmboxClipImage{Second-rectangle}\filmboxClipImage{Third-rectangle}\\

\end{document}

여기에 이미지 설명을 입력하세요

관련 정보