我使用Intellij作為IDE,使用Java作為編程語言。 我想在Intellij上加載圖片并把它們保存在一個專案的檔案夾中
。uj5u.com熱心網友回復:
你可以使用BufferedImage和ImageIO.read()來讀取影像:
BufferedImage image = null。
try {
image = ImageIO.read(new File("yourpath/name.png") 。)
} catch (IOException e) {
}
然后用ImageIO.write()保存它:
File outputfile = new File("yourpath/name. png")。)
ImageIO.write(image, "png"/span>, outputfile)。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/320503.html
標籤:
