"Jason Caldwell" <[EMAIL PROTECTED]> wrote in message
> How can I create a dynamic image with PHP?
> Here's what I want to do; I have a counter (kinda) on my website.. and
> counter appears in a certain font -- which most computer systems will not
> have on their systems.
> So -- I want my PHP script to take a variable value; say 34,000 and save
> that as a .GIF or .JPG with a Blue Background, and White OCR A Extended
> 12point non-aliased Font.  With the word "Counter: " in-front of the
> Is this possible with PHP (I hope...!)  Or, is there a *command line*
> utility out there for the Win32 platform that does this?

Yes Jason  it possible if you have GD library (http://www.boutell.com/gd/) .
but i'm not sure if it had in the Win32 platform.

For the tutorial read this article

With my simple code but with unix host and use TTF font. (read another
function at http://th2.php.net/manual/en/ref.image.php)

header ("Content-type: image/png");

$im = imagecreate (100, 20);
$bg = imagecolorallocate ($im, 0, 0, 255);
$white = imagecolorallocate ($im, 255, 255, 255);

imagettftext ($im, 12, 0, 5, 14, $white,
"/home/your_directoty/fonts/ARIAL.TTF", "Counter:34000");
imagepng ($im);
imagedestroy ($im);

PS. Yes GIF is removed from gd because of copyright protect but you can use


> Thanks
> Jason

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to