Jump to content

Recommended Posts

I have a website that stores user data.

 

a few users have requested if its possible to generate an image with data embedded?

 

is this possible, i have seen forum signatures use a similar thing before and im not 100% what to search and look for.

 

any help is appreciated.

Link to comment
https://forums.phpfreaks.com/topic/196338-creating-images-using-data/
Share on other sites

thank you for the heads up. been having a play with it and using the following code;

 

<?php

header("Content-type: image/png");
$string = $_GET['text'];
$im     = imagecreatefrompng("img/image.png");
$orange = imagecolorallocate($im, 220, 210, 60);
$px     = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $string, $orange);
imagepng($im);
imagedestroy($im);

?>

 

i also managed to pull some info from my database and have it echo it onto the image.

 

how can i edit the above PHP to put 16 strings onto an image instead of using the 1?

 

if that makes any sense.

 

i want an image, and ontop of that i need to echo 16x pieces of information and i can then figure out how to position these onto the image using co-ordinates.

 

and example image would be:

image_to_use.png

 

and i understand the image code will be long like;

 

image.php?text=$test1,$test2,$test3 etc.....

 

any help apreciated, first time i used images in this way.

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.