Bug #53757 [Opn->Asn]: can't change the background
| From: | ross@php.net | Date: | Sat, 15 Jan 2011 15:33:13 +0000 |
| Subject: | Bug #53757 [Opn->Asn]: can't change the background | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5807@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53757&edit=1
ID: 53757
Updated by: ross@php.net
Reported by: mesmsgs at gmail dot com
Summary: can't change the background
-Status: Open
+Status: Assigned
Type: Bug
-Package: Website problem
+Package: Documentation problem
Operating System: Windows 7
PHP Version: 5.2.17
-Assigned To:
+Assigned To: ross
Block user comment: N
Private report: N
New Comment:
Hi,
You are correct, the example is wrong as imagecolorallocate only sets
the
background colour on palette-based images (imagecreatetruecolor should
be
imagecreate). I'll fix the example.
Previous Comments:
------------------------------------------------------------------------
[2011-01-15 16:05:44] mesmsgs at gmail dot com
Description:
------------
---
From manual page:
http://www.php.net/function.imagefilledellipse#Exemples
---
I can't change the background color
Test script:
---------------
<?php
// create a blank image
$image = imagecreatetruecolor(400, 300);
// fill the background color
$bg = imagecolorallocate($image, 255, 255, 255);
// choose a color for the ellipse
$col_ellipse = imagecolorallocate($image, 0, 0, 0);
// draw the white ellipse
imagefilledellipse($image, 200, 150, 300, 200, $col_ellipse);
// output the picture
header("Content-type: image/png");
imagepng($image);
?>
Expected result:
----------------
The background color must be white
Actual result:
--------------
Only black background
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53757&edit=1