mam następujące pliki:
graph.class.php
<?php
error_reporting( E_ALL );
class GraphEngine
{
var $intImageWidth;
var $intImageHeight;
var $strImageTitle;
var $resImage;
var $resBlackColor;
var $resTransparentColor;
function GraphEngine( $intWidth, $intHeight )
{
$this->intImageWidth = $intWidth;
$this->intImageHeight = $intHeight;
}
function SetTitle( $strTitle )
{
$this->strImageTitle = $strTitle;
}
function DrawGraph()
{
$this->resImage = imagecreate( $this->intImageWidth, $this->intImageHeight );
$this->resTransparentColor = imagecolorallocate( $this->resImage, 1, 1, 1 );
$this->resBlackColor = imagecolorallocate( $this->resImage, 0, 0, 0 );
imagecolortransparent( $this->resImage, $this->resTransparentColor );
imagestring( $this->resImage, 2, 5, 5, $this->strImageTitle, $this->resBlackColor );
header( "Content-type: image/png" );
imagepng( $this->resImage );
imagedestroy( $this->resImage );
}
/**
* Koniec
*/
}
?>
oraz image.php
<?php
error_reporting( E_ALL );
require_once( "graph.class.php" );
$g = new GraphEngine( 400, 600 );
$g->SetTitle( "Test" );
$g->DrawGraph();
?>
i nie wiem dlaczego ale nie wyświetla się obrazek. Ja nie mogę znaleźć błędu, może wy znajdziecie :P
z góry thx...