如何旋转带框的图像?

如何旋转带框的图像?

如何旋转带框的图像?以下代码是否可以旋转不带框的图像?

谢谢

\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{graphicx}

\begin{document}
\begin{titlepage}

\begin{tikzpicture}[overlay, remember picture]
\node[anchor=north west, %anchor is upper left corner of the graphic
      xshift=8.5cm, %shifting around
      yshift=-16cm] 
     at (current page.north west) %left upper corner of the page
     {\includegraphics[
         trim   = {1 1 1 1}, clip, 
         width  = 10.5cm, 
         rotate = 4, 
         angle  = 0.35, 
         frame]{Image.png}}; 

\end{tikzpicture}
\end{titlepage}
\end{document}

答案1

传递的键是按顺序执行的*,因此frame之前进行简单的改组trim就足够了。

传递边距键纯粹是为了说明目的。您可以在最终版本中省略它。

\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{graphicx}

\begin{document}
    \begin{titlepage}
        \begin{tikzpicture}[overlay, remember picture]
        \node[anchor=north west, %anchor is upper left corner of the graphic
        xshift=8.5cm, %shifting around
        yshift=-16cm] 
        at (current page.north west) %left upper corner of the page
        {\includegraphics[
            margin = 1pt, % <------- Just to show the frame
            frame, % <---------- Execute this first
            trim   = {1 1 1 1}, clip, 
            width  = 10.5cm, 
            rotate = 4, 
            angle  = 0.35
            ]{example-image}}; 
        \end{tikzpicture}
    \end{titlepage}
\end{document}

给出

框架已旋转

*并非所有键都按顺序执行,trim例如,始终对原始内容起作用。有关adjustbox更多详细信息,请参阅文档。

答案2

也许rotatebox可以使用简单的武器代替重型tikz武器?

\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{graphicx}

\begin{document}
\begin{titlepage}

{
    \setlength{\fboxsep}{0pt}
    \rotatebox{4}{%
        \fbox{%
            \includegraphics[%
           trim   = {1 1 1 1}, clip, 
           width  = 10.5cm, 
            ]{example-image}%
        }%
    }%
}

\end{titlepage}
\end{document}

在此处输入图片描述

相关内容