SWFBitmap
(PHP 4 >= 4.0.5)
SWFBitmap -- Loads Bitmap object
Description
new
swfbitmap ( string filename [, int alphafilename])
주의 |
이 함수는
실험적입니다. 이 함수의 작동, 함수의 이름,
그리고 이 함수에 대해 모든 문서는 이후의 PHP 릴리즈에서 예고 없이
변경할 수 있습니다. 이 함수의 사용에 관한 것은 사용자
책임입니다. |
swfbitmap() creates a new SWFBitmap object from
the Jpeg or DBL file named filename.
alphafilename indicates a MSK file to
be used as an alpha mask for a Jpeg image.
참고:
We can only deal with baseline (frame 0) jpegs, no baseline optimized or
progressive scan jpegs!
SWFBitmap has the following methods : swfbitmap->getwidth()
and swfbitmap->getheight().
You can't import png images directly, though- have to use the png2dbl
utility to make a dbl ("define bits lossless") file from the png.
The reason for this is that I don't want a dependency on the png library
in ming- autoconf should solve this, but that's not set up yet.
예 1. Import PNG files
<?php $s = new SWFShape(); $f = $s->addFill(new SWFBitmap("png.dbl")); $s->setRightFill($f);
$s->drawLine(32, 0); $s->drawLine(0, 32); $s->drawLine(-32, 0); $s->drawLine(0, -32);
$m = new SWFMovie(); $m->setDimension(32, 32); $m->add($s);
header('Content-type: application/x-shockwave-flash'); $m->output(); ?>
|
|
And you can put an alpha mask on a jpeg fill.
예 2. swfbitmap() example
<?php
$s = new SWFShape();
// .msk file generated with "gif2mask" utility $f = $s->addFill(new SWFBitmap("alphafill.jpg", "alphafill.msk")); $s->setRightFill($f);
$s->drawLine(640, 0); $s->drawLine(0, 480); $s->drawLine(-640, 0); $s->drawLine(0, -480);
$c = new SWFShape(); $c->setRightFill($c->addFill(0x99, 0x99, 0x99)); $c->drawLine(40, 0); $c->drawLine(0, 40); $c->drawLine(-40, 0); $c->drawLine(0, -40);
$m = new SWFMovie(); $m->setDimension(640, 480); $m->setBackground(0xcc, 0xcc, 0xcc);
// draw checkerboard background for ($y=0; $y<480; $y+=40) { for ($x=0; $x<640; $x+=80) { $i = $m->add($c); $i->moveTo($x, $y); }
$y+=40;
for ($x=40; $x<640; $x+=80) { $i = $m->add($c); $i->moveTo($x, $y); } }
$m->add($s);
header('Content-type: application/x-shockwave-flash'); $m->output(); ?>
|
|