0) { $use_ttf = 1; } else { $use_ttf = 0; } // Check for GD >= 2, create base image if(gd_version() >= 2) { $im = imagecreatetruecolor($img_width, $img_height); } else { $im = imagecreate($img_width, $img_height); } // No GD support, die. if(!$im) { die("No GD support."); } // Fill the background with white $bg_color = imagecolorallocate($im, 255, 255, 255); imagefill($im, 0, 0, $bg_color); // Draw random circles, squares or lines? draw_lines($im); // Write the image string to the image draw_string($im, $imagestring); // Draw a nice border around the image $border_color = imagecolorallocate($im, 0, 0, 0); imagerectangle($im, 0, 0, $img_width-1, $img_height-1, $border_color); // Output the image #header("Content-type: image/png"); imagepng($im); imagedestroy($im); exit; ?>