Page 1 of 1

Need help with gd, please help! (not a total noob but close)

Posted: Fri Jun 05, 2009 5:23 pm
by Pleek
Alright, so after asking questions at other forums and not getting much help i have come here. My first question is this...

I have this image as my background image - Background

But when i put it in with gd it looks like this - created png

My problem is that the gd created image has the left corners filled instead of rounded like the actual image. Can somebody help me create a transparent image that i can put my other images on top?

This is my code..

Code: Select all

 
<?php
 
header('Content-type: image/png');
 
// Set a White & Transparent Background Color
$new_image = ImageCreateTruecolor(418, 252);
$bg = ImageColorAllocateAlpha($new_image, 255, 255, 255, 127); // (PHP 4 >= 4.3.2, PHP 5)
ImageFill($new_image, 0, 0 , $bg);
 
$Background = imagecreatefrompng('BackgroundOne.png');
 
imagecopymerge($new_image, $Background, 0, 0, 0, 0, 412, 167, 100);
imagepng($new_image);
imagedestroy($new_image);
imagedestroy($Background);
 
?>