Demonic Posted April 30, 2008 Share Posted April 30, 2008 Haven't used GD in a while and basically I have a 100x100 image and I want to create a 100x50 or less sized image based on the bg I got and adding the text shouldn't be hard, but how do I add a background image again? Link to comment https://forums.phpfreaks.com/topic/103611-solved-php-gd/ Share on other sites More sharing options...
Demonic Posted April 30, 2008 Author Share Posted April 30, 2008 nvm I got it I used image copy: $bgs = glob("captcha/*.gif"); $total = sizeof($bgs); $bg = rand(0,$total); $bg = $bgs[$bg]; //echo "<img src='{$bg}' />"; header("Content-Type: image/gif"); $w = 100; $h = 30; $img = imagecreatetruecolor($w,$h); $temp = imagecreatefromgif($bg); imagecopy($img, $temp,0,0,0,0,$w,$h); imagegif($img); Link to comment https://forums.phpfreaks.com/topic/103611-solved-php-gd/#findComment-530552 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.