53329 Posted February 18, 2008 Share Posted February 18, 2008 Title says it all but here is the code I have for reference anyway. Is there a way to add a border around the edge of this image without copying it? Keep in mind that the image has transparency. <?php $im = imagecreatefromgif("test.gif"); header("Content-type: image/gif"); imagegif($im); imagedestroy($im); ?> Thanks in advance for any help. Quote Link to comment Share on other sites More sharing options...
mem0ri Posted February 18, 2008 Share Posted February 18, 2008 You'll just want to add some CSS code when you display the image...somethin' like IMG { border:1px solid #000000; } Quote Link to comment Share on other sites More sharing options...
53329 Posted February 18, 2008 Author Share Posted February 18, 2008 I actually can't because the images are on one host and they are being displayed elsewhere. Basically anything outside of the image itself is out of my control. Quote Link to comment Share on other sites More sharing options...
53329 Posted February 18, 2008 Author Share Posted February 18, 2008 Fixed it. Here is for anyone else as I couldn't find this online. <?php $im = imagecreatefromgif("test.gif"); $width=imagesx($im); $height=imagesx($im); $border_color = imagecolorallocatealpha($im, 0, 0, 0, 0); imageline($im, 0, 0, ($width-1), 0, $border_color); imageline($im, 0, ($height-1), ($width-1), ($height-1), $border_color); imageline($im, 0, 0, 0, ($height-1), $border_color); imageline($im, ($width-1), 0, ($width-1), ($height-1), $border_color); header("Content-type: image/gif"); imagegif($im); imagedestroy($im); ?> Quote Link to comment 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.