Hello. I have a small problem. I'm trying to create a png image on the fly with text on it AND keep the alpha channel of the original png file.
Here is the code for the php file which generates the new png image:
MakeLabel.php
<?
header("Content-type: image/png");
// Arguments:
// $text = The message you want on label
// $type = Base image to use (0 = Gold, 1 = Silver, 2 = Brass)
$BaseImage[0]="GoldBD.png";
$BaseImage[1]="SilverBD.png";
$BaseImage[2]="BrassBD.png";
if($type >= 3) die();
$FileName = "Images/".$BaseImage[$type];
$im = imagecreatefrompng($FileName);
$black = imagecolorallocate($im, 0, 0, 0);
$px = (imagesx($im) - 7.5 * strlen($text)) / 2;
imagestring($im, 3, $px, 9, $text, $black);
imagepng($im);
imagedestroy($im);
?>
Now, here is the html I am using to test it:
pngtest.html
<HTML>
<BODY>
<IMG src="Images/blank.png" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='MakeLabel.php?text=Hello, Foo&type=0')"></IMG>
<br>
<IMG src="Images/blank.png" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='Images/GoldBD.png')"></IMG>
</BODY>
</BODY>
When displaying the html page, the top image has no alpha channel working in it at all (black box around the whole thing). It does spew out the image with "Hello, Foo" on it. It just has no transparency or transluceny in it. Surrounded by black.
The bottom image shows perfectly with the translucent shadow working:

So, what is missing in MakeLabel.php that tells it not to trash the alpha channel in the new image?
Thanks for any help. =)