Jump to content

Is this possible? => imagecreate( random, random );


john_bboy7

Recommended Posts

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)

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-

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.