public class DiagramFileImage extends Object implements DiagramImage
Clients may instantiate or subclass this class.
UNKNOWN_SIZE
Constructor and Description |
---|
DiagramFileImage(File file)
Creates a new diagram image based on the specified file.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
This implementation does nothing.
|
File |
getFile()
Returns the image file.
|
int |
getHeight()
Returns the height of the image.
|
int |
getWidth()
Returns the width of the image.
|
InputStream |
openStream()
Opens a
InputStream to read image bytes. |
public DiagramFileImage(File file)
This constructor will try to determine the width and height of this image. Supported image formats are: bmp
, emf
,
gif
, jpg
, png
, and wmf
.
file
- the image file.public final File getFile()
public InputStream openStream() throws IOException
DiagramImage
InputStream
to read image bytes.openStream
in interface DiagramImage
IOException
- if the image contents is not accessible.public int getWidth()
DiagramImage
getWidth
in interface DiagramImage
UNKNOWN_SIZE
if unknown).public int getHeight()
DiagramImage
getHeight
in interface DiagramImage
UNKNOWN_SIZE
if unknown).public void dispose()
dispose
in interface DiagramImage