No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

Rechercher une fonction PHP

SWFBitmap::__construct

(PHP 5 < 5.3.0, PECL ming SVN)

SWFBitmap::__constructLoads Bitmap object

Description

SWFBitmap::__construct ( mixed $file [, mixed $alphafile ] )
Warning

This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk.

Creates the new SWFBitmap object from the given file.

PHP: SWFBitmap::__construct - Manual Home of Manuel PHP  Contents Haut

Parameters

For both parameters you can provide a file pointer returned by fopen() or the image data, as a binary string.

file

Note:

We can only deal with baseline (frame 0) jpegs, no baseline optimized or progressive scan jpegs!

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.

alphafile

An MSK file to be used as an alpha mask for a JPEG image.

PHP: SWFBitmap::__construct - Manual Home of Manuel PHP  Contents Haut

Examples

Example #1 Importing a DBL file

<?php
$s 
= new SWFShape();
$f $s->addFill(new SWFBitmap(file_get_contents("image.dbl")));
$s->setRightFill($f);

$s->drawLine(320);
$s->drawLine(032);
$s->drawLine(-320);
$s->drawLine(0, -32);

$m = new SWFMovie();
$m->setDimension(3232);
$m->add($s);

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

Example #2 Using an alpha mask

<?php

$s 
= new SWFShape();

// .msk file generated with "gif2mask" utility
$f $s->addFill(new SWFBitmap(file_get_contents("alphafill.jpg"), file_get_contents("alphafill.msk")));
$s->setRightFill($f);

$s->drawLine(6400);
$s->drawLine(0480);
$s->drawLine(-6400);
$s->drawLine(0, -480);

$c = new SWFShape();
$c->setRightFill($c->addFill(0x990x990x99));
$c->drawLine(400);
$c->drawLine(040);
$c->drawLine(-400);
$c->drawLine(0, -40);

$m = new SWFMovie();
$m->setDimension(640480);
$m->setBackground(0xcc0xcc0xcc);

// 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();
?>

Find a PHP function

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-swfbitmap.construct.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:fr Manuel PHP : http://php.net

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut