I want to develop an Windows Forms Application developed with JAVA (pure Java. Required for external reasons: no plugin, no macro) to use ImageJ library.
This application opens an image from hard disk and the user has to draw a line in the image (it would ve the knowed distance). Now, I want from java code to set the scale and to show the scaleBar in the image. The problem is that scalebar is not showing in the image. I have this code:
ImageJ imageJApplication = new ImageJ(2);
this.imp = IJ.openImage(file);
new ij.gui.WaitForUserDialog(“Draw a Line”).show();
IJ.run( “Set Scale…”, “known=5 pixel=1 unit=cm”);
IJ.run( “Scale Bar…”, “width=6 height=4 font=14 color=White background=None location=[Lower Right] bold”);
The scaleBar never showing…But if i test the code like a macro it works!!
Please can you help me? I am new in ImageJ
Sorry for my English…