[Back to list] [Execute]
<?php
// Velox Letum (2005)
// elementation@gmail.com
// http://www.nanoshock.net
// Create truecolor image...required for alpha layering
$image = imagecreatetruecolor(350, 350);
$height = imagesy($image);
$width = imagesx($image);
// Define colors
$white = imagecolorallocate($image, 255, 255, 255);
$black = imagecolorallocate($image, 0, 0, 0);
$red = imagecolorallocatealpha($image, 255, 0, 0, 64);
$green = imagecolorallocatealpha($image, 0, 255, 0, 64);
$blue = imagecolorallocatealpha($image, 0, 0, 255, 64);
// Load Font
$font = "fonts/verdana.ttf";
$points = array(
0,0,
200,0,
ceil(rand(200, 350)),ceil(rand(200, 350))
);
imagefilledrectangle($image, 0, 0, $height, $width, $white);
imagefilledpolygon($image, $points, 3, $blue);
imagettftext ($image, 8, 0, $width-148, $height-2, $black, $font, "Polygons and Alpha Colors.");
header("Content-type: image/png");
imagepng($image);
imagedestroy($image);
?>
|
|