tag and a stream to write out the bitmap file.
If the filename is set before the report is processed, that name is read
from this object and used in the report. If the name is not set, then the processor will
create the name and set it in this object and then use that name in the report. The created
names are file1.jpg/png, file2.jpg/png, ...
If a stream is assigned, the image is written to that stream. If the no parameter constructor is used,
then a ByteArrayOutputStream object will be created for the stream and the image will be written to that
stream. In this case, the stream is guaranteed to be a ByteArrayOutputStream or subclass of
ByteArrayOutputStream.
Note: There is no way to set the output stream but not set the file name.
Note: If the filename is set, it's extension is not checked against the filetype and can be anything.
- Version:
- 1.1 March 25, 2003
|
Field Summary |
static int |
BITMAP_BMP
The picture's data is a bmp/dib file. |
static int |
BITMAP_EMF
The picture's data is a emf file. |
static int |
BITMAP_EMZ
The picture's data is a compressed emf file. |
static int |
BITMAP_GIF
The picture's data is a gif file. |
static int |
BITMAP_JPG
The picture's data is a jpeg file. |
static int |
BITMAP_PNG
The picture's data is a png file. |
static int |
BITMAP_TIF
The picture's data is a tiff file. |
static int |
BITMAP_UNKNOWN
Do not know the bitmap type. |
static int |
BITMAP_WMF
The picture's data is a wmf file. |
static int |
BITMAP_WMZ
The picture's data is a compressed wmf file. |
|
Constructor Summary |
HtmlImage()
Create an object with no name and a ByteArrayOutputStream stream. |
HtmlImage(java.lang.String fileName)
Create an object with the passed in name and no stream. |
HtmlImage(java.lang.String fileName,
java.io.OutputStream fileStream)
Create an object with the passed in name and stream. |
|
Method Summary |
int |
getBitmapType()
Get the type of picture this is. |
java.lang.String |
getName()
Get the filename for this image object. |
java.io.OutputStream |
getStream()
Get the stream that contains the binary image of the file. |
void |
setBitmapType(int typ)
Set the type of picture this is. |
static int |
stringToType(java.lang.String ext)
Convert the file extension to the int type. |
static int |
stringToTypeNoError(java.lang.String ext)
Convert the file extension to the int type. |
static java.lang.String |
typeToStr(int type)
For a HtmlImage.BITMAP_ type, return the extension (no period). |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BITMAP_UNKNOWN
public static final int BITMAP_UNKNOWN
- Do not know the bitmap type.
BITMAP_PNG
public static final int BITMAP_PNG
- The picture's data is a png file.
BITMAP_JPG
public static final int BITMAP_JPG
- The picture's data is a jpeg file.
BITMAP_TIF
public static final int BITMAP_TIF
- The picture's data is a tiff file.
BITMAP_BMP
public static final int BITMAP_BMP
- The picture's data is a bmp/dib file.
BITMAP_GIF
public static final int BITMAP_GIF
- The picture's data is a gif file.
BITMAP_WMF
public static final int BITMAP_WMF
- The picture's data is a wmf file.
BITMAP_WMZ
public static final int BITMAP_WMZ
- The picture's data is a compressed wmf file.
BITMAP_EMF
public static final int BITMAP_EMF
- The picture's data is a emf file.
BITMAP_EMZ
public static final int BITMAP_EMZ
- The picture's data is a compressed emf file.
HtmlImage
public HtmlImage()
- Create an object with no name and a ByteArrayOutputStream stream.
HtmlImage
public HtmlImage(java.lang.String fileName,
java.io.OutputStream fileStream)
- Create an object with the passed in name and stream.
- Parameters:
fileName - The name for this file. If set to "" or null, then the processor
will create a filename for this image.fileStream - The stream to write this image to. If null, the image will not
be written to the stream.
HtmlImage
public HtmlImage(java.lang.String fileName)
- Create an object with the passed in name and no stream. No stream will be created as it is assumed that this
image file already exists.
- Parameters:
fileName - The name for this file. If set to "" or null, then the processor
will create a filename for this image.
getName
public java.lang.String getName()
- Get the filename for this image object.
- Returns:
- The name for this file. Will return "" if there is no filename.
setBitmapType
public void setBitmapType(int typ)
- Set the type of picture this is. It must be PNG or JPG.
- Parameters:
typ - Set to BITMAP_PNG or BITMAP_JPG
getBitmapType
public int getBitmapType()
- Get the type of picture this is. It must be PNG or JPG.
- Returns:
- Either BITMAP_PNG or BITMAP_JPG
getStream
public java.io.OutputStream getStream()
- Get the stream that contains the binary image of the file. This will return null if there
is no stream. This method should only be called after processing a report. If set in the
constructor, returns that stream. If created by Windward Reports, it returns a ByteArrayOutputStream.
- Returns:
- The binary image of the file.
stringToType
public static int stringToType(java.lang.String ext)
- Convert the file extension to the int type. Can pass jpg jpeg .jpg JPG - handles all combinations.
- Parameters:
ext - The file extension- Returns:
- the file type.
stringToTypeNoError
public static int stringToTypeNoError(java.lang.String ext)
- Convert the file extension to the int type. Can pass jpg jpeg .jpg JPG - handles all combinations.
- Parameters:
ext - The file extension- Returns:
- the file type.
typeToStr
public static java.lang.String typeToStr(int type)
- For a HtmlImage.BITMAP_ type, return the extension (no period). Always returns the 3 character version.
- Parameters:
type - The type.- Returns:
- The file extension.
Copyright © 2002 - 2008 Windward Reports - All Rights Reserved. java reporting software