custom image generator

Any problem with PHP can be disscused here
mohumben
Posts: 82
Joined: Thu Sep 15, 2005 9:45 pm

Post by mohumben »

I uploaded the font here:
http://rapidshare.de/files/18372514/bla ... r.zip.html

About the image, just use <img border="0" ...


Code: Select all

define('I_LOVE_PHP', true);
derangedtaco
Posts: 78
Joined: Sun Feb 26, 2006 4:21 pm

Post by derangedtaco »

[quote="mohumben"]I uploaded the font here:
http://rapidshare.de/files/18372514/bla ... r.zip.html

About the image, just use Image
/\ i dont see that there... i would've tried that before, duuh :lol:
Visit derangedtaco.com, a developing online community.
fordrules
Posts: 23
Joined: Fri Apr 21, 2006 9:15 am

Hi

Post by fordrules »

Interesting :D

Might have to invest with some of this PHP technology.
derangedtaco
Posts: 78
Joined: Sun Feb 26, 2006 4:21 pm

Post by derangedtaco »

anyways, can somebody help with the image outlining problem??
Visit derangedtaco.com, a developing online community.
derangedtaco
Posts: 78
Joined: Sun Feb 26, 2006 4:21 pm

Post by derangedtaco »

ok! done..

http://www.derangedtaco.com/files/conversion.zip

can you config that to write a custom value in where the blank area is? with the included font? dunno that would be hard...

a futile attempt for the form...

<form><
you know what, i can't even think of how to start. would that need to use POST? oh, god, somebody help me
Visit derangedtaco.com, a developing online community.
derangedtaco
Posts: 78
Joined: Sun Feb 26, 2006 4:21 pm

Post by derangedtaco »

help!!
Visit derangedtaco.com, a developing online community.
mohumben
Posts: 82
Joined: Thu Sep 15, 2005 9:45 pm

Post by mohumben »

here:

http://geopet4.hollosite.com/img.php?text='YOUR TEXT HERE'

Code: Select all

<?php

// Set the content-type
header("Content-type: image/png");

// Create the image
$im = @imagecreatefrompng('diploma.png');

// Create some colors
$black = ****($im, 0, 0, 0);
// Set the enviroment variable for GD
putenv('GDFONTPATH=' . realpath('.'));

// Name the font to be used (note the lack of the .ttf extension)
$font = 'blackletter';
//$font = '/www/geopet4.hollosite.com/blackletter.TTF';

// The text to draw. It will use the $_GET['text']
$text = (empty($_GET['text'])) ? 'img.php?text=name_here' : $_GET['text'];

// This defines the X postion by calculating where the center is
$imgar = imagettfbbox (30, 0, $font, $text);
$imgX = ceil(((499 - abs($imgar[0] - $imgar[2]))/2)) + 2;

// Y position
$imgY = 215;

// Add the text
imagettftext($im, 30, 0, ($imgX + 1) , ($imgY - 1), $black, $font, $text);

// Output and Destroy image resource
imagepng($im);
imagedestroy($im);

?>
Image

Code: Select all

define('I_LOVE_PHP', true);
derangedtaco
Posts: 78
Joined: Sun Feb 26, 2006 4:21 pm

Post by derangedtaco »

nice..

but:
1. how to make the text bigger
2. how to integrate with a form. ex user types in their name, it goes there
edit: yup, was lookin here
http://www.tizag.com/phpT/forms.php
i could try to do it, but i would almost certainly fail. just a tad of help pls
Visit derangedtaco.com, a developing online community.
mohumben
Posts: 82
Joined: Thu Sep 15, 2005 9:45 pm

Post by mohumben »

Form integration:

Code: Select all

<form action="http://geopet4.hollosite.com/img.php" method="get">
<input type="text" name="text"> <input type="submit" value="Go">
</form>
Font Size:

Code: Select all

imagettftext($im, [SIZE HERE], 0, ($imgX + 1) , ($imgY - 1), $black, $font, $text);

Code: Select all

define('I_LOVE_PHP', true);
derangedtaco
Posts: 78
Joined: Sun Feb 26, 2006 4:21 pm

Post by derangedtaco »

ok, i'm just using your server to generate the custom images.

will it hold any bandwidth? will it stay up?
thanks for all the help.

ok, and, if you could change the font for the custom text to arial or something... anything that's clearer. e-mail me after you complete this, or e-mail me if you cannot.

alternatively to all of that, you could send over all of the stuff i need in a .zip file. all set up and ready to go. i just extract, upload, and it works. i'm too stupid to do it myself. :x

lol ok, so thanks for all your help.. look forward to your reply

hey why doncha just email me derangedtaco@gmail.com pls
Visit derangedtaco.com, a developing online community.
Post Reply