View previous topic :: View next topic |
Author |
Message |
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
Posted: Fri Apr 15, 2005 9:48 pm Post subject: PHP-GD |
|
|
I've just installed PHP-GD on my server, and it works fine. I just have one question:
how do i create a new "line" in a dynamic picture, like <br> in html?
This is the script I use:
<?php
$im = imagecreate(300, 300);
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 5, 0, 0, "This text is going to be printed", $textcolor);
header("Content-type: image/gif");
imagegif($im);
?> |
|
Back to top |
|
 |
roganty -
Joined: 08 Jun 2004 Posts: 357 Location: Bristol, UK
|
Posted: Sat Apr 16, 2005 12:53 pm Post subject: Re: PHP-GD |
|
|
cmxflash wrote: | I've just installed PHP-GD on my server, and it works fine. I just have one question:
how do i create a new "line" in a dynamic picture, like <br> in html?
This is the script I use:
<?php
$im = imagecreate(300, 300);
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 5, 0, 0, "This text is going to be printed", $textcolor);
header("Content-type: image/gif");
imagegif($im);
?> |
There are two ways
1) add a second imagestring();
2) add "\r\n" widthout the quotes at the end of the text string ie:
imagestring($im, 5, 0, 0, "This text is going to be printed\r\n", $textcolor); _________________ Anthony R
Roganty | Links-Links.co.uk |
|
Back to top |
|
 |
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
Posted: Sat Apr 16, 2005 2:31 pm Post subject: |
|
|
It works fine, thanks for the help. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|