Login  Register

Re: Filled Background when drawing a string

Posted by Rasband, Wayne (NIH/NIMH) [E] on Jun 13, 2011; 4:25pm
URL: http://imagej.273.s1.nabble.com/Filled-Background-when-drawing-a-string-tp3684237p3684242.html

On Jun 13, 2011, at 8:08 AM, Johannes Weissmann wrote:

> Hi,
> I was wondering if there is a possiblility to set a background color
> when drawing a string using the functions of an image processor.
> Currently I am using a line like
>
> ip.drawString(string);
>
> I have to update the text several times and tried to avoid creating a
> TextRoi all the time. Does anyone know a quick solution or do I have to
> use TextROIs?

There is an example macro at

   http://imagej.nih.gov/ij/macros/examples/DrawTextWithBackground.txt

that demonstrates how to draw text with a filled background.

-wayne