Jump to content

[SOLVED] generating grafic


alin19

Recommended Posts

 

can i create an image(or a grafic) with only php? i'm reading in my book that i need pearl;

 

 

<?php

$width = 34*M_PI;

$height = 110;

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

$background = imagecolorallocate($img,200 ,200 ,200);

$black = imagecolorallocate($img, 0 , 0, 0);

$interval = 2*M_PI;

for ($i=0; $i <$interval; $i+=0.01)

 

{  $m = 5 + (( $width/(2*M_PI)-2))*$i;

  $n= 5 + ($height/2-5)*(1-sin($i));

 

imagesetpixel ($img, $m, $n, $black);

}

 

 

header("Content-type: image/png");

imagepng($img);

imagedestroy($img);

?>

 

 

 

 

i get this error: Fatal error: Call to undefined function: imagecreate() in c:\program files\easyphp1-8\www\tabel.php on line 4

Link to comment
https://forums.phpfreaks.com/topic/87180-solved-generating-grafic/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.