ID:               28490
 User updated by:  philippe dot nonn at capgemini dot com
 Reported By:      philippe dot nonn at capgemini dot com
 Status:           Bogus
 Bug Type:         GD related
 Operating System: Windows XP / IIS
 PHP Version:      4.3.6
 New Comment:

Thak'a a lot, Pierre : Using function ImageFilledArc permits to get the
expected pie result.

However, the older way of proceeding worked well with many older
versions of php : drowing the 2 radius and the arc of cercle, and then
asking to fill with color the defined surface starting from a spot in
the center of it.

For me, the problem is now fixed. I hope that the FillToBorder function
will be OK for other people using more complex figures.

Philippe


Previous Comments:
------------------------------------------------------------------------

[2004-05-22 23:55:00] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

It works as expected. I only looked the non filled arc and compare with
filled area. It is exactly what I expect.

--Pierre

------------------------------------------------------------------------

[2004-05-22 23:52:04] [EMAIL PROTECTED]

Hello,

Are you talking about the lower left gap (at 50 deg)?

Anyway, please provide a script which only fills an area. You can
provide a link to the source and expected result images.

I feel like you should take a look here:
http://www.php.net/imagefilledarc

-- Pierre

------------------------------------------------------------------------

[2004-05-22 20:39:17] philippe dot nonn at capgemini dot com

find above a script showing the part of pie not completely filled of
red color

Philippe

<?php
     /*
    ** Convertir les degr�s en radians
    */
    function radians($degrees)
    {
        return($degrees * (pi()/180.0));
    }

    /*
    ** prendre x,y dans le cercle,
    ** centre = 0,0
    */
      function circle_point($degrees, $diameter)
      {
        $x = cos(radians($degrees)) * ($diameter/2);
        $y = sin(radians($degrees)) * ($diameter/2);

        return (array($x, $y));
      }


    $image = imagecreate(400, 400 );
    //arri�re-plan
    //couleurs
    $colorBody = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
    imagefill($image, 0, 0, $colorBody);
    $CurrentColor = imagecolorallocate($image, 0xFF, 0x00, 0x00);
    $ChartCenterX = 200;
    $ChartCenterY =200;
    $ChartDiameter = 300;
    $StartDegrees = 0;
    $EndDegrees = 50;
    

                //dessiner un arc
                imagearc($image,
                    $ChartCenterX,
                    $ChartCenterY,
                    $ChartDiameter,
                    $ChartDiameter,
                    $StartDegrees,
                    $EndDegrees,
                    $CurrentColor);
        
                //Tracer le d�but de la ligne � partir du centre
                list($ArcX, $ArcY) = circle_point($StartDegrees,
$ChartDiameter);
                imageline($image,
                    $ChartCenterX,
                    $ChartCenterY,
                    floor($ChartCenterX + $ArcX),
                    floor($ChartCenterY + $ArcY),
                    $CurrentColor);
        
        
                //dessiner la fin de la ligne
                list($ArcX, $ArcY) = circle_point($EndDegrees,
$ChartDiameter);
                imageline($image,
                    $ChartCenterX,
                    $ChartCenterY,
                    ceil($ChartCenterX + $ArcX),
                    ceil($ChartCenterY + $ArcY),
                    $CurrentColor);

                if (($EndDegrees - $StartDegrees) > 1)  
                        {
                        //remplir les portions
                        $MidPoint = round((($EndDegrees - $StartDegrees)/2) + 
$StartDegrees);
                        list($ArcX, $ArcY) = circle_point($MidPoint,
$ChartDiameter/2);
                        imagefilltoborder($image,
                            floor($ChartCenterX + $ArcX),
                            floor($ChartCenterY + $ArcY),
                            $CurrentColor,
                            $CurrentColor);
                        }
       //afficher l'image
    header("Content-type: image/jpeg");
    imagejpeg($image);
php?>

------------------------------------------------------------------------

[2004-05-22 17:40:03] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.

------------------------------------------------------------------------

[2004-05-22 17:00:42] philippe dot nonn at capgemini dot com

Description:
------------
Using the las version of Graphical Library PHP_GD2 leads to display
images which are only partially filled when using the function
ImageFillToBorder.
It looks like only the upper part of the zone which should be filled
gets the selected color.
The problem doesn't appear when using le 4.3.5 version of php_gd2.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28490&edit=1

Reply via email to