Package ch.bailu.gtk.lib.bridge
Class Image
java.lang.Object
ch.bailu.gtk.lib.bridge.Image
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Pixbuf
load
(InputStream inputStream) Loads an image from the stream into Pixbufstatic Pixbuf
load
(InputStream inputStream, int width, int height) Loads an image from the stream into Pixbufstatic Pixbuf
load
(InputStream inputStream, int width, int height, boolean preserveAspectRatio) Loads an image from the stream into Pixbufstatic void
save
(OutputStream outputStream, Pixbuf pixbuf, String imageFormat) Convert pixbuf to an image format and write bytes to outputStream
-
Constructor Details
-
Image
public Image()
-
-
Method Details
-
load
Loads an image from the stream into Pixbuf- Parameters:
inputStream
- stream with image data- Returns:
- Pixbuf
- Throws:
IOException
-
load
Loads an image from the stream into Pixbuf- Parameters:
inputStream
- stream with image datawidth
- the width of the returned Pixbufheight
- the height of the returned Pixbuf- Returns:
- Pixbuf
- Throws:
IOException
-
load
public static Pixbuf load(InputStream inputStream, int width, int height, boolean preserveAspectRatio) throws IOException Loads an image from the stream into Pixbuf- Parameters:
inputStream
-width
- the width of the returned Pixbufheight
- the height of the returned PixbufpreserveAspectRatio
- `TRUE` to preserve the image's aspect ratio- Returns:
- Pixbuf
- Throws:
IOException
-
save
public static void save(OutputStream outputStream, Pixbuf pixbuf, String imageFormat) throws IOException Convert pixbuf to an image format and write bytes to outputStream- Parameters:
outputStream
- the image will be written to this streampixbuf
- pixbuf to convertimageFormat
- one of the following formats: "jpeg", "tiff", "png", "ico" or "bmp"- Throws:
IOException
-