03-04-2006, 11:35
|
|
|
חבר מתאריך: 03.07.05
הודעות: 284
|
|
לא הצלחתי להשתמש בפונקציה... היא מחליפה את imagettftext? להלן הקוד המלא:
קוד PHP:
<?php function imagettftextalign($image, $size, $angle, $x, $y, $color, $font, $text, $alignment='L') { //check width of the text $bbox = imagettfbbox ($size, $angle, $font, $text); $textWidth = $bbox[2] - $bbox[0]; switch ($alignment) { case "R": $x -= $textWidth; break; case "C": $x -= $textWidth / 2; break; } } // create a 100*30 image $im = imagecreatefromjpeg("moo2.jpg");
// white background and blue text $bg = imagecolorallocate($im, 255, 255, 255); $textcolor = imagecolorallocate($im, 0, 0, 0); $font = "Arial.ttf"; // write the string at the top left $text= "בהל בלה דגשכשדגליכשד ";
imagettftext($im, 20, 0, 200, 87, $black, $font, $text);
// output the image header("Content-type: image/png"); imagepng($im); ?>
|