Make PNG background transparent. It's black by default
This commit is contained in:
committed by
Michael Larabel
parent
811a53bc3b
commit
b0046d9414
@@ -140,6 +140,11 @@ class pts_svg_dom_gd
|
||||
if(extension_loaded('gd') && function_exists('imagettftext') && $width > 1 && $height > 1)
|
||||
{
|
||||
$gd = imagecreatetruecolor($width, $height);
|
||||
# Make the background transparent; otherwise it's black
|
||||
imagesavealpha($gd, true);
|
||||
$alp_clr = imagecolorallocatealpha($gd, 0, 0, 0, 127);
|
||||
imagefill($gd, 0, 0, $alp_clr);
|
||||
|
||||
if(function_exists('imageresolution'))
|
||||
{
|
||||
imageresolution($gd, 200);
|
||||
|
||||
Reference in New Issue
Block a user