开发者

Can a BufferedImage be written to file any format?

开发者 https://www.devze.com 2022-12-24 21:32 出处:网络
Is it correct that if we have a BufferedImage object in java, we could potentially write开发者_JAVA百科 it out in ANY format using ImageIO.write (if we have a Writer object for the same)? I tried writ

Is it correct that if we have a BufferedImage object in java, we could potentially write开发者_JAVA百科 it out in ANY format using ImageIO.write (if we have a Writer object for the same)? I tried writing a BufferedImage object into a jpg file, it outputted an empty image file however when i tried writing it in to a png file, it worked fine.


A BufferedImage can be written into any format that ImageIO.write supports (that is, has an ImageWriter available), yes. Please show the code if you can't get it to work.

0

精彩评论

暂无评论...
验证码 换一张
取 消