Jump to content

GD Image Creation - align problem


Canman2005

Recommended Posts

Hi all

 

I have the following

 

<?php
header ("Content-type: image/png"); 
$img_handle = @imagecreatetruecolor (21, 120) or die ("Cannot Create image"); 
$back_color = ImageColorAllocate ($img_handle, 0, 0, 0); 
$txt_color = ImageColorAllocate ($img_handle, 255, 255, 255); 
ImageStringUp ($img_handle, 4, 1, 100, $_GET['text'], $txt_color); 
ImagePng ($img_handle); 
ImageDestroy($img_handle);
?>

 

This creates a vertical imate with text on it.

 

At the moment the size of the GD image is generated using

 

$img_handle = @imagecreatetruecolor (21, 120) or die ("Cannot Create image"); 

 

Is there anyway to give it an auto height rather than 120px high?

 

Thanks

 

Dave

Link to comment
https://forums.phpfreaks.com/topic/144657-gd-image-creation-align-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.