john_bboy7 Posted June 30, 2010 Share Posted June 30, 2010 I am creating an image using php... however is this possible: imagecreate( php generated value here, php generated value here ); Its like i don't know what will be the final size of the image.. For example my code will write the names on the image however each time the image is opened i don't not know how many names will be there so php should generate accordingly the size of the image. some times there will be 2 names, some times 40 names so is it possible that php automatically detect it and put the final size of the image accordingly.. Example: 1st time opening of the image: john danial Narcis Naz 2nd time opening of the image: Narcis Bill And so on.. OR simply show my output as image (like the whole page as it will only contain text) Link to comment https://forums.phpfreaks.com/topic/206314-is-this-possible-imagecreate-random-random/ Share on other sites More sharing options...
ChemicalBliss Posted June 30, 2010 Share Posted June 30, 2010 Yeah sure you can do this. // First, get the names into an array. $names = array(); // say each font should have around 20px between each line (height). $height = 20 * count($names); // Set the width (width should be pretty constant, you shoudl ahve a limit of the length of characters in each name) $width = 200; Imagecreate($width,$height); // Do the rest of your stuff here as usual -cb- Link to comment https://forums.phpfreaks.com/topic/206314-is-this-possible-imagecreate-random-random/#findComment-1079342 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.