LittleHavoc
IS-IT--Management
Hello all,
found a major problem that is really bugging me.
I can create an image and displaying it as a PNG as follows
$width=160;
$height=120;
$image=ImageCreate($width, $height);
$transparent = ImageColorAllocate ($image, 0xFF, 0x00, 0x88);
imagefilledrectangle($image, 0, 0, $width, $height, $transparent);
imagecolortransparent($image,$transparent);
imagepng($image);
Which works great but because its paletted there are only 256 colours and I will be using it to resize true colour images. Keeping the aspect-ratio requires the image be padded out.
SO I use $image=ImageCreateTrueColour($width, $height); instead, giving a great range of colors.
BUT now the image is not transparent.
Can anyone supply some missing function or code to create a true color PNG image with a transparent background.
found a major problem that is really bugging me.
I can create an image and displaying it as a PNG as follows
$width=160;
$height=120;
$image=ImageCreate($width, $height);
$transparent = ImageColorAllocate ($image, 0xFF, 0x00, 0x88);
imagefilledrectangle($image, 0, 0, $width, $height, $transparent);
imagecolortransparent($image,$transparent);
imagepng($image);
Which works great but because its paletted there are only 256 colours and I will be using it to resize true colour images. Keeping the aspect-ratio requires the image be padded out.
SO I use $image=ImageCreateTrueColour($width, $height); instead, giving a great range of colors.
BUT now the image is not transparent.
Can anyone supply some missing function or code to create a true color PNG image with a transparent background.