I'm trying to dynamically create an image composed of a background and a round button. I have both images as PNG, and the button is a transparent PNG (checked with Netscape, the background of the page shows through, IE doesn't support transparent PNGs properly)
However, I can't get it to work, I must be missing some function call to treat the button as transparent. Here is what I'm doing at the moment:
fondo.png is the background and boton.png is the button. Right now, the button is copied over the background, but inside a horrible white square (not transparently).Code:<?php $fondo = ImageCreateFromPNG('fondo.png'); $boton = ImageCreateFromPNG('boton.png'); $nuevaimagen = ImageCreate(350,350); $transparente = ImageColorTransparent($boton); ImageCopy($nuevaimagen, $fondo, 0,0,313,108,350,350); ImageCopy($nuevaimagen,$boton,50,50,0,0,32,32); Header( "Content-type: image/png"); ImagePNG($nuevaimagen); ?>
Has anybody dealt with something like this before? After reading the manual, I think I need the ImageColorTransparent function, but the manual is not very clear about how to use it.
Any ideas? Thanks![]()




GIF is not an option because of Unisys' patent. GIF support was dropped from GD because of this.


Bookmarks