Class BMPFile

java.lang.Object
fr.olleroy.ImageModifier.BMPFile

public class BMPFile extends Object
Represent a bmp file.
Version:
1.2.0
Author:
olleroy alias ollprogram.
  • Constructor Details

    • BMPFile

      public BMPFile(String imagePathnameOrURL) throws IOException
      Construct a BMPFile from a file or a URL.
      Parameters:
      imagePathnameOrURL - The pathname or the URL of the image.
      Throws:
      IOException - If it can't access or read the File.
    • BMPFile

      public BMPFile(Bitmap bitmap)
      Construct a BMPFile with a new Bitmap built with the specified Bitmap
      Parameters:
      bitmap - The bitmap for the bmp file.
  • Method Details

    • getImage

      public BufferedImage getImage()
      Get the Image.
      Returns:
      The image from the BMPFile.
    • save

      public void save(String pathname, boolean alpha) throws IOException
      Write the image file as a bmp file with the Windows DIB BITMAPINFOHEADER to the specified pathname. The image can be 24bpp or 32bpp (bit per pixel). 24bpp is recommended for large scaled images.
      Parameters:
      pathname - The pathname. Where you want to save.
      alpha - true for 32 bpp (ARGB), else 24bpp (RGB).
      Throws:
      IOException - Tf an I/O error occurs.
    • getBitmap

      public Bitmap getBitmap()
      Get the bitmap.
      Returns:
      the bitmap from the BMPFile.