Приглашаем посетить
Спорт (sport.niv.ru)

SWFGradient

addEntry" HREF="/php/007/function.swfgradient.addentry.html">getshape1" HREF="/php/007/function.swfmorph.getshape1.html">

SWFGradient

(PHP 4 >= 4.0.5)

SWFGradient -- Creates a gradient object

Description

SWFGradient swfgradient ( void )

Внимание

Эта функция является ЭКСПЕРИМЕНТАЛЬНОЙ. Поведение этой функции, ее имя и относящаяся к ней документация могут измениться в последующих версиях PHP без уведомления. Используйте эту функцию на свой страх и риск.

swfgradient() creates a new SWFGradient object.

After you've added the entries to your gradient, you can use the gradient in a shape fill with the swfshape->addfill() method.

SWFGradient has the following methods : swfgradient->addentry().

This simple example will draw a big black-to-white gradient as background, and a reddish disc in its center.

Пример 1. swfgradient() example

<?php

  $m 
= new SWFMovie();
  
$m->setDimension(320240);

  
$s = new SWFShape();

  
// first gradient- black to white
  
$g = new SWFGradient();
  
$g->addEntry(0.0000);
  
$g->addEntry(1.00xff0xff0xff);

  
$f $s->addFill($gSWFFILL_LINEAR_GRADIENT);
  
$f->scaleTo(0.01);
  
$f->moveTo(160120);
  
$s->setRightFill($f);
  
$s->drawLine(3200);
  
$s->drawLine(0240);
  
$s->drawLine(-3200);
  
$s->drawLine(0, -240);

  
$m->add($s);

  
$s = new SWFShape();

  
// second gradient- radial gradient from red to transparent
  
$g = new SWFGradient();
  
$g->addEntry(0.00xff000xff);
  
$g->addEntry(1.00xff000);

  
$f $s->addFill($gSWFFILL_RADIAL_GRADIENT);
  
$f->scaleTo(0.005);
  
$f->moveTo(160120);
  
$s->setRightFill($f);
  
$s->drawLine(3200);
  
$s->drawLine(0240);
  
$s->drawLine(-3200);
  
$s->drawLine(0, -240);

  
$m->add($s);

  
header('Content-type: application/x-shockwave-flash');
  
$m->output();
?>