Source for file ImageCanvas.php
Documentation is available at ImageCanvas.php
require_once 'Image/Canvas.php';
$this->_type = (string) $type;
$this->_image = Image_Canvas ::factory ($this->_type, array ('width' => $x, 'height' => $y, 'antialias' => 'driver'));
protected function _getColor(Image_3D_Color $color)
$values = $color->getValues ();
return sprintf('#%02x%02x%02x@%f', (int) ($values[0 ] * 255 ), (int) ($values[1 ] * 255 ), (int) ($values[2 ] * 255 ), 1 - $values[3 ]);
$this->_image->rectangle (array ('x0' => 0 , 'y0' => 0 , 'x1' => $this->_image->getWidth (), 'y1' => $this->_image->getHeight ()));
public function drawPolygon(Image_3D_Polygon $polygon) {
$points = $polygon->getPoints ();
foreach ($points as $point) {
$screenCoordinates = $point->getScreenCoordinates ();
$this->_image->addVertex (array ('x' => $screenCoordinates[0 ], 'y' => $screenCoordinates[1 ]));
$this->_image->setLineColor (false );
$this->_image->polygon (array ('connect' => true ));
public function save($file)
$this->_image->save (array ('filename' => $file));
Documentation generated on Mon, 11 Mar 2019 15:48:14 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|