PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Jun 24, 2019 9:32 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Jun 05, 2009 5:23 pm 
Offline
Forum Newbie

Joined: Fri Jun 05, 2009 5:17 pm
Posts: 9
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..
Syntax: [ Download ] [ Hide ]
 
<?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);
 
?>
 


Last edited by Benjamin on Sun Jun 07, 2009 11:58 pm, edited 1 time in total.
Changed code type from text to php.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group