示例#1
0
 /**
  * Create the JPEG canvas
  *
  * Additional parameters other than those available for common {@link
  * Image_Graph_Canvas_GD} class are:
  *
  * 'quality' The JPEG quality in as a percentage value from 0 (lowest
  * quality, smallest file) to 100 (highest quality, biggest file)
  *
  * @param array $param Parameter array
  */
 function __construct($param)
 {
     parent::__construct($param);
     if (isset($param['quality'])) {
         $this->_quality = max(0, min(100, $param['quality']));
     }
     $this->rectangle(array('x0' => $this->_left, 'y0' => $this->_top, 'x1' => $this->_left + $this->_width - 1, 'y1' => $this->_top + $this->_height - 1, 'fill' => 'white', 'line' => 'transparent'));
 }
示例#2
0
 /**
  * Create the PNG canvas
  *
  * @param array $param Parameter array
  */
 function __construct($param)
 {
     parent::__construct($param);
     if (isset($param['transparent']) && $param['transparent'] && $this->_gd2) {
         if ($param['transparent'] === true) {
             $transparent = '#123ABD';
         } else {
             $transparent = $param['transparent'];
         }
         $color = $this->_color($transparent);
         $trans = ImageColorTransparent($this->_canvas, $color);
         $this->rectangle(array('x0' => $this->_left, 'y0' => $this->_top, 'x1' => $this->_left + $this->_width - 1, 'y1' => $this->_top + $this->_height - 1, 'fill' => 'opague', 'line' => 'transparent'));
     } else {
         $this->rectangle(array('x0' => $this->_left, 'y0' => $this->_top, 'x1' => $this->_left + $this->_width - 1, 'y1' => $this->_top + $this->_height - 1, 'fill' => 'white', 'line' => 'transparent'));
     }
 }