ID: 36218 User updated by: jumo at gmx dot de Reported By: jumo at gmx dot de Status: Open Bug Type: GD related Operating System: debian PHP Version: 5.1.2 New Comment:
excuse my bad english! Previous Comments: ------------------------------------------------------------------------ [2006-01-30 23:46:58] jumo at gmx dot de Description: ------------ I want to draw many squares on a PNG image, wich have changing color. after some correct drawed there is only one color used. Reproduce code: --------------- <?php $bigsize = 500; $colours = array( 'FF0000' , '00FF00' ); header("Content-type: image/png"); $im = imagecreate( $bigsize * 2 , 50 ); for( $j = 0; $j < $bigsize ; $j++ ) { $k = $j % count( $colours ); $r = hexdec( substr( $colours[ $k ] , 0 , 2 ) ); $g = hexdec( substr( $colours[ $k ] , 2 , 2 ) ); $b = hexdec( substr( $colours[ $k ] , 4 , 2 ) ); $fill = imagecolorallocate($im, $r , $g , $b ); imagefilledrectangle( $im , 2*$j , 0 , 2*$j+1 , 50 , $fill ); } imagepng($im); imagedestroy($im); ?> Expected result: ---------------- a bar with red and green vertical stripes wich have changing colors. Actual result: -------------- the right half of the bar is green. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36218&edit=1