http://www.php.net/manual gives this code snippet -
<?php
header("Content-type: image/png");
$im = @imagecreate(110, 20)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================
"AngryCloud" <webforumsuser (AT) macromedia (DOT) com> wrote
Quote:
I use the following PHP code to create a JPEG thumbnail from a JPEG image.
How
can I modify this code to create a PNG thumbnail from a PNG image?
$image_p = imagecreatetruecolor($thumb_width, $thumb_height);
$image = imagecreatefromjpeg($thumbnail);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $thumb_width,
$thumb_height,
$thumb_width_orig, $thumb_height_orig);
imagejpeg($image_p, $thumbnail_source, 100); |