Codice PHP:
// Set the content-type
header("Content-type: image/png");
$width=400;//aggiunto da nivasio :9
$height=30;//aggiunto da nivasio :9
// Create the image
//$im = imagecreatetruecolor($width, $height);//aggiunto da nivasio :9
$im = imagecreatefromjpeg('prova.jpg');
// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
$verde = imagecolorallocate($im, 0, 255, 0); //aggiunto da nivasio :9
// The text to draw
$text = '(c) Copyright';
// Replace path by your own font path
$font="times.ttf";
$bordo=3;//aggiunto da nivasio :9
// Add the text
imagettftext($im, 12,0, -10, 30, $white, $font, $text);
imagettftext($im, 12,0, 250, 30, $white, $font, $text);
imagettftext($im, 12,0, 510, 30, $white, $font, $text);
imagettftext($im, 12,0, -30, 70, $white, $font, $text);
imagettftext($im, 12,0, 230, 70, $white, $font, $text);
imagettftext($im, 12,0, 490, 70, $white, $font, $text);
imagettftext($im, 12,0, -50, 110, $white, $font, $text);
imagettftext($im, 12,0, 210, 110, $white, $font, $text);
imagettftext($im, 12,0, 470, 110, $white, $font, $text);
imagettftext($im, 12,0, -10, 150, $white, $font, $text);
imagettftext($im, 12,0, 250, 150, $white, $font, $text);
imagettftext($im, 12,0, 510, 150, $white, $font, $text);
imagettftext($im, 12,0, -30, 190, $white, $font, $text);
imagettftext($im, 12,0, 230, 190, $white, $font, $text);
imagettftext($im, 12,0, 490, 190, $white, $font, $text);
imagettftext($im, 12,0, -50, 230, $white, $font, $text);
imagettftext($im, 12,0, 210, 230, $white, $font, $text);
imagettftext($im, 12,0, 470, 230, $white, $font, $text);
imagettftext($im, 12,0, -10, 270, $white, $font, $text);
imagettftext($im, 12,0, 250, 270, $white, $font, $text);
imagettftext($im, 12,0, 510, 270, $white, $font, $text);
imagettftext($im, 12,0, -30, 310, $white, $font, $text);
imagettftext($im, 12,0, 230, 310, $white, $font, $text);
imagettftext($im, 12,0, 490, 310, $white, $font, $text);
imagettftext($im, 12,0, -50, 350, $white, $font, $text);
imagettftext($im, 12,0, 210, 350, $white, $font, $text);
imagettftext($im, 12,0, 470, 350, $white, $font, $text);
imagettftext($im, 12,0, -10, 390, $white, $font, $text);
imagettftext($im, 12,0, 250, 390, $white, $font, $text);
imagettftext($im, 12,0, 510, 390, $white, $font, $text);
imagettftext($im, 12,0, -30, 430, $white, $font, $text);
imagettftext($im, 12,0, 230, 430, $white, $font, $text);
imagettftext($im, 12,0, 490, 430, $white, $font, $text);
imagettftext($im, 12,0, -50, 470, $white, $font, $text);
imagettftext($im, 12,0, 210, 470, $white, $font, $text);
imagettftext($im, 12,0, 470, 470, $white, $font, $text);
// Using imagepng() results in clearer text compared with imagejpeg()
imagejpeg($im);
imagedestroy($im);