Public Member Functions | |
| color_at ($x, $y) | |
| Return the color value of the specified pixel. | |
| draw_point ($x, $y) | |
| Draw a single point on the image. | |
| draw_line ($x1, $y1, $x2, $y2) | |
| Draw a line from one point to another point. | |
| draw_rectangle ($x1, $y1, $x2, $y2) | |
| Draw a rectangle. | |
| draw_filled_rectangle ($x1, $y1, $x2, $y2) | |
| Draw a filled rectangle. | |
| draw_rectangle_size ($x, $y, $width, $height) | |
| Draw a rectangle of a given width and height. | |
| draw_filled_rectangle_size ($x, $y, $width, $height) | |
| Draw a filled rectangle of a given width and height. | |
| draw_string ($x, $y, $str) | |
| Draw a simple string at the given point. | |
Private Member Functions | |
| __construct ($image) | |
| Create a new drawing context. | |
| _install_gd_properties () | |
| Set the gd properties on the actual image instance. | |
| _draw_rectangle ($x1, $y1, $x2, $y2, $filled) | |
| Draw a rectangle. | |
| _draw_rectangle_size ($x, $y, $width, $height, $filled) | |
| Draw a rectangle of a given width and height. | |
Private Attributes | |
| $image = null | |
| AnewtImage instance this AnewtImageDrawingContext belongs to. | |
A drawing context keeps some drawing properties and offers drawing methods. Note that not all functions might be available on your particular setup (eg. anti-aliasing).
Definition at line 25 of file drawingcontext.lib.php.
| AnewtImageDrawingContext::__construct | ( | $ | image | ) | [private] |
Create a new drawing context.
Do not instantiate this class directly, use AnewtImage::create_drawing_context instead.
| $image | A valid AnewtImage instance. |
Reimplemented from AnewtContainer.
Definition at line 41 of file drawingcontext.lib.php.
| AnewtImageDrawingContext::_install_gd_properties | ( | ) | [private] |
Set the gd properties on the actual image instance.
All drawing methods should call this method before any GD function is invoked. This method shouldn't be called by non-drawing methods.
Definition at line 64 of file drawingcontext.lib.php.
| AnewtImageDrawingContext::color_at | ( | $ | x, | |
| $ | y | |||
| ) |
Return the color value of the specified pixel.
| $x | X coordinate | |
| $y | Y coordinate |
Definition at line 96 of file drawingcontext.lib.php.
| AnewtImageDrawingContext::draw_point | ( | $ | x, | |
| $ | y | |||
| ) |
Draw a single point on the image.
| $x | X coordinate | |
| $y | Y coordinate |
Definition at line 108 of file drawingcontext.lib.php.
| AnewtImageDrawingContext::draw_line | ( | $ | x1, | |
| $ | y1, | |||
| $ | x2, | |||
| $ | y2 | |||
| ) |
Draw a line from one point to another point.
| $x1 | X coordinate of the first point | |
| $y1 | Y coordinate of the first point | |
| $x2 | X coordinate of the second point | |
| $y2 | Y coordinate of the second point |
Definition at line 126 of file drawingcontext.lib.php.
| AnewtImageDrawingContext::_draw_rectangle | ( | $ | x1, | |
| $ | y1, | |||
| $ | x2, | |||
| $ | y2, | |||
| $ | filled | |||
| ) | [private] |
Draw a rectangle.
| $x1 | X coordinate of the top-left point | |
| $y1 | X coordinate of the top-left point | |
| $x2 | X coordinate of the bottom-right point | |
| $y2 | X coordinate of the bottom-right point | |
| $filled | Whether the rectangle is filled |
Definition at line 145 of file drawingcontext.lib.php.
| AnewtImageDrawingContext::_draw_rectangle_size | ( | $ | x, | |
| $ | y, | |||
| $ | width, | |||
| $ | height, | |||
| $ | filled | |||
| ) | [private] |
Draw a rectangle of a given width and height.
Negative width and height values cause the rectangle to be drawn from the bottom right coordinate, extending to the top left.
| $x | X coordinate of the top-left point | |
| $y | X coordinate of the top-left point | |
| $width | Width of the rectangle | |
| $height | Height of the rectangle | |
| $filled | Whether the rectangle is filled |
Definition at line 197 of file drawingcontext.lib.php.
| AnewtImageDrawingContext::draw_rectangle | ( | $ | x1, | |
| $ | y1, | |||
| $ | x2, | |||
| $ | y2 | |||
| ) |
Draw a rectangle.
| $x1 | X coordinate of the top-left point | |
| $y1 | X coordinate of the top-left point | |
| $x2 | X coordinate of the bottom-right point | |
| $y2 | X coordinate of the bottom-right point |
Definition at line 236 of file drawingcontext.lib.php.
| AnewtImageDrawingContext::draw_filled_rectangle | ( | $ | x1, | |
| $ | y1, | |||
| $ | x2, | |||
| $ | y2 | |||
| ) |
Draw a filled rectangle.
| $x1 | X coordinate of the top-left point | |
| $y1 | X coordinate of the top-left point | |
| $x2 | X coordinate of the bottom-right point | |
| $y2 | X coordinate of the bottom-right point |
Definition at line 249 of file drawingcontext.lib.php.
| AnewtImageDrawingContext::draw_rectangle_size | ( | $ | x, | |
| $ | y, | |||
| $ | width, | |||
| $ | height | |||
| ) |
Draw a rectangle of a given width and height.
Negative width and height values cause the rectangle to be drawn from the bottom right coordinate, extending to the top left.
| $x | X coordinate of the top-left point | |
| $y | X coordinate of the top-left point | |
| $width | Width of the rectangle | |
| $height | Height of the rectangle |
Definition at line 264 of file drawingcontext.lib.php.
| AnewtImageDrawingContext::draw_filled_rectangle_size | ( | $ | x, | |
| $ | y, | |||
| $ | width, | |||
| $ | height | |||
| ) |
Draw a filled rectangle of a given width and height.
Negative width and height values cause the rectangle to be drawn from the bottom right coordinate, extending to the top left.
| $x | X coordinate of the top-left point | |
| $y | X coordinate of the top-left point | |
| $width | Width of the rectangle | |
| $height | Height of the rectangle |
Definition at line 279 of file drawingcontext.lib.php.
| AnewtImageDrawingContext::draw_string | ( | $ | x, | |
| $ | y, | |||
| $ | str | |||
| ) |
Draw a simple string at the given point.
| $x | X coordinate | |
| $y | y coordinate | |
| $str | String to draw |
Definition at line 296 of file drawingcontext.lib.php.
1.5.9