Jump to content

GD Problem


tkey

Recommended Posts

Hey, this is going way over my head.

Hopefully someone can help me out!

 

Firstly the codes:

 

<?php 
header('Content-type: image/png'); 
$text = $_GET['text']; 
$im = imagecreatefrompng ("img.png"); 
$color = imagecolorallocate($im,30,84,137); 
imageAlphaBlending($im, true); 
imageSaveAlpha($im, true);  
$font = 'font.ttf'; 
$fontsize = 22;

imagettftext($im, $fontsize, 0, 30, 35, imagecolorallocate($im,10,53,97), $font, 'text1, '); 
imagettftext($im, $fontsize, 0, 100, 35, $color, $font, $text); 

imagepng($im); 
imagedestroy($im); 
?>

 

 

That's what I got, and it's working fine.

 

However I would like the "text1" and inputted text to be centered above the image. I'm pretty sure it's possiable as I found the following page.

http://www.codingtuts.com/coding-tutorials/php/image-manipulation/center-align-text-with-gd

 

If anyone could run this by me ;)

 

Cheers,

 

~ Tkey

 

Link to comment
https://forums.phpfreaks.com/topic/120074-gd-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.