Comunitatea PHP Romania
 

 
imagefilledpolygon

imagefilledpolygon

(PHP 3, PHP 4 , PHP 5)

imagefilledpolygon -- Draw a filled polygon

Description

int imagefilledpolygon ( resource image, array points, int num_points, int color)

imagefilledpolygon() creates a filled polygon in image image. points is a PHP array containing the polygon's vertices, i.e. points[0] = x0, points[1] = y0, points[2] = x1, points[3] = y1, etc. num_points is the total number of vertices.

Exemplu 1. imagefilledpolygon() example

<?php

// this example is provided by ecofarm at mullum dot com dot au

// set up array of points for polygon
$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
);

// create image
$im = imagecreate(250, 250);

// some colors
$bg   = imagecolorallocate($im, 255, 255, 255);
$blue = imagecolorallocate($im, 0, 0, 255);

// draw a polygon
imagefilledpolygon($im, $values, 6, $blue );

// flush image
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);

?>

Ultimele discutii in forum RSS Forum

Ultimele articole Ultimele articole

Top membri

Pirahna Pirahna
la birou
carco carco
Bucuresti
Birkoff Birkoff
Bucuresti
mihaitha mihaitha
Sibiu
Mascka Mascka
Braila
gabysolomon gabysolomon
Bacau
whooper whooper
Toronto ON
raul_ raul_
dechim dechim
Drobeta Turnu Severin
Amenthes Amenthes

Newsletter


Email:
 inscriere
 renuntare
 
 Arhiva newsletter

Parteneriat

Copyright © 2001-2008 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink Secured Loans | Free Advertising | Remortgages | Loan | Loans
Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
Powered by Simplis