add filename to the image

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

add filename to the image

Martin Höhne
I guess there is the possibility to automatically add the filename to the image (comparable to a scale bar). Either to the image itself or as an overlay. I could not find a solution for this (which is indicative of my beginner status).
Has anyone already a solution for this? Or a hint where to look for it?

Thanks,
Martin
Reply | Threaded
Open this post in threaded view
|

Re: add filename to the image

Rasband, Wayne (NIH/NIMH) [E]
On Feb 10, 2011, at 9:11 AM, Martin Höhne wrote:

> I guess there is the possibility to automatically add the filename to the
> image (comparable to a scale bar). Either to the image itself or as an
> overlay. I could not find a solution for this (which is indicative of my
> beginner status).
> Has anyone already a solution for this? Or a hint where to look for it?

Here is a macro that adds the filename to the image as an overlay. Add it to the StartupMacros file and you will be able to add the filename by pressing "1".

 macro "Add Filename [1]" {
    fontSize = 18;
    x = 10;
    y = fontSize;
    setColor("white")
    setFont("SansSerif", fontSize);
    name = getInfo("image.filename");
    Overlay.remove;
    Overlay.drawString(name, x, y);
    Overlay.show;
 }

-wayne