You are here: GD write text into image « PHP Language « IT news, forums, messages
GD write text into image

Posted by misiek on 04/12/07 22:05

Is it possible to write a some text to the image and save it to other
name useing GD library and functions ?

If yes can you tell me which function I gotta use maybe same samples ?

I was trying using this script

<?php

srand((double)microtime()*1234567); // Start the random gizmo
$image = imagecreatefromgif("google.gif"); // Get a background

$font =
"/opt/sun-jdk-1.5.0.10/jre/lib/fonts/LucidaTypewriterRegular.ttf"; //
Get a font

$textcolor = imagecolorallocate($image,0,0,0); // Set text color

$text1 = "FR. 4/23"; // Here is our text

imagefttext($image, 50, 0, 20, 50, $textcolor, $font, $text1); // Write
the text with a font

header("Content-type: image/jpeg"); // Its a JPEG
imagegif($image,'',90); // Zap it to the browser
imagedestroy($image); // Memory Freeupage

?>


but it only write a text in header actually not saving into image.

Thank You for help

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация