SWFDisplayItem->multColor

(no version information, might be only in CVS)

SWFDisplayItem->multColor -- Multiplies the item's color transform

Description

void swfdisplayitem->multcolor ( int red, int green, int blue [, int a] )

警示

本函數是實驗性的。本函數的行為,內含函數名稱以及其它任何關於本函數的文件可能會在沒有知會的情況下隨 PHP 以後的發佈而改變。使用本函數風險自擔。

swfdisplayitem->multcolor() multiplies the item's color transform by the given values.

The object may be a swfshape(), a swfbutton(), a swftext() or a swfsprite() object. It must have been added using the swfmovie->add().

This simple example will modify your picture's atmosphere to Halloween (use a landscape or bright picture).

例子 1. swfdisplayitem->multcolor() example

<?php

  $b 
= new SWFBitmap(file_get_contents("backyard.jpg"));
  
// note use your own picture :-)
  
$s = new SWFShape();
  
$s->setRightFill($s->addFill($b));
  
$s->drawLine($b->getWidth(), 0);
  
$s->drawLine(0$b->getHeight());
  
$s->drawLine(-$b->getWidth(), 0);
  
$s->drawLine(0, -$b->getHeight());

  
$m = new SWFMovie();
  
$m->setDimension($b->getWidth(), $b->getHeight());

  
$i $m->add($s);

  for (
$n=0$n<=20; ++$n) {
    
$i->multColor(1.0-$n/101.01.0);
    
$i->addColor(0xff*$n/2000);
    
$m->nextFrame();
  }

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