|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-08-26 02:07 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 21:00:01 2025 UTC |
Description: ------------ When I use imageCreateTrueColor instead of imageCreate, and I call imagecolorAllocate(), the background color won't be changed. I got a black background instead of a green. My gd version is bundled (2.0.28 compatible) Reproduce code: --------------- <?php $image1=imageCreate(100, 100); $image2=imageCreateTrueColor(100, 100); $green1=imageColorAllocate($image1, 0, 128, 256); $green2=imageColorAllocate($image2, 0, 128, 256); print'In case of imagCreate(): '; if(imageColorAt($image1, 1, 1)==$green1){ print'Ok, background is green.'; }else{ print'Background is black.'; } print'<br>In case of imagCreateTrueColor(): '; if(imageColorAt($image2, 1, 1)==$green2){ print'Ok, background is green.'; }else{ print'Background is black.'; } ?> Expected result: ---------------- In case of imagCreate(): Ok, background is green. In case of imagCreateTrueColor(): Ok, background is green. Actual result: -------------- In case of imagCreate(): Ok, background is green. In case of imagCreateTrueColor(): Background is black.