com.lowagie.text.pdf.codec
Class BmpImage

java.lang.Object
  extended by com.lowagie.text.pdf.codec.BmpImage

public class BmpImage
extends java.lang.Object

Reads a BMP image. All types of BMP can be read.

It is based in the JAI codec.

Author:
Paulo Soares (psoares@consiste.pt)

Field Summary
 java.util.HashMap properties
           
 
Method Summary
static Image getImage(byte[] data)
          Reads a BMP from a byte array.
static Image getImage(java.io.InputStream is)
          Reads a BMP from a stream.
static Image getImage(java.io.InputStream is, boolean noHeader, int size)
          Reads a BMP from a stream.
static Image getImage(java.lang.String file)
          Reads a BMP from a file.
static Image getImage(java.net.URL url)
          Reads a BMP from an url.
protected  void process(java.io.InputStream stream, boolean noHeader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

properties

public java.util.HashMap properties
Method Detail

getImage

public static Image getImage(java.net.URL url)
                      throws java.io.IOException
Reads a BMP from an url.

Parameters:
url - the url
Returns:
the image
Throws:
java.io.IOException - on error

getImage

public static Image getImage(java.io.InputStream is)
                      throws java.io.IOException
Reads a BMP from a stream. The stream is not closed.

Parameters:
is - the stream
Returns:
the image
Throws:
java.io.IOException - on error

getImage

public static Image getImage(java.io.InputStream is,
                             boolean noHeader,
                             int size)
                      throws java.io.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 stream
noHeader - true to process a plain DIB
size - the size of the DIB. Not used for a BMP
Returns:
the image
Throws:
java.io.IOException - on error

getImage

public static Image getImage(java.lang.String file)
                      throws java.io.IOException
Reads a BMP from a file.

Parameters:
file - the file
Returns:
the image
Throws:
java.io.IOException - on error

getImage

public static Image getImage(byte[] data)
                      throws java.io.IOException
Reads a BMP from a byte array.

Parameters:
data - the byte array
Returns:
the image
Throws:
java.io.IOException - on error

process

protected void process(java.io.InputStream stream,
                       boolean noHeader)
                throws java.io.IOException
Throws:
java.io.IOException


iText 2.1.7