This is drawing.php file having class GeoDrawing and method image which creates the image. I now create the object of this class and call the function and image return successfully.
When I include this file 'drawing.php' to another php file - let say server.php - then this function does not return image.
Please help me out. What is going wrong with this code?
class GeoDrawing
{
public $canvas;
function Image()
{
$this->canvas = imagecreate(2600, 1200) or die("Cannot Initialize new GD image stream");
imagecolorallocate($this->canvas, 225, 225, 225);
header('Content-Type: image/jpeg');
imagejpeg($home->canvas);
}
}
$home = new GeoDrawing();
$home->image();
display_errorson, right? .. right?