\useMPlibrary[dum]

\starttext

\startuseMPgraphic{x}
    draw textext("\externalfigure[foo.pdf]") ;
\stopuseMPgraphic

\useMPgraphic{x}

\startMPcode
    draw externalfigure "foo.pdf" xysized (3cm,3cm) ;
\stopMPcode

\stoptext
