problem with generating an image
Posted: Thu Apr 15, 2004 4:56 am
I use this code:
<?php
$height = 200;
$width = 200;
$im = imagecreate($width, $height);
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
imagefill($im, 0, 0, $black);
imageline($im, 0 ,0 ,$width, $height, $white);
header ("Content-type: image/png");
imagepng($im);
imagedestroy($im);
?>
and this is what i got:
‰PNG IHDRÈÈ—–<ÝPLTEÿÿÿUÂÓ~µIDATxœuϹ1ÀÐé|K£J $àï܇
<?php
$height = 200;
$width = 200;
$im = imagecreate($width, $height);
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
imagefill($im, 0, 0, $black);
imageline($im, 0 ,0 ,$width, $height, $white);
header ("Content-type: image/png");
imagepng($im);
imagedestroy($im);
?>
and this is what i got:
‰PNG IHDRÈÈ—–<ÝPLTEÿÿÿUÂÓ~µIDATxœuϹ1ÀÐé|K£J $àï܇