Beispiel #1
0
 public function init(awImage $image)
 {
     if ($this->resource === NULL) {
         $this->setImageSize($image->width, $image->height);
         // Create image
         $this->resource = imagecreatetruecolor($this->imageWidth, $this->imageHeight);
         if (!$this->resource) {
             awImage::drawError("Class Image: Unable to create a graph.");
         }
         imagealphablending($this->resource, TRUE);
         // Antialiasing is now handled by the Driver object
         $this->setAntiAliasing($image->getAntiAliasing());
         // Original color
         $this->filledRectangle(new awWhite(), new awLine(new awPoint(0, 0), new awPoint($this->imageWidth, $this->imageHeight)));
         $shadow = $image->shadow;
         if ($shadow !== NULL) {
             $shadow = $shadow->getSpace();
             $p1 = new awPoint($shadow->left, $shadow->top);
             $p2 = new awPoint($this->imageWidth - $shadow->right - 1, $this->imageHeight - $shadow->bottom - 1);
             // Draw image background
             $this->filledRectangle($image->getBackground(), new awLine($p1, $p2));
             // Draw image border
             $image->border->rectangle($this, $p1, $p2);
         }
     }
 }
 /**
  * Initialize the driver for a particular awImage object
  * 
  * @param awImage $image
  */
 public function init(awImage $image)
 {
     if ($this->movie === NULL) {
         $this->setImageSize($image->width, $image->height);
         // Create movie
         $this->movie = new SWFMovie();
         if (!$this->movie) {
             awImage::drawError("Class Image: Unable to create a graph.");
         }
         $this->movie->setDimension($image->width, $image->height);
         $this->setAntiAliasing($image->getAntiAliasing());
         // Original color
         $this->filledRectangle(new awWhite(), new awLine(new awPoint(0, 0), new awPoint($this->imageWidth, $this->imageHeight)));
         $shadow = $image->shadow;
         if ($shadow !== NULL) {
             $shadow = $shadow->getSpace();
             $p1 = new awPoint($shadow->left, $shadow->top);
             $p2 = new awPoint($this->imageWidth - $shadow->right - 1, $this->imageHeight - $shadow->bottom - 1);
             // Draw image background
             $this->filledRectangle($image->getBackground(), new awLine($p1, $p2));
             // Draw image border
             $image->border->rectangle($this, $p1, $p2);
         }
     }
 }