Image Viewing

showImage(fileName_or_url)
showImage(fileName_or_url, ratio_x, ratio_y)
showImage(fileName_or_url, pixels_x, pixels_y)

showImage() displays an image file (url) within a Frame. When a double value ratio_x(y) is specified, the image displayed fits in the size. When a int value pixels is specified the image displayed fits in the size.

import("pnuts.awt.*")
ImageCanvas(filenameOrUrl)

ImageCanvas class is provided in order to display images.

e.g:
import("java.awt.*")
import("pnuts.awt.*")

function showImage(fileOrURL){
  f = frame(""+fileOrURL)
  p = ImageCanvas(fileOrURL)
  f.add(p)
  f.pack()
  f.show()
  p.sync()
  p.repaint()
  return f
}

Back