Class Image

java.lang.Object
ch.bailu.gtk.lib.bridge.Image

public class Image extends Object
  • Constructor Details

    • Image

      public Image()
  • Method Details

    • load

      public static Pixbuf load(InputStream inputStream) throws IOException
      Loads an image from the stream into Pixbuf
      Parameters:
      inputStream - stream with image data
      Returns:
      Pixbuf
      Throws:
      IOException
    • load

      public static Pixbuf load(InputStream inputStream, int width, int height) throws IOException
      Loads an image from the stream into Pixbuf
      Parameters:
      inputStream - stream with image data
      width - the width of the returned Pixbuf
      height - 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 Pixbuf
      height - the height of the returned Pixbuf
      preserveAspectRatio - `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 stream
      pixbuf - pixbuf to convert
      imageFormat - one of the following formats: "jpeg", "tiff", "png", "ico" or "bmp"
      Throws:
      IOException