我试图从默认的像素数组中制作图像。但每次增加图像的宽度和高度时都会发生异常。 我认为没有。像素的大小必须等于图像的宽度和高度。 任何建议......
try{
BufferedImage writeImage=new BufferedImage(512,512,BufferedImage.TYPE_INT_ARGB);
File outputfile = new File("C://Users//GamingPC//Desktop//out11.png");
WritableRaster raster = (WritableRaster)writeImage.getData();
raster.setPixels(0, 0,temp , temp, pixel);
writeImage.setData(raster);
ImageIO.write(writeImage, "png", outputfile);
}
catch (IOException ex) {}