views:

20

answers:

2

I have a gif file with many icons and buttons on it.. What I want to do is include that gif file using php gd somefunction("file.gif")

then, resize the new image to 30px by 30px.. and then be able to position (using x and y coordinates) the actual gif file, so that only a certain area of the image shows on the new file..

just like the css background-position property but, with gd. Thanx

A: 

imagecopyresized()

http://www.php.net/manual/en/function.imagecopyresized.php

Should do the trick for adjusting the size.

Trufa
What do you mean "a gif file with many icons and buttons on it"?
Trufa
Thanx for that bro. Actually I tried that function and it wasn't quite what I was looking for, so I looked through the gd section on php.net and imagecopy() was able to do the trick
andrewk
Great, and the position part did you get it or do you need some help?
Trufa
No, actually I was able to do the positioning with the same function..
andrewk
+1  A: 

imagecopyresized() resizes the image, so it doesn't quite work for what I was exactly looking for.

For anyone else that might need this, the best function is actually imagecopy(). http://www.php.net/manual/en/function.imagecopy.php

It will do the trick.. Thanx Trufa for the quick answer though.

andrewk
No problem!!...
Trufa