JPanel jp=new JPanel();
JButton[] jb=new JButton[]
{new JButton("加强边缘"),new JButton("锐化"),
new JButton("模糊"),new JButton("浮雕")};
//创建文件选择器
JFileChooser jfc=new JFileChooser();
//创建表示不同滤镜的卷积矩阵数组
float[][] data =
{//加强边缘
{0f,-1f,0f,
-1f,5f,-1f,
0f,-1f,0f},
//锐化
{-0.125f,-0.125f,-0.125f,
-0.125f,2f,-0.125f,
-0.125f,-0.125f,-0.125f},
//模糊
{0.09375f,0.09375f,0.09375f,
0.09375f,0.25f,0.09375f,
0.09375f,0.09375f,0.09375f},
//浮雕
{2f,0f,2f,
0f,0f,0f,
2f,0f,-5f}
};
ImageIcon ii; //定义一个图标引用
public ImageManipulation()
{
//初始化文件选择器
this.initFileChooser();
//打开文件选择器并获取图象
ii=this.chooserFile();
//初始化窗体
this.initFrame();
//初始化各种控件
this.initComponent();
}
//按扭的之间处理方法
|