Does anybody here know PHP GD?
Posted: Sun Jun 07, 2009 4:06 pm
I really need some help with a GD project, but i can't find anybody on the net that will help me! Does anybody here know it that would be interested in looking at my code and helping me out? My current code is this... It looks like this. My problem is the transparecies and the white pixels.
Code: Select all
<?php
header('Content-type: image/png');
$new_image = ImageCreateTruecolor(418, 252);
imagealphablending($new_image, true);
$bg = ImageColorAllocateAlpha($new_image, 255, 255, 255, 127);
ImageFill($new_image, 0, 0 , $bg);
$trans = imagecolorallocate($new_image, 255, 255, 255);
imagecolortransparent($new_image, $trans);
$Background = imagecreatefrompng('BackgroundOne.png');
$Logo = imagecreatefrompng('CcLogo.png');
$AvatarBackground = imagecreatefrompng('AvatarBackground.png');
$Avatar = imagecreatefrompng('Avatar.png');
$AvatarReflection = imagecreatefrompng('AvatarReflection.png');
$UserRank = imagecreatefrompng('administrator.png');
imagecopy($new_image, $Background, 3, 42, 0, 0, 412, 167);
imagecopy($new_image, $Logo, 0, 0, 0, 0, 247, 252);
imagecopy($new_image, $AvatarBackground, 5, 44, 0, 0, 134, 164);
imagecopy($new_image, $Avatar, 12, 56, 0, 0, 120, 139);
imagecopy($new_image, $AvatarReflection, 11, 49, 0, 0, 120, 143);
imagecopy($new_image, $UserRank, 280, 50, 0, 0, 128, 28);
imagepng($new_image);
imagedestroy($new_image);
imagedestroy($Background);
imagedestroy($Logo);
imagedestroy($Avatar);
imagedestroy($AvatarReflection);
imagedestroy($UserRank);
?>