Jump to content

Text to image - Add more


Twist3d

Recommended Posts

Hello guys.

Well I've ran into a sorta crossroad here with this script.

See I'm trying to create like a click to make point system on an image.

I have it all working except 1 problem..

 

At the moment the text to image script is only adding 1 bit of text onto the image, that is fine, that is because this is the only one in the php file:

 

Imagettftext($im, 12, 0, $X, $Y, $black, 'verdana.ttf', "$text");

 

But, what I am trying to do is to let the user create more points.

I thought I could achieve this by a database and just echoing out all of the rows from point txt which are like the above.

So it will be like

 

Imagettftext($im, 12, 0, 342, 455 $black, 'verdana.ttf', "$text");

Imagettftext($im, 12, 0, 443, 953, $black, 'verdana.ttf', "$text");

Imagettftext($im, 12, 0, 553, 445, $black, 'verdana.ttf', "$text");

 

And every time a user adds another point another one of the above is added to the database, it is then read by the TXT file, and displayed onto the image.

 

Although I only have this running at the moment:

 

<?php echo $row['pointtxt']; ?><br>

 

And for a test I just tried a simple echo command, and this is the only record or row in the database in the field pointtxt:

 

echo "hello";

 

As you can image, I don't think an echo can echo PHP commands, sorry this is really hard to explain, if anyone needs further explaining tho I will try.

 

Its basically I just want a user to add one of these into the database

 

Imagettftext($im, 12, 0, 553, 445, $black, 'verdana.ttf', "$text");

 

And on the image, it will grab all of those from the database, and run them so they all appear on the image.

Thanks for your help.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.