答案1
像这样?
\documentclass[tikz,margin=5mm]{standalone}
\usepackage[most]{tcolorbox}
\tcbset
{
enhanced,
left=8mm,
right=8mm,
boxrule=0.4pt,
colback=red!5!white,
boxrule=1pt,
colframe=red!75!black,fonttitle=\bfseries,
width=(\linewidth-4pt)/2,
}
\begin{document}
\begin{tikzpicture}[]
\node[anchor=south west,inner sep=0] at (0,0)(pic) {\includegraphics[width=\textwidth]{example-image}};
\draw [ultra thick,red](current bounding box.north east) rectangle (current bounding box.south west);
\node at ([yshift=-2.5cm] pic.center)
{\begin{tcolorbox}
\centering ABC
\end{tcolorbox}};
\end{tikzpicture}
\end{document}
赋予一些不透明度tcolorbox
。
\documentclass[tikz,margin=5mm]{standalone}
\usepackage[most]{tcolorbox}
\tcbset
{
enhanced,
left=8mm,
right=8mm,
boxrule=0.4pt,
colback=red!5!white,
boxrule=1pt,
colframe=red!75!black,fonttitle=\bfseries,
width=(\linewidth-4pt)/2,
}
\begin{document}
\begin{tikzpicture}[]
\node[anchor=south west,inner sep=0] at (0,0)(pic) {\includegraphics[width=\textwidth]{example-image}};
\draw [ultra thick,red](current bounding box.north east) rectangle (current bounding box.south west);
\node[] at ([yshift=-1.25cm] pic.center)
{\begin{tcolorbox}[
standard jigsaw,
opacityback=0.2, % this works only in combination with the key "standard jigsaw"
]
\centering ABC
\end{tcolorbox}};
\end{tikzpicture}
\end{document}