java中int像素数组转bmp
如何从包含像素的 int 数组(来自 PixelGrabber 类的 getPixel() )在 java 中创建新的 bmp 图像?
谢谢
How do i create new bmp image in java from int array that contains pixels (from getPixel() of pixelGrabber class) ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
制作 BufferedImage 并调用 setPixel。
BufferedImage: http://download. oracle.com/javase/1.4.2/docs/api/java/awt/image/BufferedImage.html
如果你想要 BMP 文件,那么你可以使用 ImageIO.write(bufferedImage,"BMP", new File(" mybmp.bmp"));
我会给你 ImageIO 类的链接,但 Stack Overflow 阻止我发送垃圾邮件。
Make a BufferedImage and call setPixel.
BufferedImage: http://download.oracle.com/javase/1.4.2/docs/api/java/awt/image/BufferedImage.html
If you want BMP file then you can use ImageIO.write(bufferedImage,"BMP", new File("mybmp.bmp"));
I would give you the link to ImageIO class but Stack Overflow is preventing me from spamming.
在 Kotlin 中:
以 ARGB 格式保存位图可能会出现问题,请参阅:ImageIO。写bmp不行
In Kotlin:
There may be a problem with saving bitmap in ARGB format, see this: ImageIO.write bmp does not work