⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filesave.java

📁 最近去看監視器材,看到他們的監視軟體 就突發奇想自己來寫一個看看 程式會把移動中的物體用綠色框框起來 並且把當時的影像存成jpg檔(我把這個功能註解起來了) 我這個程式是在Ultr
💻 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 + -