Class BmpDecoder


  • public class BmpDecoder
    extends com.idrsolutions.image.JDeliImage
    Class reads BMP image as BufferedImage

    Example 1 (Using raw byte data):

    
     BmpDecoder decoder = new BmpDecoder();
     BufferedImage decodedImage = decoder.read(bmpBytes);
     

    Example 2 (Using a File):

    
     File bmpFile = new File("C:\\path\\to\\file\\image.bmp");
     BmpDecoder decoder = new BmpDecoder();
     BufferedImage decodedImage = decoder.read(bmpFile);
     
    • Constructor Detail

      • BmpDecoder

        public BmpDecoder()
    • Method Detail

      • read

        public BufferedImage read​(byte[] bmpData)
                           throws IOException
        Decodes and returns the BMP image as a BufferedImage from bytes
        Parameters:
        bmpData - byte[] containing the BMP data
        Returns:
        BufferedImage The decoded image
        Throws:
        IOException
      • read

        public BufferedImage read​(File bmpFile)
                           throws IOException
        Decodes and returns the BMP image as a BufferedImage from a File
        Parameters:
        bmpFile - BMP file to be converted to a BufferedImage
        Returns:
        BufferedImage The decoded image
        Throws:
        IOException