I'm working on a map editor for a simple map builder.
My idea was to paint walls in the map as black pixels, everything else (white colour) is free space in a room.
Any .jar to read bmp files ? So as to avoid the header, etc?
Im reading about Image4j
Thanks in adavance.
If you want to use Image4j, that's a pretty easy way to go. This code will display a bmp in a JLabel.
BufferedImage image = null;
try
{
image = BMPDecoder.read(new File("C:\\test.bmp"));
}
catch(IOException ex)
{
Logger.getLogger(DesktopApplication1View.class.getName()).log(Level.SEVERE, null, ex);
}
jLabel1.setIcon(new ImageIcon(image));
I'd recommend you also look at the Java Advanced Imaging API Image I/O sub-project. The project Javadoc indicates that there is support (mostly in raster mode) for BMP files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With