How could I use and/or transform this code to work with an existing image? I'd like for someone to be able to type in text and it would show up on an existing image.
PHP Code:
<?php
// Create image handle
$im = imagecreatetruecolor(200, 200);
// Allocate colors
$black = imagecolorallocate($im, 0, 0, 0);
$white = imagecolorallocate($im, 255, 255, 255);
// Load the PostScript Font
$font = imagepsloadfont('font.pfm');
// Write the font to the image
imagepstext($im, 'Sample text is simple', $font, 12, $black, $white, 50, 50);
// Output and free memory
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
Please. Thanks!
EDIT: Also, how can I change the font.pfm to a font.ttf? Thanks!
Bookmarks