📄 filesave.java
字号:
import java.io.*;
import javax.imageio.ImageIO;
import java.awt.image.*;
public class fileSave
{
private final String JPGfileName="0000";
public fileSave(BufferedImage exeImage)
{
int count=0;
String s;
boolean checkFileName=true;
do
{
s=JPGfileName + String.valueOf(count);
s=s.substring(s.length() - JPGfileName.length());
s = "capture"+s+".jpg";
try
{
FileInputStream fileinputstream = new FileInputStream(s);
fileinputstream.close();
checkFileName = true;
}catch(FileNotFoundException filenotfoundexception)
{
checkFileName=false;
}catch(IOException ioexception){
System.err.println("Exception:\n" + ioexception);
}
count++;
}while(checkFileName);
try
{
File file = new File(s);
ImageIO.write(exeImage, "jpg", file);
}catch(IOException ioexception){}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -