2、辅图像
@Override
public void actionPerformed(ActionEvent arg0) {
BMP bmp = new BMP(
\and Settings/Administrator/桌
button2.addActionListener(new ActionListener() {
面/数据/image_as_800x800.bmp\);
jtf3.setText(bmp.getWidth() + \); jtf4.setText(bmp.getHeight() + \); bmp.showBMP();
- 23 -
}
});
辅图像显示如下:
三、图像显示区域。
建立Frame。创建一个对话框应用程序,命名SAR01。在MFC AppWizard-Step中选择MFC AppWizard(exe),然后选择”Dialog based(对话框模式)”一项,其余则一直按照默认到最后单击按钮”Finish”。在完成了以上步 骤后,一个叫SAR01的文件建立了。然后我们就可以根据我们的需要来添加按钮、编辑框等控件,直到做出基础的主界面对话框。
1、在图像处理和输出点击预滤波内的“执行过程”,执行完毕后点击“显示结果”显示图片。
处理图片的类BMP.java,代码
- 24 -
public void showBMP() { }
SwingUtilities.invokeLater(new Runnable() {
public void run() { }
new BMP(getBmpFile()).setVisible(true);
public BMP(String bmpFile) { }
super(\); this.bmpFile = bmpFile; Image image = null; try { }
JLabel label = new JLabel(new ImageIcon(image)); add(label);
setDefaultCloseOperation(EXIT_ON_CLOSE); pack();
image = ImageIO.read(new File(bmpFile)); } catch (IOException ex) { public String getBmpFile() { }
return bmpFile; private String bmpFile;
//
});
在“显示结果”添加监听事件,代码如下
innerP1B1.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
new BMP(
\and Settings/Administrator/桌面/数据
/image_fil_IN_800x800.bmp\)
- 25 -
}
.showBMP();
});
显示出图片:
图4.1预滤波后图像
2、在图像处理和输出点击“配准区域”的“执行过程”,执行完毕后点击“显示结果”,显示图片。
innerP3B1.addActionListener(new ActionListener() {
new BMP(
\and Settings/Administrator/桌面/数据.showBMP();
- 26 -
@Override
public void actionPerformed(ActionEvent arg0) {
/image_IN_800x800.bmp\)
} });
\and Settings/Administrator/桌面/数据.showBMP();创建BMP对象,并显示。
addActionListener添加事件监听。new BMP(
/image_IN_800x800.bmp\)
图4.2配准后图像
3、在图像处理和输出点击“干涉图滤波”的“显示结果”,显示图片。 innerP5B.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
new BMP(
\and Settings/Administrator/桌面/数据
/image_fil_IN_fil_800x800.bmp\)
- 27 -