Public Member Functions | |
void | GCanvas (Integer width, Integer height, Integer bgcolor) |
Constructs a 2D image drawing canvas. | |
void | polyline (Array x, Array y, Integer color) |
Draws a polyline. | |
void | draw (Integer x, Integer y, Integer color) |
Puts a pixel of the defined color in the position x,y. | |
void | circle (Integer xc, Integer yc, Integer r, Integer color) |
Draws a circle (Bresenham's algorithm). | |
void | clear () |
Clears the whole canvas using default background color. | |
Integer | getcolor (void x, void y) |
Gets a color of a pixel in the position x,y. | |
void | fill (Integer x, Integer y, Integer color) |
Fills a closed area (using stack). | |
void | ellipse (Integer xc, Integer yc, Integer a, Integer b, Integer color) |
Draws an ellipse (Bresenham's algorithm). | |
void | polygon (Array x, Array y, Integer color) |
Draws a polygon (automatically closed if last points are not identical. | |
void | line (Integer x1, Integer y1, Integer x2, Integer y2, Integer color) |
Draws a line (Bresenham's algorithm). | |
Public Attributes | |
Integer | width |
The width of the canvas. | |
Integer | height |
The height of the canvas. | |
Array | image |
Internal array representing the image canvas. | |
String | bgcolor |
The background color of the canvas (HTML format string). |
x=0,y=0 - top left corner of the canvas. x=width-1,y=height-1 - bottom right corner of the canvas.
|
Constructs a 2D image drawing canvas.
|
|
Draws a circle (Bresenham's algorithm).
|
|
Puts a pixel of the defined color in the position x,y.
|
|
Draws an ellipse (Bresenham's algorithm).
|
|
Fills a closed area (using stack).
|
|
Gets a color of a pixel in the position x,y.
|
|
Draws a line (Bresenham's algorithm).
|
|
Draws a polygon (automatically closed if last points are not identical.
|
|
Draws a polyline.
|