Inherits ScriptObject.
Public Member Functions | |
| Canvas (Integer _width, Integer _height) | |
| Integer | getWidth () |
| Integer | getHeight () |
| clear (Integer rgba) | |
| Color | getColor (Integer x, Integer y) |
| setColor (Integer x, Integer y, Color color) | |
| Integer | getPixel (Integer x, Integer y) |
| setPixel (Integer x, Integer y, Integer rgba) | |
| saveImage (String path, String mimetype) | |
Static Public Member Functions | |
| static Canvas | loadImage (String path, String mimetype) |
A 2D canvas for drawing.
| clear | ( | Integer | rgba | ) |
Clears the canvas.
| Integer getHeight | ( | ) |
Returns the height of the canvas.
| Integer getWidth | ( | ) |
Returns the width of the canvas.
Loads the specified picture into a new Canvas.
| path | The path of the source file. |
| mimetype | The MIME type of the image (must be "image/png"). |
Exports the canvas to the specified path.
| path | The path of the destination file. |
| mimetype | The MIME type of the image (must be "image/png"). |