GD and Ready made images

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zell11
Forum Newbie
Posts: 7
Joined: Mon Jun 04, 2007 5:24 pm

GD and Ready made images

Post by zell11 »

I am curretly trying to make an avatar creation script. This will allow the user to select multiple changes, such as hair, eyes, outfit etc. Can anyone give me some advise on what to use. I ahve heard that GD libaray it one of the best to use and if so can someone show me an example of how you could do it.
Thanks in advance
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

I have never done anything like this before, but I have seen something similar.

Basically, make partially transparent images of the different components, be they gif or png files shouldn't matter.

Then, when a user chooses their body parts, you can programmatically add those particular parts to particular pixel co-ordinates in the final image. You'll have to determine the pixel co-ordinates beforehand.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
zell11
Forum Newbie
Posts: 7
Joined: Mon Jun 04, 2007 5:24 pm

Post by zell11 »

cheers for your answer. would i use imagecopy() i take it
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Probaby - sounds about right.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
zell11
Forum Newbie
Posts: 7
Joined: Mon Jun 04, 2007 5:24 pm

Post by zell11 »

got it working, Thanks a lot for your help
Post Reply