将png加载到SWFBitmap中



我无法将dbl文件加载到SWFBitmap对象中。

代码如下:

<?php
$png = file_get_contents("/home/damiano/a.dbl");
$img = new SWFBitmap($png);
die();
?>

That throw me out a:

Fatal error: opening bitmap file failed in /var/www/misterjoke/ming.php on line 3

在shell中,我简单地将文件转换为:

png2dbl a.png

file_get_contents的输出返回一个二进制字符串。怎么了? ?

这就是你可以在http://ch.php.net/manual/de/class.swfbitmap.php

上找到的内容

这个行不通:

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

但这将工作良好:

<?php 
 $f = $s->addFill(new SWFBitmap((fopen('image.jpg','rb'))); 
?>

最新更新