Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with GD ?

Status
Not open for further replies.

bluegroper

Technical User
Dec 12, 2002
407
AU
Hi team
GD newbie here, pls be gentle.

I have the following code snippet.
Code:
$xpos = 5;
$ypos = ($height - $f->height)/2;
$gd->fill(0,0,$bgcolor);
$gd->rectangle(0,0,$w-1,$h-1,$black);
$gd->string($f,$xpos,$ypos,$mesg,$black);
my $image = $gd->png();
Is there an easy way to CENTER the $msg within the graphic image .png file ?
At the mo $msg is left aligned.
The GD manual is quite confusing.
TIA's
-BG
 
Got it thanks.
Code:
$xpos=((15-length($mesg))*($f->width)/2);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top