Jump to content


Photo

How To Set Image As Background of Image in GD Library


  • Please log in to reply
1 reply to this topic

#1 sujeetji

sujeetji
  • New Members
  • Pip
  • Newbie
  • 2 posts
  • LocationIndia

Posted 09 May 2006 - 07:16 AM

Hi All
I want to set an imge(.jpeg/.gif) as the background of
my own created image through the GD library.
let me explain:
i have an example.jpeg image and through the GD library i am greating an rectangle and i want to set example.jpeg as the background of this rectangle.
please help me.

Thankx
Sujeet
sujeet.kumar@ecotechservices.com
Thankx & Regards
[!--fonto:Georgia--][span style="font-family:Georgia"][!--/fonto--][!--sizeo:5--][span style="font-size:18pt;line-height:100%"][!--/sizeo--]Sujeet[!--sizec--][/span][!--/sizec--][!--fontc--][/span][!--/fontc--]
Ecotech IT Solution
sujeet.kumar@ecotechservices.com

#2 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 13 May 2006 - 12:16 AM

hi
nothing special here - create your canvas using 'imagecreatefromjpeg' or 'imagecreatefromgif' instead of 'imagecreate' or 'imagecreatetruecolor'. then you just lay down whatever you want just as normal. for example:

$im = imagecreatefromjpeg("myfile.jpg");

$red = imagecolorallocate($im, 255,0,0);
imagerectangle($im, 20,20,120,120, $red);

...etc...
...etc...

hope that helps
Cheers
Mark
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users