PHP:
<?php
// ПЪРВОНАЧАЛНО УСТОНОВЯВАНЕ НА ИЗОБРАЖЕНИЕТО
$height = 200;
$width = 200;
$im = imagecreate($width, $height);
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
$string = 'xaax';
// ЧЕРТАНЕ ВЪРХУ ИЗОБРАЖНИЕТО
imagefill($im, 0, 0, $black);
imageline($im, 0, 0, $width, $height, $white);
imagestring( $im, 4, 30, 25, $string,
$white );
// ИЗВЕЖДАНЕ НА ИЗОБРАЖЕНИЕТО
Header( "Content-type: image/png" );
ImagePng ($im);
// ОСВОБОЖДАВАНЕ НА РЕСУРСИТЕ
imagedestroy($im);
?>