\begin{tikzpicture}
\node[regular polygon, path picture={
\node at (path picture bounding box.center)
{ \rule{4cm}{3cm} };
}
,minimum width=2.5cm,minimum height=2cm] {};
\end{tikzpicture}
instead of \rule{width}{height} you can use a \includegraphics command.
For a rectangle be aware that you have to set the minimum width and minimum height the same size as the picture otherwise a white border will remain.

Keine Kommentare:
Kommentar veröffentlichen