PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<SWFGradient->addEntrySWFMorph->getshape1>
Last updated: Mon, 16 Jul 2012

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(320, 240);

 
$s = new SWFShape();

 
// first gradient- black to white
 
$g = new SWFGradient();
 
$g->addEntry(0.0, 0, 0, 0);
 
$g->addEntry(1.0, 0xff, 0xff, 0xff);

 
$f = $s->addFill($g, SWFFILL_LINEAR_GRADIENT);
 
$f->scaleTo(0.01);
 
$f->moveTo(160, 120);
 
$s->setRightFill($f);
 
$s->drawLine(320, 0);
 
$s->drawLine(0, 240);
 
$s->drawLine(-320, 0);
 
$s->drawLine(0, -240);

 
$m->add($s);

 
$s = new SWFShape();

 
// second gradient- radial gradient from red to transparent
 
$g = new SWFGradient();
 
$g->addEntry(0.0, 0xff, 0, 0, 0xff);
 
$g->addEntry(1.0, 0xff, 0, 0, 0);

 
$f = $s->addFill($g, SWFFILL_RADIAL_GRADIENT);
 
$f->scaleTo(0.005);
 
$f->moveTo(160, 120);
 
$s->setRightFill($f);
 
$s->drawLine(320, 0);
 
$s->drawLine(0, 240);
 
$s->drawLine(-320, 0);
 
$s->drawLine(0, -240);

 
$m->add($s);

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




<SWFGradient->addEntrySWFMorph->getshape1>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST