TeeChartPHP
[ class tree: TeeChartPHP ] [ index: TeeChartPHP ] [ all elements ]

Source for file JPEGFormat.php

Documentation is available at JPEGFormat.php

  1. <?php
  2.  
  3.  /**
  4.  * JPEGFormat class
  5.  *
  6.  * Description: Chart image export to JPEG
  7.  *
  8.  * @author
  9.  * @copyright (c) 1995-2008 by Steema Software SL. All Rights Reserved. <info@steema.com>
  10.  * @version 1.0
  11.  * @package TeeChartPHP
  12.  * @subpackage exports
  13.  * @link http://www.steema.com
  14.  */
  15.  
  16.  class JPEGFormat extends ImageExportFormat {
  17.  
  18.     // Interceptors
  19.     function __get$property {
  20.       $method ="get{$property}";
  21.       if method_exists$this$method ) ) {
  22.         return $this->$method();
  23.       }
  24.     }
  25.  
  26.     function __set $property,$value {
  27.       $method ="set{$property}";
  28.       if method_exists$this$method ) ) {
  29.         return $this->$method($value);
  30.       }
  31.     }
  32.  
  33.     public function JPEGFormat($c{
  34.         parent::ImageExportFormat($c);
  35.  
  36. //        $this->format = new JPEGImageWriteParam($this->Locale->getDefault());
  37. //        $tmpImageWriteParam = new ImageWriteParam();
  38. //        $this->format->setCompressionMode($tmpImageWriteParam->MODE_EXPLICIT);
  39.         $this->fileExtension = "jpg";
  40.     }
  41.  
  42.     public function getJPEGOptions({
  43.         return $this->format;
  44.     }
  45.  
  46.     public function setJPEGOptions($params{
  47.         $this->format = $params;
  48.     }
  49.  
  50.     public function save($ios/* TODO throws IOException*/ {
  51.         if ($this->width <= 0{
  52.             $this->width 400;
  53.         }
  54.  
  55.         if ($this->height <= 0{
  56.             $this->height 300;
  57.         }
  58.  
  59.         $img $this->chart->image($this->width$this->height);
  60.         imagejpeg($this->chart->getGraphics3D()->img,$ios);
  61.     }
  62. }
  63.  
  64. ?>

Documentation generated on Wed, 16 Jun 2010 12:06:31 +0200 by phpDocumentor 1.4.1