Login  Register

Re: Text Roi

Posted by Abdul Muqeet Khan on Nov 07, 2007; 5:46am
URL: http://imagej.273.s1.nabble.com/Text-Roi-tp3698062p3698063.html

Rois gets flickered when i say updateAndDraw() after drawString. I m doing in this way
  class ImageCanvas
   
  showAllROIs(Graphics g) {
  ....
  ...
  if(textRoi) {
  imp.getProcessor().drawString("ImageJ", roi.x, roi.y);
  imp.updateAndDraw();
  } else {
  drawRoi(g, roi, i);
  }
   
  Thanks in advance
 

Wayne Rasband <[hidden email]> wrote:
  On Nov 6, 2007, at 4:27 AM, MUQEET KHAN wrote:

> Without using the text roi how could one write/draw text on the image.
> Can i use
> imp.getProcessor().drawString("TEXT", x, y); but this doesn't work.

You have to also update the display using imp.updateAndDraw().

-wayne

>
> When the user clicks on the image canvas i open a dialog box and asks
> the user to enter the text. I have the text and would like to draw
> this text on the image. Using text roi is the text in a rectangle, and
> looks its not simple doing in this way.
>
> Help is needed. Thanks in advance
>
> Wayne Rasband wrote: The text is not stored in the .roi
> file. You can work around this
> problem by using macros. For example, here is a macro tool that
> replaces the built in text tool.
>
> // This tool draws text when the user
> // clicks on the image. Double click on
> // the tool icon to change the text.
> var size = 18;
> var text = "This is some text";
> macro "Text Tool - C00fT4e16T" {
> getCursorLoc(x, y, z, flags);
> setFont("SansSerif", size, "bold");
> drawString(text, x, y);
> }
> macro "Text Tool Options" {
> text = getString("Text: ", text);
> }
>
> -wayne
>
>
> On Oct 31, 2007, at 11:59 PM, MUQEET KHAN wrote:
>
>> I am using text annotation and drawing some text on the image. Problem
>> is when i am saving the text roi and trying to load it again it shows
>> the rectangle roi instead of the text. Firstly does the text gets
>> stored
>> in the .roi file and if yes what i need to do if i would like to
>> reload it on the image.
>>
>> Thanks in advance
>> __________________________________________________
>> Do You Yahoo!?
>> Tired of spam? Yahoo! Mail has the best spam protection around
>> http://mail.yahoo.com
>>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>



 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com