1
我想添加一個比例尺到ImagePlus,但我不能。當我使用Windows我用下面的命令:ImageJ,添加一個比例尺到ImagePlus
IJ.selectWindow("window_name");
IJ.run("Set Scale...", "distance=1 known="+pixelSize+" pixel=1 unit=um");
IJ.run("Scale Bar...", "width="+barSize+" height=3 font=12 color=Black location=[Upper Right]");
我希望有人能幫助我,我讓待觀察代碼:
String name = "example.jpg";
ImagePlus cRoiDuplicated = this.cROI.duplicate();
cRoiDuplicated.setTitle(name);
if (barSize != -1){
[Code]
/*IJ.run("Set Scale...", "distance=1 known="+pixelSize+" pixel=1 unit=um");
IJ.run("Scale Bar...", "width="+barSize+" height=3 font=12 color=Black location=[Upper Right]");*/
}
FileSaver fs = new FileSaver(cRoiDuplicated);
fs.saveAsJpeg(this.directory + name);
cRoiDuplicated.close();
謝謝,你幫了大忙。我剛剛測試過,它的工作原理。 – SolidusAbi