Tong-Pak-Fu

A place to relax and discuss.
 
HomePortalFAQSearchRegisterMemberlistUsergroupsLog in

Share | 
 

 Php: Creating Dynamic Images

View previous topic View next topic Go down 
AuthorMessage
EchizenR
Moderator
avatar

Number of posts : 99
Registration date : 2007-03-24

PostSubject: Php: Creating Dynamic Images   Sat May 05, 2007 4:54 am

Mmkay, here is how you create a dynamic image with your own string of text..

Code:
<?php
header("Content-type: image/png");
$im = @imagecreate(200, 15)
  or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 10, 0, 0,  "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>

As you can see it displays a png image with the text, "A Simple Text String".. If you play around with the code you can make it useful ;D
Back to top Go down
View user profile
 
Php: Creating Dynamic Images
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Tong-Pak-Fu :: Graphics And Web Discussion :: Photoshop/Webdesign :: Tutorial :: Web Design Tutorials-
Jump to: