sujeetji Posted May 9, 2006 Share Posted May 9, 2006 Hi All I want to set an imge(.jpeg/.gif) as the background of my own created image through the GD library.[b]let me explain[/b]:i have an [b]example.jpeg[/b] image and through the GD library i am greating an rectangle and i want to set [b]example.jpeg as the background of this rectangle[/b]. please help me.Thankx[i][b]Sujeet[/b][/i]sujeet.kumar@ecotechservices.com Quote Link to comment https://forums.phpfreaks.com/topic/9366-how-to-set-image-as-background-of-image-in-gd-library/ Share on other sites More sharing options...
redbullmarky Posted May 13, 2006 Share Posted May 13, 2006 hinothing 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:[code]$im = imagecreatefromjpeg("myfile.jpg");$red = imagecolorallocate($im, 255,0,0);imagerectangle($im, 20,20,120,120, $red);...etc......etc...[/code]hope that helpsCheersMark Quote Link to comment https://forums.phpfreaks.com/topic/9366-how-to-set-image-as-background-of-image-in-gd-library/#findComment-35337 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.