Login  Register

Re: Adding text "Destructively" to the image

Posted by CARL Philippe (LBP) on Feb 03, 2016; 3:38pm
URL: http://imagej.273.s1.nabble.com/Adding-text-Destructively-to-the-image-tp5015530p5015532.html

Dear David,
You can permanently add the selection to the picture through Edit->Draw
(Ctrl+D) or if you prefer in java: IJ.run(imp, "Draw", "slice");
My best regards,
Philippe

-----Message d'origine-----
De : ImageJ Interest Group [mailto:[hidden email]] De la part de
davek604
Envoyé : mercredi 3 février 2016 16:07
À : [hidden email]
Objet : Adding text "Destructively" to the image

Hello

I'm writing a plugin to add text permanently to an image. It forms part of a
loop which moves through an image stack adding numbers (as text) where
required. I'm using the code below to add the text

               String TheText = Integer.toString(count);
        Font font = new Font("SansSerif", Font.PLAIN, 9);
        TextRoi roi = new TextRoi(Xval, Yval, TheText, font);
        roi.setStrokeColor(Color.white);
        Overlay overlay = new Overlay();
        overlay.add(roi);
        Dupimp.setOverlay(overlay);

This adds the text as an overlay which can't then be made part of the image.
The Draw command will do this but the text would have to be a selection
which I can't work out how to do. Any suggestions as to how I can make the
text permanent would be appreciated.

Regards

David  



--
View this message in context:
http://imagej.1557.x6.nabble.com/Adding-text-Destructively-to-the-image-tp50
15530.html
Sent from the ImageJ mailing list archive at Nabble.com.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html