Beispiel #1
0
 public function setAntiAliasing($bool)
 {
     if (function_exists('imageantialias')) {
         imageantialias($this->resource, (bool) $bool);
         $this->antiAliasing = (bool) $bool;
     } elseif ($bool == true) {
         awImage::drawErrorFile('missing-anti-aliasing');
     }
 }
Beispiel #2
0
    {
        if ((double) $this->size !== 0.0) {
            return (int) round($this->g1 + $pos / $this->size * ($this->g2 - $this->g1));
        } else {
            return 0;
        }
    }
    private function getBlue($pos)
    {
        if ((double) $this->size !== 0.0) {
            return (int) round($this->b1 + $pos / $this->size * ($this->b2 - $this->b1));
        } else {
            return 0;
        }
    }
    private function getAlpha($pos)
    {
        if ((double) $this->size !== 0.0) {
            return (int) round(($this->a1 + $pos / $this->size * ($this->a2 - $this->a1)) / 127 * 100);
        } else {
            return 0;
        }
    }
}
registerClass('GDGradientDriver');
/*
 * Check for GD2
 */
if (function_exists('imagecreatetruecolor') === FALSE) {
    awImage::drawErrorFile('missing-gd2');
}
Beispiel #3
0
     * @param $gradient The awGradient object to convert
     * @return array
     */
    function getGradient($gradient)
    {
        $flashGradient = new SWFGradient();
        // Get RGBA values for the gradient boundaries
        list($r1, $g1, $b1, $a1) = $this->getColor($gradient->from);
        list($r2, $g2, $b2, $a2) = $this->getColor($gradient->to);
        $flashGradient->addEntry(0, $r1, $g1, $b1, $a1);
        if (is_a($gradient, 'awBilinearGradient')) {
            $flashGradient->addEntry($gradient->center, $r2, $g2, $b2, $a2);
            $flashGradient->addEntry(1, $r1, $g1, $b1, $a1);
            return array($flashGradient, SWFFILL_LINEAR_GRADIENT);
        } else {
            $flashGradient->addEntry(1, $r2, $g2, $b2, $a2);
            if (is_a($gradient, 'awLinearGradient')) {
                return array($flashGradient, SWFFILL_LINEAR_GRADIENT);
            } else {
                return array($flashGradient, SWFFILL_RADIAL_GRADIENT);
            }
        }
    }
}
registerClass('MingDriver');
/*
 * Check for ming presence
 */
if (function_exists('ming_useswfversion') === FALSE) {
    awImage::drawErrorFile('missing-ming');
}
Beispiel #4
0
	 function setAntiAliasing($bool) {
		
		if(function_exists('imageantialias')) {
			imageantialias($this->resource, (bool)$bool);

			$this->antiAliasing = (bool)$bool;
		} else {
		  // P. Baudracco : commente car sinon ne marche pas
		  //			awImage::drawErrorFile('missing-anti-aliasing');
			awImage::drawErrorFile('missing-anti-aliasing');
		}
	}