Login  Register

Re: How to draw String on image

Posted by Michael Schmid on May 22, 2007; 11:06am
URL: http://imagej.273.s1.nabble.com/How-to-draw-String-on-image-tp3699398p3699399.html

Hi Amol,

did you set the position where to draw the string?
   ipr.moveTo(x, y); ipr.drawString("Test");
or
   ipr.drawString("Test", x, y);


Michael
________________________________________________________________

On 22 May 2007, at 09:16, Amol Patil wrote:

> Hi ,
>
> I have one application which uses ImageJ library internally to  
> perform image
> modification operations.I have implement many operation like
>
> Zoom in zoom out,flip,drawrectangle.
>
> But when I use drawstring() method my program does not terminate  
> and also
> does not show excepted output.
>
> If anybody has done it please send me sample code here my sample  
> code which
> I am using for this operation.
>
>
>
> RankFilters filter = new RankFilters();
>
>             Opener open=new Opener();
>
>             ImagePlus image=open.openImage(fileName);
>
>             ImageProcessor ipr=image.getProcessor();
>
>             ipr.setInterpolate(true);
>
> ipr.drawString("Test");
>
>
>
> After that I am saving image.
>
> Please check this code Send me correct code.
>
> Thanks in advance
>
>