Login  Register

Re: Text justification in text ROIs

Posted by Johannes Weissmann on Jun 07, 2011; 8:40am
URL: http://imagej.273.s1.nabble.com/Text-justification-in-text-ROIs-tp3684315p3684317.html

On 07.06.2011 10:34, Jan Eglinger wrote:

> Dear all,
>
> is it possible to have Text ROIs centered or right-justified?
>
> I know of the macro functions setJustification("center") and
> drawString("line\nbreak", x, y), but I would like to have a multi-line
> text selection centered without the need of using macros, if possible.
>
> Thanks,
> Jan

Hi,
yes it is possible. Here's a line of code I use:

   ip.setJustification(ImageProcessor.LEFT_JUSTIFY);

This sets the justification for all TextROIs that are drawn afterwards.

Jo

--
Johannes Weissmann

Nedre Ferstadveg 26 | 7023 Trondheim
mail: [hidden email]
fon: +47 45 124 191

"The truth, as always, will be far stranger." [Sir Arthur C. Clarke]