EDIT: actually this returns an img tag not just the URL so I don't think it's what you're looking for.
I had a similar problem recently and I couldn't find a out of box method for this so I just created my own macro method for it.
[MacroMethod(typeof(string), "Returns img tag from a guid", 1)]
[MacroMethodParam(0, "Image guid", typeof(string), "The image guid to convert into an img tag")]
[MacroMethodParam(1, "Image width", typeof(int), "The width int to size in, NULLABLE")]
[MacroMethodParam(2, "Image height", typeof(int), "The height int to size in, NULLABLE")]
public static object GetImageTagByGuid(EvaluationContext context, params object[] parameters)
{
object width = null;
object height = null;
if (parameters.Length > 1)
{
if (parameters[1] != null)
{
width = Convert.ToInt32(parameters[1]);
}
}
if (parameters.Length > 2)
{
if (parameters[2] != null)
{
height = Convert.ToInt32(parameters[2]);
}
}
string imgTag = CMS.DocumentEngine.Web.UI.CMSTransformation.Methods.GetImage("image-rendition", parameters[0], null, width, height);
// this part strips to just the url but it seems highly inefficient
imgTag = imgTag.Replace("<img src=/"", "").Replace("/"/>","");
return imgTag;
}
in order to use custom macro methods you'd have to switch to text/xml afaik. I don't think you can use custom macro methods in ascx but maybe I'm wrong