showImage() displays an image in a window. When width and height are specified and the image size is larger than that, a scroll bar appears within the frame.
im = getToolkit().getImage("test.jpg")
showImage(im)
readImage() reads an image from file, URL, or InputStream.
im = readImage("test.png")
showImage(im)
This function requires Image I/O API, which is a part of JDK1.4.
writeImage() writes the specified image to a file or an OutputStream.
im = readImage("test.png")
writeImage(im, "test.bmp")
This function requires Image I/O API, which is a part of JDK1.4.X.
A Image object of the size width x height is created and the function drawFunc is called to draw something, if it is not null.
drawFunc(Graphics graphics)
imageType can be one of the following constants:
import("java.awt.Color")
im = makeImage(100, 100, function (g){
g.setColor(Color::white)
g.fillRect(0, 0, 100, 100)
g.setColor(Color::blue)
g.fillOval(0, 0, 100, 100)
}, TYPE_INT_RGB)
showImage(im)
filterImage() returns an image created by filtering the image with the imageFilter.
cropImage() crops the rectangular region (x, y, x + w, y + h) of the image.
scaleImage() transform the image with the scaling factor x and y.
rotateImage() rotates the image with a positive angle theta and rotates points (x, y).
flipImage() flips the image vertically, if vertical is true, and horizontally , if horizontal is true.
shearImage() applies shearing transformation to image.
grayImage() converts image to a gray scale image.