php GD create a transparent png image -


I create a transparent PNG image with transparency to create a last PNG and trying to create various other PNG and JPG layers I am here. I'm having trouble creating my initial blank transparent PNG that currently has a white background.

Can anyone tell me in the right direction? This is my code so far ... $ image = imagecreatetruecolor (485, 500); Imagealphobalending ($ image, wrong); Image swords ($ image, true); $ Col = imagecolorallocatealpha ($ image, 255,255,255,127); Image file ($ image, 0, 0, $ cola); // Image filter tag ($ image, 0, 4, 4, 500, $ black); / * Add door glass * / $ img_doorGlass = imagecreatefrompng ("glass / $ door style / $ doorGlass.png"); Imagecopyresampled ($ image, $ img_doorGlass, 106, 15, 0, 0, 185, 450, 185, 450); / * Add Door * / $ img_doorStyle = imagecreatefrompng ("Door / $ Door Style / $ Door Style". "_". "$ Doorcolor.png"); Imagecopyresampled ($ image, $ img_doorStyle, 106, 15, 0, 0, 185, 450, 185, 450); $ Fn = md5 (microgram (). "Door_builder"). ".png"; If (imagepng ($ image, "user_doors / $ fn", 1)) {echo "user_doors / $ fn"; } Imagedestroy ($ image);

set imagealphobalending ($ image, true); Every new layer on

Try this:

  & lt ;? php $ image = imagecreatetruecolor (485, 500); imagealphobalending ($ image, wrong); $ Col = imagecolorallocatealpha ($ image, 255,255,255,127); Imagefilledrectangle ($ image, 0,0485, 500, $ cola); Imagealphublending ($ image, true); / * Add door glass * / $ img_doorGlass = imagecreatefrompng ("glass / $ door style / $ doorGlass.png"); Imagecopyresampled ($ image, $ img_doorGlass, 106, 15, 0, 0, 185, 450, 185, 450); Imagealphublending ($ image, true); / * Add Door * / $ img_doorStyle = imagecreatefrompng ("Door / $ Door Style / $ Door Style". "_". "$ Doorcolor.png"); Imagecopyresampled ($ image, $ img_doorStyle, 106, 15, 0, 0, 185, 450, 185, 450); Imagealphublending ($ image, true); $ Fn = md5 (microgram (). "Door_builder"). ".png"; imagealphobileending ($ image, false); Imagesavealpha ($ image, true); If (imagepng ($ image, "user_doors / $ fn", 1)) {echo "user_doors / $ fn"; } Imagedestroy ($ image); ? & Gt;    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -