Re: adding text to stacks and movies?

Posted by Prashant-2-3 on
URL: http://imagej.273.s1.nabble.com/ImageJ-mean-grey-value-tp3694287p3694292.html

Hi Frank ,

         I have done it for me.
         I am just taking graphics from image and then drawing string in
that graphics mode.
        Then i saved images in jpeg format.
        The jpeg image consist of my string at location 50,50.

        same thing you can do for movie also because you have array of
images.
        i think it will help you.
        Here imp is a ImagePlus object.

try

{

BufferedImage bimg = null;

Image img = imp.getImage();

int w = img.getWidth(null);

int h = img.getHeight(null);

bimg = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);

Graphics2D gg = bimg.createGraphics();

gg.drawImage(img, 0, 0, img.getWidth(null), img.getHeight(null), null);

gg.dispose();

////it writes into image that it is save from medsynaptic

gg.drawString(""Hello text added",50,50);

int ind = name.lastIndexOf(".");

if (ind > 0)

{

String temp = name.substring(0, ind);

File fi = new File(dir + File.separator + temp + ".JPEG");

ImageIO.write(bimg, "jpg", fi);

bimg = null;

img = null;

}

}







----- Original Message -----
From: "Franklin Shaffer" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, December 04, 2008 3:00 AM
Subject: adding text to stacks and movies?


Would someone be so kind as to point me to instructions on how to add
text to a stack of images or a movie?

I've done some web searching and scanned through the ImageJ
documentation, but had no luck.

Much thanks!

Frank Shäffer
Senior Research Engineer
USDOE National Energy Technology Laboratory