Autor Zpráva
patrezz
Profil *
Zdravíčko :P

Mám taký problém:

Pred upgradom som na výpis textu cez GD library používal nasledujúci kód:

<?php

$id=$_GET['id'];

$im = imagecreate (300, 50);

$bg_color = imagecolorallocate($im, 255, 255, 255);

$font_size = 14;

$font = './NazovFontu.ttf';

$text_color = imagecolorallocate($im, 224, 26, 39);

imagettftext($im, $font_size, rand(0), 3, 15, $text_color, $font, $id);

imagecopy($im, 0, 0, 0, 0, 200, 50);

header ("Content-type: image/png");

Imagepng($im);

ImageDestroy($im);

?>


Ale teraz, mi to vypíše niečo takéto:

http://extensa.biz/obrazok/obrazok.php?id=lol

Čo s tým?
Nenašiel som nič, čo by mi s tým pomohlo...

Vopred ďakujem za Vaše reakcie/názory/rady....
Jan Tvrdík
Profil
Zkus:
<?php
$id = $_GET['id'];
$im = imagecreate (300, 50);
$bg_color = imagecolorallocate($im, 255, 255, 255);
$font_size = 14;
$font = './NazovFontu.ttf';
$text_color = imagecolorallocate($im, 224, 26, 39);
imagettftext($im, $font_size, 0, 3, 15, $text_color, $font, $id);
imagecopy($im, $dest, 0, 0, 0, 0, 200, 50);

header ("Content-type: image/png");
Imagepng($dest);
ImageDestroy($dest);
ImageDestroy($im);
?>
patrezz
Profil *
Zkus:
123456789101112131415 <?php$id = $_GET['id'];$im = imagecreate (300, 50);$bg_color = imagecolorallocate($im, 255, 255, 255);$font_size = 14;$font = './NazovFontu.ttf';$text_color = imagecolorallocate($im, 224, 26, 39);imagettftext($im, $font_size, 0, 3, 15, $text_color, $font, $id);imagecopy($im, $dest, 0, 0, 0, 0, 200, 50);header ("Content-type: image/png");Imagepng($dest);ImageDestroy($dest);ImageDestroy($im);?>

hlási to:


Warning: imagecopy(): supplied argument is not a valid Image resource in /var/www/extensa.biz/extensa 2.0 Beta/menuhover.php on line 9

Warning: Cannot modify header information - headers already sent by (output started at /var/www/extensa.biz/extensa 2.0 Beta/menuhover.php:9) in /var/www/extensa.biz/extensa 2.0 Beta/menuhover.php on line 11

Warning: imagepng(): supplied argument is not a valid Image resource in /var/www/extensa.biz/extensa 2.0 Beta/menuhover.php on line 12

Warning: imagedestroy(): supplied argument is not a valid Image resource in /var/www/extensa.biz/extensa 2.0 Beta/menuhover.php on line 13
Jan Tvrdík
Profil
Další pokus:
<?php
$id = $_GET['id'];
$im = imagecreate (300, 50);
$dest = imagecreate (300, 50);
$bg_color = imagecolorallocate($im, 255, 255, 255);
$font_size = 14;
$font = './NazovFontu.ttf';
$text_color = imagecolorallocate($im, 224, 26, 39);
imagettftext($im, $font_size, 0, 3, 15, $text_color, $font, $id);
imagecopy($dest, $im, 0, 0, 0, 0, 200, 50);

header ("Content-type: image/png");
Imagepng($dest);
ImageDestroy($dest);
ImageDestroy($im);
?>
patrezz
Profil *
Další pokus:
12345678910111213141516 <?php$id = $_GET['id'];$im = imagecreate (300, 50);$dest = imagecreate (300, 50);$bg_color = imagecolorallocate($im, 255, 255, 255);$font_size = 14;$font = './NazovFontu.ttf';$text_color = imagecolorallocate($im, 224, 26, 39);imagettftext($im, $font_size, 0, 3, 15, $text_color, $font, $id);imagecopy($dest, $im, 0, 0, 0, 0, 200, 50);header ("Content-type: image/png");Imagepng($dest);ImageDestroy($dest);ImageDestroy($im);?>

už to fičí :)
dik moc
patrezz
Profil *
ešte niečo..

ako spravím, aby to malo priehladné pozadie?
dik ešte raz
gmvasek
Profil
Základní problém byl v tom, že rand() má dva povinné parametry.
patrezz
Profil *
hej, ale predsalen stale mam problem s tym, ako urobit priehladne pozadie...
neviete niekto co s tym? :-/
patrezz
Profil *
hm tak aspon ako urcit pozadie ? napriklad z png suboru....

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0