freelance programmers outsource from india freelance programmers  chennai india programmers freelance programmers  freelance php coder freelance outsource scripts freelance programmers programming complicated perl patterns freelance programmers php module installation freelance programmers
freelance programmers  outsource from india freelance programmers  perl installation and configuration freelance programmers  php installation linux system freelance programmers administration US$15,US$19,US$11,US$10 cheap programmer
india outsource outsource india chennai india programmers php perl mysql freelance freelance programmer
SHOWCASE of php and perl scripts CONTACT US for php custom perl scripts
HOME
 

SWFBitmap

(PHP 4 >= 4.0.5)

SWFBitmap -- Loads Bitmap object

Description

SWFBitmap swfbitmap ( mixed file [, mixed alphafile] )

Warning

This function is EXPERIMENTAL. The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP. Use this function at your own risk.

swfbitmap() creates a new SWFBitmap object from the Jpeg or DBL file in file. alphafile is a MSK file to be used as an alpha mask for a Jpeg image. Both parameters can be fopen() resources or binary strings.

Note: 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.

Example 1. Import PNG files

<?php
  $s
= new SWFShape();
  
$f = $s->addFill(new SWFBitmap(file_get_contents("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.

Example 2. swfbitmap() example

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

Copyright © 1997 - 2007 by the PHP Documentation Group. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later. A copy of the Open Publication License is distributed with this manual, the latest version is presently available at http://www.opencontent.org/openpub/. Please see full copyright text at http://www.php.net/manual/en/copyright.php Original version of the above documentation is available at http://www.php.net/manual/en/



  1. Please click on Cable tv Service Navigator gateway project
  2. Please Also click on our Web developers Showcase



Web design and Programming Copyright @ Chrisranjana.com 1999-2007. Website designed and Webdevelopers and Website programmed by Web developers and Software programmers. We do excellent software development in asp and .net c# csharp also