Perhaps the question is unclear. I know how to put a tikzpicture inside a box. I made it in this question like this
\newsavebox{\mycandle}
\savebox{\mycandle}{%
\begin{tikzpicture}[scale=.1]
...
\end{tikzpicture}
}
But in this case I put a box (\pgfpicperhaps it's the final box) into a box and I would like to know if it's possible to save the final box when \endtikzpicture arrives.
I'm not sure but I think the good box is \pgfpic. In the file pgfcorescopes.code.tex and at the end of the macro \endpgfpicture, I found \pgfsys@endpicture and then \pgfsys@typesetpicturebox\pgfpic. Th first seems to depend of the driver and I don't understand the code and for the second macro \pgfsys@typesetpicturebox the definition is inside the file pgfsys.code.tex
Here the code of this macro :
\def\pgfsys@typesetpicturebox#1{%
\pgf@ya=\pgf@shift@baseline\relax%
\advance\pgf@ya by-\pgf@picminy\relax%
%
%
\advance\pgf@picmaxy by-\pgf@picminy\relax% maxy is now the height
\advance\pgf@picmaxx by-\pgf@picminx\relax% maxx is now the width
\setbox#1=\hbox{\hskip-\pgf@picminx\lower\pgf@picminy\box#1}%
\ht#1=\pgf@picmaxy%
\wd#1=\pgf@picmaxx%
\dp#1=0pt%
\leavevmode%
\pgf@xa=\pgf@trimleft@final\relax \ifdim\pgf@xa=0pt \else\kern\pgf@xa\fi
\raise-\pgf@ya\box#1%
\pgf@xa=\pgf@trimright@final\relax \ifdim\pgf@xa=0pt \else\kern\pgf@xa\fi
}
But I don't understand the comment about this macro :
% Called after a picture has been typeset in box #1. This % command should insert the box into the normal TeX code. The box #1 % will still be a ``raw'' box that contains only the \special's. The % job of this command is to resize and shift this box according to the % baseline shift and the size of the box. % % This command has a default implementation.
Well I'm lost in all these codes and I'm not sure if what I want is possible. Perhaps it's a bad idea.
spylibrary has a box\copyapplication which may be inspiring for you. – percusse May 12 '12 at 17:36path pictureoption. If you look at the manual forpath pictureit's a little bit easier to understand the motivation. – percusse May 12 '12 at 18:13