php - how to apply word wrap in wideimage texts? -


how can write long text small image using php wideimage?

here php code used,

$bg = wideimage::load("fbpostbg.png"); $final= $bg ->resize(400, 400); $canvas = $final ->getcanvas(); $canvas->usefont('verdana.ttf', 14, $final->allocatecolor(000, 000, 000)); $canvas->writetext('left +10', 'top +10', 'this text need write above image, quite long...');  $final->output('jpg', 90);   

this outputs text outside image canvas , can not seen...
need make word wrap in text write image , need image full text in it.

i'm new wideimage, me please.

use php's wordwrap function see: http://php.net/manual/en/function.wordwrap.php

 $wrappedtext = wordwrap('this text need write above image, quite long...', 60, "\n");  $canvas->writetext('left +10', 'top +10',$wrappedtext); 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -