Проблем при създаване на картинка от php ?

Styl3rbg

Registered
Как мога да махна черният фон(background)
?
Файла за създаване:
PHP:
<?php
$username = $_GET['username'];
header("Content-type: image/png; charset=windows-1251");
$file = file_get_contents("http://shoot-bg.info/sig.php?username=$username"); 


      $inf = explode("<br>", $file);
      $username = $inf[0];
      $posts = $inf[1];
      $user_cash = $inf[2];
      $avatar = $inf[3];

$user = "".$username;
$mneniq = "".$posts;
$user_cash= "".$user_cash;

$image = imagecreatefrompng("sig.png");
$font = "font/verdana.ttf";
$red = imagecolorallocate($image, 255, 0, 0);
$blue = imagecolorallocate($image, 0, 0, 255);
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$grey =  imagecolorallocate($image, 204, 204, 204);
imagefill($image, 0, 0, $black);


$font_size1 = 4;
$upper_x = 180;
$upper_y = 12;

$font_size2 = 20;
$font_angle = 0;
$lower_x = 50;
$lower_y = 50;

imagestring($image, $font_size1, 110, 23, $username, $black);
imagestring($image, $font_size1, 77, 45, $posts, $black);
imagestring($image, $font_size1, 65, 66, $user_cash, $black);
//imagettftext($image, $font_size2, $font_angle, $lower_x, $lower_y, $blue, $font, $user_cash);

imagepng($image);
imagedestroy($image);

?>
 
Съмнява ме да е от това:
imagefill($image, 0, 0, $black);
или:
imagestring($image, $font_size1, 110, 23, $username, $black);
imagestring($image, $font_size1, 77, 45, $posts, $black);
imagestring($image, $font_size1, 65, 66, $user_cash, $black);
 
tedo96 каза:
Съмнява ме да е от това:
imagefill($image, 0, 0, $black);
или:
imagestring($image, $font_size1, 110, 23, $username, $black);
imagestring($image, $font_size1, 77, 45, $posts, $black);
imagestring($image, $font_size1, 65, 66, $user_cash, $black);
Това е за цвета на текста който поствам в случея името , мненията и точките
 
Styl3rbg каза:
tedo96 каза:
Съмнява ме да е от това:
imagefill($image, 0, 0, $black);
или:
imagestring($image, $font_size1, 110, 23, $username, $black);
imagestring($image, $font_size1, 77, 45, $posts, $black);
imagestring($image, $font_size1, 65, 66, $user_cash, $black);
Това е за цвета на текста който поствам в случея името , мненията и точките
imagefill($image, 0, 0, $black);
ли е за това?
Смени $black с $blue
 
PHP:
<?php
$username = $_GET['username'];
header("Content-type: image/png; charset=windows-1251");
$file = file_get_contents("http://shoot-bg.info/sig.php?username=$username"); 


      $inf = explode("<br>", $file);
      $username = $inf[0];
      $posts = $inf[1];
      $user_cash = $inf[2];
      $avatar = $inf[3];

$user = "".$username;
$mneniq = "".$posts;
$user_cash= "".$user_cash;

$image = imagecreatefrompng("sig.png");
$font = "font/verdana.ttf";
$red = imagecolorallocate($image, 255, 0, 0);
$blue = imagecolorallocate($image, 0, 0, 255);
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$grey =  imagecolorallocate($image, 204, 204, 204);
imagefill($image, 0, 0, $white); //за бяло


$font_size1 = 4;
$upper_x = 180;
$upper_y = 12;

$font_size2 = 20;
$font_angle = 0;
$lower_x = 50;
$lower_y = 50;

imagestring($image, $font_size1, 110, 23, $username, $black);
imagestring($image, $font_size1, 77, 45, $posts, $black);
imagestring($image, $font_size1, 65, 66, $user_cash, $black);
//imagettftext($image, $font_size2, $font_angle, $lower_x, $lower_y, $blue, $font, $user_cash);

imagepng($image);
imagedestroy($image);

?>
 
tedo96 каза:
PHP:
<?php
$username = $_GET['username'];
header("Content-type: image/png; charset=windows-1251");
$file = file_get_contents("http://shoot-bg.info/sig.php?username=$username"); 


      $inf = explode("<br>", $file);
      $username = $inf[0];
      $posts = $inf[1];
      $user_cash = $inf[2];
      $avatar = $inf[3];

$user = "".$username;
$mneniq = "".$posts;
$user_cash= "".$user_cash;

$image = imagecreatefrompng("sig.png");
$font = "font/verdana.ttf";
$red = imagecolorallocate($image, 255, 0, 0);
$blue = imagecolorallocate($image, 0, 0, 255);
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$grey =  imagecolorallocate($image, 204, 204, 204);
imagefill($image, 0, 0, $white); //за бяло


$font_size1 = 4;
$upper_x = 180;
$upper_y = 12;

$font_size2 = 20;
$font_angle = 0;
$lower_x = 50;
$lower_y = 50;

imagestring($image, $font_size1, 110, 23, $username, $black);
imagestring($image, $font_size1, 77, 45, $posts, $black);
imagestring($image, $font_size1, 65, 66, $user_cash, $black);
//imagettftext($image, $font_size2, $font_angle, $lower_x, $lower_y, $blue, $font, $user_cash);

imagepng($image);
imagedestroy($image);

?>
Нем..
 

Back
Горе