| java.lang.Object org.zkoss.image.AImage
AImage | public class AImage implements Image,java.io.Serializable(Code) | | Represents an image.
Unlike java.awt.Image and javax.swing.ImageIcon, this class holds
the raw image data, i.e., the original format, as opaque.
In other words, it is used to retrieve and store the opaque data
as polymorphic thru the
org.zkoss.util.media.Media interface.
author: tomyeh |
Constructor Summary | |
public | AImage(String name, byte[] data) the hash code. | public | AImage(String name, InputStream is) Contructs an image with an input stream. | public | AImage(String filename) Constructs an image with a file name. | public | AImage(File file) Constructs an image with a file. | public | AImage(URL url) Constructs an image with an URL. |
AImage | public AImage(String name, InputStream is) throws IOException(Code) | | Contructs an image with an input stream.
Note that this method automatically closes the input stream
(since ZK 3.0.0).
|
getByteData | public byte[] getByteData()(Code) | | |
getHeight | final public int getHeight()(Code) | | Returns the height.
|
getReaderData | final public Reader getReaderData()(Code) | | Always throws IllegalStateException.
|
getStreamData | final public InputStream getStreamData()(Code) | | An input stream on top of
AImage.getByteData .
Though harmless, the caller doesn't need to close the returned
stream.
|
getStringData | final public String getStringData()(Code) | | Always throws IllegalStateException.
|
getWidth | final public int getWidth()(Code) | | Returns the width.
|
inMemory | final public boolean inMemory()(Code) | | |
isBinary | final public boolean isBinary()(Code) | | |
toImageIcon | final public ImageIcon toImageIcon()(Code) | | Converts to an image icon.
|
|
|