Icon

Icon objects contain external images (.jpg or .png).  They are created using the following functions:

Function Description
Icon(filename) Imports an image from the given filename (e.g. “apple.jpg” or “apple.png”).
Icon(filename, width) Imports an image from the given filename and resizes it (proportionally) using the provided width (in pixels).
Icon(filename, width, height) Imports an image from the given filename and resizes (stretches) it using the provided width and height (in pixels).

Once an Icon has been created, it may be added to a Display specifying where to place its top-left corner point.

Additionally, you may use the following functions:

Function Description
icon.setSize(width, height) Changes/stretches the width and height  of an image (in pixels).
icon.getWidth() Returns the width of an image (in pixels).
icon.getHeight() Returns the height of an image (in pixels).
icon.rotate(angle) Rotates the image angle degrees.
icon.crop(x, y, width, height) Crops the image starting from point x, y up to width and height (from the point x, y).