locx=$x; $this->locy=$y; $this->loctyp=$typ; switch (StrToUpper($this->loctyp)) { case "GIF": header("Content-type: image/gif"); break; case "JPG": header("Content-type: image/jpeg"); break; case "PNG": header("Content-type: image/png"); break; default: } $this->im = imagecreate($x,$y); imagefill($this->im, 0, $y-1, ImageColorAllocate ($this->im, 255,255,255)); $this->lastx=0; $this->lasty=5; $this->aPlot(0,$y); $this->aPlot($x-5,$y); $this->aPlot($x-5,5); $this->aPlot(0,5); $this->aMove(1,6); $this->aPlot(1,$y-1); $this->aPlot($x-6,$y-1); $this->aPlot($x-6,6); $this->aPlot(1,6); imagerectangle($this->im, 5, $y-1,$x-1, $y-4, ImageColorAllocate ($this->im, 170,170,170)); imagerectangle($this->im, 6, $y-2,$x-2, $y-3, ImageColorAllocate ($this->im, 170,170,170)); ImageRectangle($this->im, $x-4, $y-1,$x-1, 5, ImageColorAllocate ($this->im, 170,170,170)); ImageRectangle($this->im, $x-3, $y-2,$x-2, 6, ImageColorAllocate ($this->im, 170,170,170)); $this->posunx=3; $this->posuny=8; } function Scale($xmin,$ymin,$xmax,$ymax) { $this->xmin=$xmin; $this->ymin=$ymin; $this->xmax=$xmax; $this->ymax=$ymax; $this->kx = ($this->locx-($this->posunx+$this->posuny)) / ($xmax - $xmin); $this->ky = ($this->locy-($this->posunx+$this->posuny)) / ($ymax - $ymin); $this->lastx=(-$this->xmin)*$this->kx; $this->lasty=(-$this->ymin)*$this->ky; } function Move($x,$y) { $this->lastx=$this->posunx+($x-$this->xmin)*$this->kx; $this->lasty=$this->posuny+($y-$this->ymin)*$this->ky; } function aMove($x,$y) { $this->lastx=$x; $this->lasty=$y; } function Plot($x,$y) { $xx=$this->posunx+($x-$this->xmin)*$this->kx; $yy=$this->posuny+($y-$this->ymin)*$this->ky; imageline($this->im,$this->lastx,$this->locy-$this->lasty, $xx,$this->locy-$yy, ImageColorAllocate ($this->im, $this->R, $this->G, $this->B)); $this->lastx=$xx; $this->lasty=$yy; } function aPlot($x,$y) { imageline($this->im,$this->lastx,$this->locy-$this->lasty, $x,$this->locy-$y, ImageColorAllocate($this->im, $this->R, $this->G, $this->B)); $this->lastx=$x; $this->lasty=$y; } function DejRozmer(&$x,&$y) { $x=$this->locx; $y=$this->locy; } function PenColor($R,$G,$B) { $this->R=$R; $this->G=$G; $this->B=$B; } function OutString($retez,$velikost) { ImageString($this->im,$velikost,$this->lastx,$this->locy-$this-> lasty-imagefontheight($velikost), $retez,ImageColorAllocate($this->im, $this->R, $this->G, $this->B)); } function Paint() { switch (StrToUpper($this->loctyp)) { case "GIF": imagegif($this->im); break; case "JPG": imagejpeg($this->im); break; case "PNG": imagepng($this->im); break; default: } ImageDestroy($this->im); } }?>