3
我如何使GD与2或更多的椭圆之间的梯度?如何使用GD在2个或更多的椭圆之间建立梯度?
下面是一个椭圆形:
<?php
header("Content-type: image/gif");
$imagen = imagecreatefrompng('tras.png');
$morado = array('r' => 186, 'g' => 0, 'b' => 255);
$amarillo = array('r' => 255, 'g' => 220, 'b' => 0);
$pasos = 2000;
$incr_r = ($amarillo['r'] - $morado['r'])/$pasos;
$incr_g = ($amarillo['g'] - $morado['g'])/$pasos;
$incr_b = ($amarillo['b'] - $morado['b'])/$pasos;
$cx = imagesx($imagen)/3;
$cy = imagesy($imagen)/3;
$ancho = 240;
$alto = 140;
$incr_x = $ancho/$pasos;
$incr_y = $alto/$pasos;
$r = $morado['r'];
$g = $morado['g'];
$b = $morado['b'];
for($i = 0; $i < $pasos; $i++){
$color = imagecolorallocate($imagen, $r, $g, $b);
imagefilledellipse($imagen, $cx, $cy, $ancho, $alto, $color);
imagefilledellipse($imagen, $ñ, $k, $ancho, $alto, $color);
$r += $incr_r;
$g += $incr_g;
$b += $incr_b;
$ancho -= $incr_x;
$alto -= $incr_y;
}
imagegif($imagen);
imagedestroy($imagen);
?>
型号... 这... http://img88.imageshack.us/img88/11/capturazv.png 无切削
你能告诉我们一个你想要的模型图吗? – Bojangles
我只想要两个椭圆,而这两者之间有一个渐变。我没有模特。 – Bcl00
我无法真正理解“中间有一个渐变的椭圆”是什么意思,你能向我们展示一个你想要的模型吗? – Precursor