I'm trying to place an image in the background using TikZ layers but as soon as I enable the layers option, everything in the background layer disappears. I have no idea why. I found some hints about the main layer but this problem seems to be with the background layer. I also tried the backgrounds library. Same problem. (I've had success with layers on this same machine before but I'm no expert.)
\begin{tikzpicture}
\usetikzlibrary{arrows,positioning,fit}
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
\tikzstyle{userblock}=[draw,rectangle,fill=gray!15,minimum height=4em,minimum width=4em, node distance=6em];
\tikzstyle{tasklabels}=[node distance=5em];
\tikzstyle{compblock}=[draw=blue, fill=blue!15,node distance=5em, minimum height=4em, minimum width=20em, inner sep=1em];
\node[userblock] (u1) {user$_1$} ;
\node[userblock,right of=u1] (u2) {user$_2$} ;
\node[userblock, draw=none,fill=none,right of=u2] (udots) {\ldots} ;
\node[userblock,right of=udots] (un) {user$_n$} ;
\node[tasklabels,below of=u1] (l1) {compiler}
edge [<->] (u1);
\node[tasklabels, below of=u2] (l2) {assembler}
edge [<->] (u2) ;
\node[tasklabels, below of=udots] (ldots) {...}
;
\node[tasklabels, below of=un] (ln) {database system}
edge [<->] (un) ;
\begin{pgfonlayer}{background}
\node[compblock,fit=(l1)(ln)] (L1) {System and Application Programs}
edge [-,dashed] (l1)
edge [-,dashed] (l2)
edge [-,dashed] (ln) ;
\node[compblock,below of=L1] (L2) {Operating System}
edge [<->] (L1) ;
\node[compblock,below of=L2] (L3) {Computer Hardware}
edge [<->] (L2) ;
\end{pgfonlayer}
\end{tikzpicture}
usetikzlibraryout of thetikzpictureenvironment solved it. – recluze Jan 15 '12 at 15:57