From test, 6 Years ago, written in PHP.
This paste is a reply to Text to PNG from Trivial Crane
- go back
Embed
Viewing differences between Text to PNG and Re: Text to PNG
<?php
    $width = 640;
    $height = 480;
    $text = "THIS IS A TEST FROM JOHN";
    $fontsize = 5;

    $img = imagecreate($width, $height);

    // Transparent background
    $black = imagecolorallocate($img, 0, 0, 0);
    imagecolortransparent($img, $black);

    // Red text
    $red = imagecolorallocate($img, 255, 0, 0);
    imagestring($img, $fontsize, 0, 0, $text, $red);

    header('Content-type: image/png');
    imagepng($img);
    imagedestroy($img);
?>