What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » overlaying text on image in php

overlaying text on image in php
Author: Message:
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
RE: overlaying text on image in php
ImageTTFText works with line-endings.

code:
<?php
  header("Content-type: image/png");
  $im    = imagecreatefrompng("write.png");
  $color = imagecolorallocate($im, 0, 0, 0);
  $file = fopen("text.txt","r");
  $text = fread($file, filesize("text.txt"));
  $text2 = str_replace("<br/>", "\n", $text);
  $font = "arial.ttf";
  //imagestring($im, 2, 150, 60, $text2, $color);
  imagettftext($im, 12, 0, 150, 60, $color, $font, $text2);
  imagepng($im);
  imagedestroy($im);
  fclose ($file);
?>

EDIT: Added used code and example

EDIT2: MyBB tags are hard, when you are tired :P

This post was edited on 09-18-2007 at 12:31 AM by Ezra.
[Image: 1-0.png]
             
09-17-2007 11:34 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
overlaying text on image in php - by Supersonicdarky on 09-17-2007 at 10:36 PM
RE: overlaying text on image in php - by Ezra on 09-17-2007 at 11:15 PM
RE: overlaying text on image in php - by Supersonicdarky on 09-17-2007 at 11:18 PM
RE: overlaying text on image in php - by WDZ on 09-17-2007 at 11:21 PM
RE: overlaying text on image in php - by Supersonicdarky on 09-17-2007 at 11:23 PM
RE: overlaying text on image in php - by Ezra on 09-17-2007 at 11:34 PM
RE: overlaying text on image in php - by Supersonicdarky on 09-17-2007 at 11:49 PM
RE: overlaying text on image in php - by roflmao456 on 09-18-2007 at 12:38 AM
RE: overlaying text on image in php - by Supersonicdarky on 09-18-2007 at 12:41 AM
RE: overlaying text on image in php - by WDZ on 09-18-2007 at 01:40 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On