Jump to content

Gd - Imagecolortransparent()


Recommended Posts

I am not very familiar with GD, I am trying to put a small icon on to a larger background, and when I try to make the icon transparent, it doesn't work! I can't find the problem, here is the code:

<?phpheader('content-type: image/png');$im = imagecreatefrompng('cc_header.png');$minion = imagecreatefrompng('basherred.png');$white = imagecolorallocate($minion, 255, 255, 255);imagecolortransparent($minion, $white);imagecopy($im, $minion, 440, 0, 0, 0, 75, 75);imagecolortransparent($minion, $white);imagepng($im);imagedestroy($im);imagedestroy($minion);?>

The out is here: http://www.clonedrone.com/cc_api/mt/images/banner.phpThe little red guy is $minion, and the rest of the image is $imThe confusing part is when I make $im transparent, it worked kinda($minion still showed a white BG) but when I loaded the image in to a page with as green BGcolor, the image was transparent in the areas it was white...~clone

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...