Package com.itextpdf.text.pdf.codec
Class BmpImage
- java.lang.Object
-
- com.itextpdf.text.pdf.codec.BmpImage
-
public class BmpImage extends Object
Reads a BMP image. All types of BMP can be read.It is based in the JAI codec.
- Author:
- Paulo Soares
-
-
Field Summary
Fields Modifier and Type Field Description HashMap<String,Object>
properties
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Image
getImage(byte[] data)
Reads a BMP from a byte array.static Image
getImage(InputStream is)
Reads a BMP from a stream.static Image
getImage(InputStream is, boolean noHeader, int size)
Reads a BMP from a stream.static Image
getImage(String file)
Reads a BMP from a file.static Image
getImage(URL url)
Reads a BMP from an url.protected void
process(InputStream stream, boolean noHeader)
-
-
-
Method Detail
-
getImage
public static Image getImage(URL url) throws IOException
Reads a BMP from an url.- Parameters:
url
- the url- Returns:
- the image
- Throws:
IOException
- on error
-
getImage
public static Image getImage(InputStream is) throws IOException
Reads a BMP from a stream. The stream is not closed.- Parameters:
is
- the stream- Returns:
- the image
- Throws:
IOException
- on error
-
getImage
public static Image getImage(InputStream is, boolean noHeader, int size) throws IOException
Reads a BMP from a stream. The stream is not closed. The BMP may not have a header and be considered as a plain DIB.- Parameters:
is
- the streamnoHeader
- true to process a plain DIBsize
- the size of the DIB. Not used for a BMP- Returns:
- the image
- Throws:
IOException
- on error
-
getImage
public static Image getImage(String file) throws IOException
Reads a BMP from a file.- Parameters:
file
- the file- Returns:
- the image
- Throws:
IOException
- on error
-
getImage
public static Image getImage(byte[] data) throws IOException
Reads a BMP from a byte array.- Parameters:
data
- the byte array- Returns:
- the image
- Throws:
IOException
- on error
-
process
protected void process(InputStream stream, boolean noHeader) throws IOException
- Throws:
IOException
-
-