$width = 500;
$height = 500;
03
$im = Imagecreatetruecolor ($width, $height);
05
$red = Imagecolorallocate ($im, 230, 0, 0);
Imagefill ($im, 0, 0, $red);
08
$yellow = Imagecolorallocate ($im, 255, 255, 0);
10
11//Set the edge length of the positive Pentagon formed by the five vertices that draw the pentagram
$b = 100;
$pi =3.14/180;
14
$p 1x = 150;
$p 1y = 250;
17
$p 2x = 150+ (cos (36* $pi) * $b);
$p 2y = 250-(sin (36* $pi) * $b);
20
$p 3x = 150+ (2*cos (36* $pi) * $b);
$p 3y = 250;
23
$p 4x = $p 3x-sin (18* $pi) * $b;
$p 4y = 250+cos (18* $pi) * $b;
26
$p 5x = 150+sin (18* $pi) * $b;
$p 5y = 250+cos (18* $pi) * $b;
29
30//Connect the corresponding point draw line
Imageline ($im, $p 1x, $p 1y, $p 3x, $p 3y, $yellow);
Imageline ($im, $p 1x, $p 1y, $p 4x, $p 4y, $yellow);
33
Imageline ($im, $p 2x, $p 2y, $p 4x, $p 4y, $yellow);
Imageline ($im, $p 2x, $p 2y, $p 5x, $p 5y, $yellow);
36
Panax Notoginseng imageline ($im, $p 3x, $p 3y, $p 5x, $p 5y, $yellow);
38
(' Content-type:image/png ');
40
Imagepng ($im);
42
Imagedestroy ($im);
44
?>
http://www.bkjia.com/PHPjc/478005.html www.bkjia.com true http://www.bkjia.com/PHPjc/478005.html techarticle the $width of the $height =; $im = Imagecreatetruecolor ($width, $height); $red = Imagecolorallocate ( $im, 230, 0, 0); Imagefill ($im, 0, 0, $red); $yellow ...