A user fill out a simple form after s/he click submit it does a $_POST ... I am trying to find out a way to grab that $_POST and input it onto the image using a GD function call or a php function class call
Create a php image editing script.
Moderator: General Moderators
Create a php image editing script.
I am trying to create a script that lets a user input text and font's and fon't size as option, then after the click post it updates a image with that feature as in example:
A user fill out a simple form after s/he click submit it does a $_POST ... I am trying to find out a way to grab that $_POST and input it onto the image using a GD function call or a php function class call
correct me if i am wrong, i am new at this programming with function 
A user fill out a simple form after s/he click submit it does a $_POST ... I am trying to find out a way to grab that $_POST and input it onto the image using a GD function call or a php function class call
I am using this guy class http://evoluted.net/archives/000011.php
Also look at this add text to image example at the bottom i am trying to do that!
Also look at this add text to image example at the bottom i am trying to do that!
- dull1554
- Forum Regular
- Posts: 680
- Joined: Sat Nov 22, 2003 11:26 am
- Location: 42:21:35.359N, 76:02:20.688W
This is what i use to overlay text on an image....
this GD script will center the text on the image
Code: Select all
<?php
header("Content-type: image/png");
$string = $_POST['image_string'];//text to be imposed on the image
$im = imagecreatefrompng($_POST['path_image']);//path/filename of image
$color = imagecolorallocate($im, 0, 0, 0);//color(0-255,0-255,0-255)
$image_width = (imagesx($im) - 7.5 * strlen($string)) / 2;
$font_size = $_POST['font_size'];//font size
$image_height = imagesy($im) / 2 - $font_size;
imagestring($im, $font_size, $image_width, $image_height, $string, $color);
imagepng($im);
imagedestroy($im);
?>