Thank you so much for your help, with what you gave me here i was able to complete the image. And it looks exactly like the photoshop concept! Thank you so much!!!!
Code: Select all
<?php
header('Content-type: image/png');
$new_image = ImageCreateTruecolor(418, 252);
imagealphablending($new_image, true);
imagesavealpha($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);
$UserName = $_GET['UserName'];
$Posts = $_GET['Posts']. ' Posts';
$PS = $_GET['PS'];
$Site = $_GET['Site'];
$Font = './Arial.ttf';
$Black = imagecolorallocate($new_image, 0, 0, 0);
$imageWidth = 418;
$imageHeight = 252;
// An array of values describing the text's bounding box
$textPositionUser = imagettfbbox(18, $textAngle, $Font, $UserName);
$textPositionPosts = imagettfbbox(18, $textAngle, $Font, $Posts);
$textPositionPS = imagettfbbox(12, $textAngle, $Font, $PS);
$textPositionSite = imagettfbbox(12, $textAngle, $Font, $Site);
// Top-Right-X minus Top-Left-X
$textWidthUser = $textPositionUser[4] - $textPositionUser[6];
$textWidthPosts = $textPositionPosts[4] - $textPositionPosts[6];
$textWidthPS = $textPositionPS[4] - $textPositionPS[6];
$textWidthSite = $textPositionSite[4] - $textPositionSite[6];
// Bottom-Left-Y minus Top-Left-Y
$textHeightUser = $textPositionUser[1] - $textPositionUser[7];
$textHeightPosts = $textPositionPosts[1] - $textPositionPosts[7];
$textHeightPS = $textPositionPS[1] - $textPositionPS[7];
$textHeightSite = $textPositionSite[1] - $textPositionSite[7];
// The distance between the text baseline and the text bottom
$textBaseOffsetUser = $textPositionUser[1];
$textBaseOffsetPosts = $textPositionPosts[1];
$textBaseOffsetPS = $textPositionPS[1];
$textBaseOffsetSite = $textPositionSite[1];
// Text Aligned Bottom, Right
imagettftext($new_image, 18, 0, $imageWidth - $textWidthUser - 15, $imageHeight - $textBaseOffsetUser - 145, $Black, $Font, $UserName);
imagettftext($new_image, 18, 0, $imageWidth - $textWidthPosts - 15, $imageHeight - $textBaseOffsetPosts - 115, $Black, $Font, $Posts);
imagettftext($new_image, 12, 0, $imageWidth - $textWidthPS - 15, $imageHeight - $textBaseOffsetPS - 88, $Black, $Font, $PS);
imagettftext($new_image, 12, 0, $imageWidth - $textWidthSite - 15, $imageHeight - $textBaseOffsetSite - 60, $Black, $Font, $Site);
imagepng($new_image);
imagedestroy($new_image);
imagedestroy($Background);
imagedestroy($Logo);
imagedestroy($Avatar);
imagedestroy($AvatarReflection);
imagedestroy($UserRank);
?>