lib
Class ImageLib

java.lang.Object
  extended by lib.ImageLib

public class ImageLib
extends java.lang.Object

Author:
Sjoerd Dost The Image-library uses Buffered Images and Graphics2D to load, modify and save images in jpg or png format

Constructor Summary
ImageLib()
           
 
Method Summary
static void drawEllipse(java.awt.image.BufferedImage img, java.awt.Color c, int x, int y, int w, int h)
          Draw an ellipse at (x,y) in image img
static void drawImage(java.awt.image.BufferedImage object_img, java.awt.image.BufferedImage target_img, int x, int y)
          Draw an image (target) at (x,y) in another image (object)
static void drawRectangle(java.awt.image.BufferedImage img, java.awt.Color c, int x, int y, int w, int h)
          Draw a rectangle at (x,y) in image img
static java.awt.image.BufferedImage loadImage(java.lang.String pathname)
          Loading a local image
static java.awt.image.BufferedImage loadImageFromWeb(java.lang.String url)
          Loading an image from the web
static void maakGif(java.lang.String string, int i, int j)
           
static void saveImage(java.awt.image.BufferedImage img, java.lang.String ref)
           
static java.awt.image.BufferedImage scale(java.awt.image.BufferedImage img, double sx, double sy)
          Return a scaled version of an image
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageLib

public ImageLib()
Method Detail

drawRectangle

public static void drawRectangle(java.awt.image.BufferedImage img,
                                 java.awt.Color c,
                                 int x,
                                 int y,
                                 int w,
                                 int h)
Draw a rectangle at (x,y) in image img

Parameters:
img - The image to be drawn in
c - The color of the rectangle
x - The x-coordinate of the rectangle's upper-left corner
y - The y-coordinate of the rectangle's upper-left corner
w - The width of the rectangle
h - The height of the rectangle

drawEllipse

public static void drawEllipse(java.awt.image.BufferedImage img,
                               java.awt.Color c,
                               int x,
                               int y,
                               int w,
                               int h)
Draw an ellipse at (x,y) in image img


drawImage

public static void drawImage(java.awt.image.BufferedImage object_img,
                             java.awt.image.BufferedImage target_img,
                             int x,
                             int y)
Draw an image (target) at (x,y) in another image (object)


scale

public static java.awt.image.BufferedImage scale(java.awt.image.BufferedImage img,
                                                 double sx,
                                                 double sy)
Return a scaled version of an image

Parameters:
sx - scale in x
sy - scale in y

saveImage

public static void saveImage(java.awt.image.BufferedImage img,
                             java.lang.String ref)
Parameters:
img - The BufferedImage to save
ref - Pathname, ending in .png or .jpg

loadImage

public static java.awt.image.BufferedImage loadImage(java.lang.String pathname)
Loading a local image

Parameters:
pathname -
Returns:

loadImageFromWeb

public static java.awt.image.BufferedImage loadImageFromWeb(java.lang.String url)
Loading an image from the web

Parameters:
url -
Returns:

maakGif

public static void maakGif(java.lang.String string,
                           int i,
                           int j)