Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/05/2011, 05:23
Pepe_1988
 
Fecha de Ingreso: enero-2011
Mensajes: 26
Antigüedad: 13 años, 3 meses
Puntos: 1
Problemas con imágenes dinámicas PHP

Tengo un problema gordo a la hora de pintar un quesito de estadisticas...
Este es el código:

<?php
// Creamos la imagen
$im = imagecreate(200,200);

// Definimos un color para el quesito
$fondo = imagecolorallocate ($im, 255,255,255);
$rojo = imagecolorallocate ($im, 255,0,0);
$rojo_oscuro = imagecolorallocate ($im, 150,0,0);
$verde = imagecolorallocate ($im, 0, 255,0);
$verde_oscuro = imagecolorallocate ($im, 0, 150,0);
$azul = imagecolorallocate ($im, 0, 0, 255);
$azul_oscuro = imagecolorallocate ($im, 0, 0, 150);

// Dibujamos el efecto sombra 3D

for ($i = 0; $i < 10; $i ++){
imagefilledarc ($im, 100, 100+(10-$i), 200, 175, 0, 45, $rojo_oscuro, IMG_ARC_PIE);
imagefilledarc ($im, 100, 100+(10-$i), 200, 175, 45, 145, $verde_oscuro, IMG_ARC_PIE);
imagefilledarc ($im, 100, 100+(10-$i), 200, 175, 145, 360, $azul_oscuro, IMG_ARC_PIE);
}

// Dibujamos el quesito
imagefilledarc ($im, 100, 100, 200, 175, 0, 45, $rojo, IMG_ARC_PIE);
imagefilledarc ($im, 100, 100, 200, 175, 45, 145, $verde, IMG_ARC_PIE);
imagefilledarc ($im, 100, 100, 200, 175, 145, 360, $azul, IMG_ARC_PIE);

// Enviamos la imagen
header("Content-type: image/png");
imagepng($im);
?>

Si el código lo pongo en una página en blanco me funciona, pero a la hora de insertarlo en mi página, además de salirme carácteres raros, me tira el siguiente warning:
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\eclipse\Proyecto Integrado\lib\funciones.php:15) in C:\xampp\htdocs\eclipse\Proyecto Integrado\web\estadisticas.php on line 73

¿Qué carajo me está pasando?