Happy New Year!
Have you seen those online greeting cards, where you choose a template (like a bunch of people holding a big white empty sign board) and whatever you type in the "greetings" text box then that shows-up in the image (your typed text shows up in the sign board) ?
How did they program all that with php ? I mean, they did some kind of a text layout on the img, right ?
We've done this kind of thing in Adobe Photoshop but how does php manage it ? Does php have some builtin function that deals with overlaying one img or text over another img ? Img overlaying ? if not, then how'd they manage to program it ?
If you don't mind, I'd like to see a code sample from your end. That can be my new year gift!
I think the programmers do it like the following technique. See if I'm correct or not ...
They cut the template img in half. So, in our example, the bunch of people holding the empty white signboard is one whole img. Like: full.jpeg.
With phptoshop and the like, the webmaster cut the img in 2. Half half.
Like: left_half.jpeg & right_half.jpeg.
Now, let's deal with you the user's input text and its img.
With a font, let's say Ariel Style, I, the programmer, going to write each letter and save it. Like so:
and so on right down to:
Then, I'm going to give you, the visitor/greeting mssg creator a text box (in a web form).
You will type your word such as: Happy New Year 2018.
And, my script will call the required jpeg files and combine them to form your word. Like so:
h.peg,a.jpeg,p.peg,p.jpeg,y.jpeg and so on.
You get the picture. Gonna put each appropriate img files side by side that will make up your chosen word.
$word = $h = mydomain\h.jpeg.$a = mydomain\a.jpeg; AND SO ON until your word is formed: Happy New year 2018.
//combine left half of img with right half of img with greeter's $word inbetween the 2 imgs.
echo left_half.jpeg.$word.right_half.jpeg; //concatenation taking place here.
Is this how the php programmers build these greeting card sites ? Meaning using the same method I did. Ok, maybe programming slightly differntly by using better codes but the method of adding the greeter's greeting words on the image template is done like so. Right ?
Don't forget to PM me your emails so when I get this Greeting Card site of mine up and running then I can give you all a card. Lol!