Mam taki kod:
$wejscie = array ("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "r", "s", "t", "w", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",); $pis = $wejscie[$losowe_klucze[0]]. "\n" . $wejscie[$losowe_klucze[1]] . "\n" . $wejscie[$losowe_klucze[2]] . "\n" . $wejscie[$losowe_klucze[3]] . "\n" . $wejscie[$losowe_klucze[4]]; // Create the image $im = imagecreatetruecolor(130, 30); // Create some colors $white = imagecolorallocate($im, 255, 127, 80); $grey = imagecolorallocate($im, 128, 128, 128); $black = imagecolorallocate($im, 255, 255, 255); imagefilledrectangle($im, 0, 0, 399, 29, $white); $pis = ''; foreach($losowe_klucze as $klucz){ $pis .= $wejscie[$klucz]; } // The text to draw $text = $pis; $zapisz = $zapis.".png"; $otworz = "./indetyfikatory/".$zapis.".png"; $czas = $zapis - 600; // Replace path by your own font path $font = 'arial.ttf'; // Add some shadow to the text imagettftext($im, 20, -5, 11, 21, $grey, $font, $text); // Add the text imagettftext($im, 20, -5, 10, 20, $black, $font, $text); // Using imagepng() results in clearer text compared with imagejpeg() imagepng($im, "./indetyfikatory/$zapisz"); imagedestroy($im);
Czemu na obrazie nie ma tekstu
