Reputation: 95
I am trying to figure out how to create an image border around an image as well as adding text to the border (as shown below) from a mySQL database using PHP i have looked around but cant find anything like what i want to do.
Thanks in advance
http://tinypic.com/r/10h6s8p/7 (pic of what i am trying to do)
Upvotes: 1
Views: 879
Reputation: 4371
First of all: make sure you have the outer border (the polaroid background) seperated from the file you want to put in this file.
Second of all: get to know what dimensions the file needs to have to be properly inserted into the polaroid background.
Third: get to known at what x/y location your text can start (and perhaps it's maximum width and height).
Then it's fairly simple:
1) Load background 2) Overlay the (resized) image onto the background on the x/y position 3) Overlay the text onto the background on the x/y position
It's pretty simple if you've got some experience with PHP's image functions, otherwise it might be a little challenge to get it working.
Upvotes: 0
Reputation: 12993
Do you need a create a new image placing the original picture inside the polaroid-like frame?
You can do this using the GD functions in php.
Prepare the background image, and then place the picture in it using the imagecopy() function, and then write the text using imagetfttext().
Upvotes: 1
Reputation: 911
Why don't you have a single background div (or multiple if you want to resize) and place the image from the mysql result on top of that div?
That would have the same effect and it's less process intense when processing the image through php.
Upvotes: 3