angel_boy013
جمعه 18 اسفند 1385, 21:11 عصر
این کد باید یک عکس با یک نوشته در وستش بیاره اما وقتی upload کردم نوشته نمیاد
<?php
ini_set("error_reporting","E_ALL & ~E_NOTICE & ~E_STRICT");
// Set the content-type
header("Content-type: image/png");
include("fagd.php");
// Create the image
if(!$_GET[text])
{
$string = "NOTE";
}
else
$string = $_GET["text"];
$im = imagecreate(80, 40);
$bg = imagecolorallocate($im, 33, 254, -167);
$bgline = imagecolorallocate($im, 0, 0, 0);
imageline($im,0,6,90,6,$bgline); //line avale amodi
imageline($im,0,10,80,10,$bgline); //line 2vome amodi
imageline($im,0,14,80,14,$bgline); //line 3vome amodi
imageline($im,0,24,85,124,$bgline); //line 4vome amodi
imageline($im,20,88,22,58,$bgline); //line 5vome amodi
imageline($im,7,0,7,40,$bgline); //line avale ofoghi
imageline($im,12,0,12,40,$bgline); //line 2vome ofoghi
imageline($im,18,0,18,40,$bgline); //line 3vome ofoghi
imageline($im,28,34,43,40,$bgline); //line 4vome ofoghi
imageline($im,35,0,98,40,$bgline); //line 5vome ofoghi
// Create some colors
$white = imagecolorallocate($im, -33, 243, -167);
$grey = imagecolorallocate($im, 58, -128, 128);
$black = imagecolorallocate($im, 0, 0 , 0);
imagearc($im, 50, 100, 50, 150, 100, 100, $black);
// The text to draw
$text = fagd($string);
// Replace path by your own font path
$font = 'comic.ttf';
// Add some shadow to the text
imagettftext($im, 15, 20, -180, 250, $grey, $font, $text);
// Add the text
imagettftext($im, 15, 5, 10, 30 , $black, $font, $text);
// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
?>
<?php
ini_set("error_reporting","E_ALL & ~E_NOTICE & ~E_STRICT");
// Set the content-type
header("Content-type: image/png");
include("fagd.php");
// Create the image
if(!$_GET[text])
{
$string = "NOTE";
}
else
$string = $_GET["text"];
$im = imagecreate(80, 40);
$bg = imagecolorallocate($im, 33, 254, -167);
$bgline = imagecolorallocate($im, 0, 0, 0);
imageline($im,0,6,90,6,$bgline); //line avale amodi
imageline($im,0,10,80,10,$bgline); //line 2vome amodi
imageline($im,0,14,80,14,$bgline); //line 3vome amodi
imageline($im,0,24,85,124,$bgline); //line 4vome amodi
imageline($im,20,88,22,58,$bgline); //line 5vome amodi
imageline($im,7,0,7,40,$bgline); //line avale ofoghi
imageline($im,12,0,12,40,$bgline); //line 2vome ofoghi
imageline($im,18,0,18,40,$bgline); //line 3vome ofoghi
imageline($im,28,34,43,40,$bgline); //line 4vome ofoghi
imageline($im,35,0,98,40,$bgline); //line 5vome ofoghi
// Create some colors
$white = imagecolorallocate($im, -33, 243, -167);
$grey = imagecolorallocate($im, 58, -128, 128);
$black = imagecolorallocate($im, 0, 0 , 0);
imagearc($im, 50, 100, 50, 150, 100, 100, $black);
// The text to draw
$text = fagd($string);
// Replace path by your own font path
$font = 'comic.ttf';
// Add some shadow to the text
imagettftext($im, 15, 20, -180, 250, $grey, $font, $text);
// Add the text
imagettftext($im, 15, 5, 10, 30 , $black, $font, $text);
// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
?>