You can access the height, depth and width of a (La)TeX box register using \ht\mybox, \dp\mybox and \dp\mybox, respectively, where \mybox is a box defined using \newsavebox{\mybox}. If you need these dimension as text you can convert them by placing a \the in front of it.
However, with the picture environment you need to state the dimensions as multiple of the \unitlength, so you need to divide this values by that amount, which isn't that easy because TeX doesn't provide a direct way to divide a length by a length. But you could use the internal scaling macro used by graphicx:
\documentclass{article}
\newsavebox{\mybox}
\usepackage{graphicx}
\usepackage{calc}
\makeatletter
\newcommand{\scaletoul}[2]{%
\setlength\@tempdima{#2}%
\Gscale@div{#1}{\@tempdima}{\unitlength}%
}
\makeatother
\begin{document}
\sbox{\mybox}{come content}
\setlength{\unitlength}{1pt}
\scaletoul{\mywidth}{\wd\mybox}
\scaletoul{\mytotalheight}{\ht\mybox+\dp\mybox}
\frame{% just to see the dimensions
\begin{picture}(\mywidth, \mytotalheight)(0,0)
\put (0,0) {\raisebox{\dp\mybox}{\usebox{\mybox}}}
\end{picture}%
}
\end{document}
Please not that the picture environment can be considered outdated. For new diagrams using either TikZ or PSTricks is recommended. There you don't have to define the size yourself and also can provide all dimensions directly without having them to scale to \unitlength. See e.g. Drawing on an image with TikZ for an example.
pictureis outdated.;-)Thepicturepackage allows for explicit dimensions in the argument of macros in thepictureenvironment. – egreg Feb 07 '13 at 18:43