主要是我对JAVA比较新鲜。我被一些代码卡住了。我想通过按钮将图像捕获直接保存在特定文件夹中。到目前为止,我正在使用文件选择器来保存我的图像我想保存图像C:\temp
,文件名可以是图像,图像 1,图像 2,按升序排列
int returnVal = jFileChooser1.showSaveDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION)
{
File file = jFileChooser1.getSelectedFile();
Highgui.imwrite(file.getPath(), frame);
} else {
System.out.println("file access cancelled by user.");
}