Exemplo 1. Exemplo imagefilledpolygon()
<?php
// este exemplo foi dado por ecofarm at mullum dot com dot au
// define uma matriz de pontos para o poligono $values = array( 0 => 40, // x1 1 => 50, // y1 2 => 20, // x2 3 => 240, // y2 4 => 60, // x3 5 => 60, // y3 6 => 240, // x4 7 => 20, // y4 8 => 50, // x5 9 => 40, // y5 10 => 10, // x6 11 => 10, // y6 );
// cria a imagem $im = imagecreate(250, 250);
// algumas cores $bg = imagecolorallocate($im, 255, 255, 255); $blue = imagecolorallocate($im, 0, 0, 255);
// desenha um poligono imagefilledpolygon($im, $values, 6, $blue );
// envia a imagem header('Content-type: image/png'); imagepng($im); imagedestroy($im);
?>
|
|