im ImageCreate 600 100 imagesavealpha im true text ImageColorAllocate

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
$im = ImageCreate (600, 100);
imagesavealpha($im, true);
$text = ImageColorAllocate($im, 255, 0, 0);
$black = ImageColorAllocateAlpha($im, 0, 0, 0, 255);
imagecolortransparent($im, $black);
ImageFill($im, 0, 0, $black);
for($i=0;$i<count($comments);$i++){
imagettftext($im, 10, 0, 2, (($i+1)*12), $text, "/home/chmod/test/twitch/consolas.ttf", $comments[$i]);
}
imagepng($im, "/home/chmod/img.png");