Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
GObject
org.gnu.gdk.PixbufLoader
public class PixbufLoader
extends GObject
Pixbuf.Pixbuf(String)
or PixbufAnimation.PixbufAnimation(String)
when they need to parse image data
in small chunks. For example, it should be used when reading an image from a
(potentially) slow network connection, when loading an extremely large file
or even reading an image from a database.
To use PixbufLoader to load an image, just create a new one, and
call write(byte[])
, write(byte[],int)
, or
write(InputStream)
to send the data to it. When done, close()
should be called to end the stream and finalize everything. The created
Pixbuf
can be retireved using the getPixbuf()
method.
Pixbuf
, PixbufAnimation
Constructor Summary | |
| |
|
Method Summary | |
boolean |
|
Pixbuf |
|
PixbufAnimation |
|
boolean |
|
boolean |
|
boolean |
|
public PixbufLoader()
Deprecated. Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.
Construct a new PixbufLoader that automatically detects the type of image based on the data.
public PixbufLoader(String imageType)
Deprecated. Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.
Construct a new PixbufLoader that parses the image data as if it were an image of imageType.
- Parameters:
imageType
- Name of the image format to be loaded with the image.
public boolean close()
Deprecated. Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.
Informs a loader that no further writes will occur, so that it can free its internal loading structures.
public Pixbuf getPixbuf()
Deprecated. Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.
Get thePixbuf
object that is currently being created.
public PixbufAnimation getPixbufAnimation()
Deprecated. Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.
Get thePixbufAnimation
object that is currently being created.
public boolean write(InputStream stream)
Deprecated. Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.
Parse the data for the image from the given stream. The contents of the stream are read and loaded into the Pixbuf using succesive calls to thewrite(byte[],int)
method. If all of the data for the image is in the given stream, theclose()
method should be called after this method finishes. You can callgetPixbuf()
to get the resulting Pixbuf object. This method does not make any attempt to efficiently read the data from the given stream. Calling applications should wrap their InputStreams in efficient implementations (such as Buffered* implementations) if necessary before calling this method.
- Parameters:
stream
- A stream containing the data to load.
- Returns:
- true if the data was loaded successfully, false if an error occured.
public boolean write(byte[] buffer)
Deprecated. Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.
Parse the images bytes from the given buffer.
- Returns:
- true if the data was loaded successfully, false if an error occured.
public boolean write(byte[] buffer, int len)
Deprecated. Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the presented API is an algorithmic mapping of the underlying native libraries.
Parse len image bytes from buffer.
- Returns:
- true if the data was loaded successfully, false if an error occured.