Load GIFs and PNGs into Flash

Well, have you ever wanted to load a GIF or PNG into your Flash movie? Well now its possible. Here is the code for GIFs


header("Content-type: image/jpeg");

$file = $_GET['file'];

$im_copy = ImageCreateFromGIF($file);

$x = ImageSX($data);
$y = ImageSY($data);

$im = ImageCreateTrueColor($x, $y);

ImageCopyResampled($im, $im_copy, 0, 0, 0, 0, $x, $y, $x, $y);



To implement this you would do something like:


to load PNGs the code is nearly identical. You only have to change this line:

$im_copy = ImageCreateFromGIF($file);


$im_copy = ImageCreateFromPNG($file);

*** I wasn’t really sure what you guys wanted to do with this. If you wanted to do anything. Its just something small. Not really a tutorial. It just outputs the GIF/PNG image as a JPEG.

Just thought someone might be interested by it if you weren’t already aware of it. :slight_smile: Let me know.