downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

SWFMorph> <SWFGradient->addEntry
Last updated: Fri, 14 Aug 2009

view this page in

SWFGradient->__construct

(PHP 5 <= 5.3.0, PECL ming CVS)

SWFGradient->__constructCrée un objet gradient

Description

SWFGradient __construct ( void )
Avertissement

Cette fonction est EXPERIMENTALE. Cela signifie que le comportement de cette fonction, son nom et, concrètement, TOUT ce qui est documenté ici peut changer dans un futur proche, SANS PREAVIS ! Soyez-en conscient, et utilisez cette fonction à vos risques et périls.

swfgradient() crée un nouvel objet SWFGradient.

Après avoir ajouter des entrées à votre gradient, vous pouvez utiliser le gradient dans une forme avec la méthode swfshape->addfill().

SWFGradient a les méthodes suivantes : swfgradient->addentry().

Cet exemple simple trace un gradient noir et blanc, en arrière plan et un disque au centre.

Exemple #1 Exemple avec swfgradient()

<?php

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

  
$s = new SWFShape();

  
// premier gradient - noir vers blanc
  
$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 - gradient radial, depuis le rouge vers 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();
?>



add a note add a note User Contributed Notes
SWFGradient->__construct
There are no user contributed notes for this page.

SWFMorph> <SWFGradient->addEntry
Last updated: Fri, 14 Aug 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites