4

I have opened an image with this code:

this.imp = IJ.openImage(imageFilePath);
imp.show();

And now, I need to set the scaleBar. I need to set it after imp.show() because the user has to draw a line before (and later set the scale). But it only works before imp.show(). Can I put it after show or something similar? Do I need to invoke a refresh or update method?

Mihai Chelaru
  • 5,844
  • 14
  • 34
  • 43
David
  • 41
  • 2
  • How do you set the scaleBar? Share your code so we can help you. – Lorelorelore Nov 19 '18 at 14:17
  • If you include new ImageJ(); before you create the ImagePlus, an ImageJ window will be created, and can use the builtin imagej actions. Including analyze->tools->scale bar. – matt Nov 19 '18 at 15:14
  • Meanwhile, you asked [this question on the image.sc forum](https://forum.image.sc/t/setting-the-scalebar-with-java/20958?u=imagejan) where it is much better suited and already received replies. Please, when cross-posting like this, always link to other places where you asked, so that others don't waste their time with obsolete answers. – Jan Eglinger Nov 19 '18 at 15:17

0 Answers0