|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-03-13 19:53 UTC] [email protected]
[2006-03-13 22:56 UTC] [email protected]
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 11:00:02 2025 UTC |
Description: ------------ If the function imagecreatetruecolor function is used instead of imagecreate the transparent color seems to get lost when scaling down the color palette if the image is exported as gif. Reproduce code: --------------- <?php header ("Content-type: image/png"); $im = @imagecreatetruecolor(50, 100) or die ("Kann keinen neuen GD-Bild-Stream erzeugen"); #$im = @imagecreate(50, 100) # or die ("Kann keinen neuen GD-Bild-Stream erzeugen"); $background_color = ImageColorAllocate ($im, 100, 100, 100); $rect_color = ImageColorAllocate ($im, 200, 0, 0); ImageFilledRectangle($im,0,0,50,100,$backgroundcolor); ImageFilledRectangle($im,0,0,50,50,$rect_color); $text_color = ImageColorAllocate ($im, 233, 14, 91); ImageString ($im, 1, 5, 5, "Ein Test-String", $text_color); $res = imagecolortransparent($im, $background_color); #var_dump($res);var_dump($background_color); ImageGIF($im); ?>