Location: PHPKode > projects > PHP Cad and Drawing Program > time/drawimage.php
<?php
$file = $_GET[pfilez];
$w = 180;
$h = 135;
$file = getcwd() . "/$file";
$image = ImageCreateTruecolor($w,$h);
$white = ImageColorAllocate($image,255,255,255);
$black = ImageColorAllocate($image,0,0,0);
if (ereg("[jJ][pP][gG]$",$file))
    $imageb= ImageCreateFromJpeg("$file");
if (ereg("[pP][nN][gG]$",$file))
    $imageb= ImageCreateFromPNG("$file");
$ww=imagesx($imageb);
$hh=imagesy($imageb);
Imagecopyresampled($image,$imageb,0,0,0,0,$w,$h,$ww,$hh);
ImageFilledRectangle($image, 0,0,60,10,$black);
ImageString($image,1,3,0,$_GET[pfilez],$white);
ImagePNG($image);
//ImageJPEG($image);
ImageDestroy($image);
?>
Return current item: PHP Cad and Drawing Program