SWFShape- addFill

(no version information, might be only in CVS)

SWFShape- addFill -- 塗りつぶし色をシェープに追加する

説明

void swfshape- addfill ( int red, int green, int blue [, int a])

警告

この関数は、 実験的 なステータスにあります。これは、この関数の 動作、関数名、ここで書かれていること全てがPHPの将来のバージョンで予告 なく変更される可能性があることを意味します。注意を喚起するとともに自分 のリスクでこの関数を使用して下さい。

void swfshape- addfill ( SWFbitmap bitmap [, int flags])

警告

この関数は、 実験的 なステータスにあります。これは、この関数の 動作、関数名、ここで書かれていること全てがPHPの将来のバージョンで予告 なく変更される可能性があることを意味します。注意を喚起するとともに自分 のリスクでこの関数を使用して下さい。

void swfshape- addfill ( SWFGradient gradient [, int flags])

警告

この関数は、 実験的 なステータスにあります。これは、この関数の 動作、関数名、ここで書かれていること全てがPHPの将来のバージョンで予告 なく変更される可能性があることを意味します。注意を喚起するとともに自分 のリスクでこの関数を使用して下さい。

swfshape- addfill() adds a solid fill to the shape's list of fill styles. swfshape- addfill() accepts three different types of arguments.

red , green , blue is a color (RGB mode). Last parameter a is optional.

The bitmap argument is an swfbitmap() object. The flags argument can be one of the following values : SWFFILL_CLIPPED_BITMAP or SWFFILL_TILED_BITMAP. Default is SWFFILL_TILED_BITMAP. I think.

The gradient argument is an swfgradient() object. The flags argument can be one of the following values : SWFFILL_RADIAL_GRADIENT or SWFFILL_LINEAR_GRADIENT. Default is SWFFILL_LINEAR_GRADIENT. I'm sure about this one. Really.

swfshape- addfill() returns an swffill() object for use with the swfshape- setfill() functions described below.

See also swfshape- setfill() .

This simple example will draw a frame on a bitmap. Ah, here's another buglet in the flash player- it doesn't seem to care about the second shape's bitmap's transformation in a morph. According to spec, the bitmap should stretch along with the shape in this example..

例 1 swfshape- addfill() example

 ?php

  $p = new SWFMorph();

  $b = new SWFBitmap("alphafill.jpg");
  // use your own bitmap
  $width = $b- getWidth();
  $height = $b- getHeight();

  $s = $p- getShape1();
  $f = $s- addFill($b, SWFFILL_TILED_BITMAP);
  $f- moveTo(-$width/2, -$height/4);
  $f- scaleTo(1.0, 0.5);
  $s- setLeftFill($f);
  $s- movePenTo(-$width/2, -$height/4);
  $s- drawLine($width, 0);
  $s- drawLine(0, $height/2);
  $s- drawLine(-$width, 0);
  $s- drawLine(0, -$height/2);

  $s = $p- getShape2();
  $f = $s- addFill($b, SWFFILL_TILED_BITMAP);

  // these two have no effect!
  $f- moveTo(-$width/4, -$height/2);
  $f- scaleTo(0.5, 1.0);

  $s- setLeftFill($f);
  $s- movePenTo(-$width/4, -$height/2);
  $s- drawLine($width/2, 0);
  $s- drawLine(0, $height);
  $s- drawLine(-$width/2, 0);
  $s- drawLine(0, -$height);

  $m = new SWFMovie();
  $m- setDimension($width, $height);
  $i = $m- add($p);
  $i- moveTo($width/2, $height/2);

  for($n=0; $n 1.001; $n+=0.03)
  {
    $i- setRatio($n);
    $m- nextFrame();
  }

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