[thelist] php on-the-fly image and text generation question

Dunstan Orchard dunstan at 1976design.com
Sun Oct 13 15:35:01 CDT 2002


Does anyone have any idea why some of the letters on this page are all blurry?

http://www.1976design.com/testarea/photo/image.php

It seems to happen only for letters in that space - that is if I deleted two
letters from the start the blur will shift two letters to the right.

The code to generate that page is:

<php code>
header("content-type:image/gif");

// php error reporting, turn on for development
error_reporting(E_ALL);

// create image
$Image=ImageCreate(320,240);

// set colour variables
$white=ImageColorAllocate($Image,255,255,255);
$grey=ImageColorAllocate($Image,128,128,128);
$black=ImageColorAllocate($Image,75,75,75);

// draw borders
imageline($Image,0,0,319,0,$black);
imageline($Image,319,0,319,239,$black);
imageline($Image,319,239,0,239,$black);
imageline($Image,0,239,0,0,$black);

// draw grey rectangle
imagefilledrectangle($Image, 10, 10, 310, 210, $grey);

// write text
ImageTTFText($Image, 8, 0, 10, 230, $black, "slkscr.ttf", "Fats Wallace
Brdige, Washington DC");

ImageGIF($Image);
ImageDestroy($Image);
</php code>


thanks very much - dunstan

---------------------------
Dorset, England
http://www.1976design.com/
http://www.orchard.it/
http://www.maccaws.org/



More information about the thelist mailing list