How to put words over images [56k warn]

JavaScript and client side scripting.

Moderator: General Moderators

User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

How to put words over images [56k warn]

Post by nickman013 »

Hello,

I have a website with images, I have words in that image, that I want to change based on data that comes out of a database. I dont know if this is possible or if anybody has any idea or how to, or a link that will teach me (ive searched google), I would greatly appreciate it...

My basic layout:
http://www.regionalplanning.com/basic_layout.jpg

That is the link to the layout I have created, as you can see I have variables everywhere, that Is what I used to represent the words I need to be placed in its spot.
I know how to get information out of the database, I just dont know how I would make the words in the picture change, is it possible to do this with PHP because I have scene a image before that looked like this yourtown.gif?town=New_York_City and then the picture said your town is New York City, and stuff like that, I then changed the New_York_City to dfjdojdofjfd and it said your town is dfjdojdofjfd. So I am basically looking for somthing like that.

Thanks Alot!!!!
Last edited by nickman013 on Thu Dec 28, 2006 1:10 pm, edited 1 time in total.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

this may help you... http://bokehman.com/watermark maybe.
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

I was looking at somthing similar to that, but I cant figure out how to make it go into the correct spot of the image, and instead of watermarking a image, text.
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

like this picture is a perfect example..

Image[/img]
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

GD is your answer.

have a look at this function: imagettftext()
User avatar
neel_basu
Forum Contributor
Posts: 454
Joined: Wed Dec 06, 2006 9:33 am
Location: Picnic Garden, Kolkata, India

Post by neel_basu »

You Can Do It In 2 different Ways
=======================
1. Use GDlib / Watermark

2. Put Your Picture In a Div With z index=1 And Parse Text from The Database
And Put It In a Div Which Has z index=2 And Then Place The Text Div Over
The Image Div
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

Which way would look nicer, and would the div move if the page is in a different resolution or somthing?

Thanks Alot !
User avatar
neel_basu
Forum Contributor
Posts: 454
Joined: Wed Dec 06, 2006 9:33 am
Location: Picnic Garden, Kolkata, India

Post by neel_basu »

The First Process Is very good But it would a very little more codes
Second Process Is Also Good It would take little less code
nickman013 wrote:and would the div move if the page is in a different resolution or somthing?
I've not tested it before Pls Test It First
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

I am going to make a template for the words I want over it, and have the information I want over the picture in a table that is resized perfectly for the picture. I am going to open the image in Photoshop and make a slice where the info will be posted so I can edit the image using GD, and just keep editing the information in the template. Does that sound like a working idea?
User avatar
neel_basu
Forum Contributor
Posts: 454
Joined: Wed Dec 06, 2006 9:33 am
Location: Picnic Garden, Kolkata, India

Post by neel_basu »

Look If What You are trying to do is possible also not only by GD Then Why Would You Use GD . It Would Take Time Depending on your image.

So If Its Possible overlapping div(s) only Why Wouldn't You Use It
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

I see what your saying, DIVS would be alot easier.. But the thing is would they stay in the right position always, and never movie if the page is resized or somthing?
User avatar
neel_basu
Forum Contributor
Posts: 454
Joined: Wed Dec 06, 2006 9:33 am
Location: Picnic Garden, Kolkata, India

Post by neel_basu »

nickman013 wrote:I see what your saying, DIVS would be alot easier.. But the thing is would they stay in the right position always, and never movie if the page is resized or somthing?
Ya Thats Right
But when user is resizing his/her browser It doesn't make that much defecultes
the defeculties are on the different screen resoulution
You may Create different pages depending on their screen resoulution and then forward thm to their approeat page
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

"difficulties"
"appropriate"
"resolution"
;)


Using an HTML solution banks on the person viewing it having the correct fonts and allowing the size(s) you use. If the fonts are off by a bit your "image" will likely look like poop-on-a-stick.
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

Yea thatrs what Im worried of, so should i go with phpgd ?
Post Reply