You are here

function pChart::drawFromPicture in Visitors 7.0

Same name and namespace in other branches
  1. 8 pchart/pChart.inc \pChart::drawFromPicture()
3 calls to pChart::drawFromPicture()
pChart::drawFromGIF in pchart/pChart.inc
pChart::drawFromJPG in pchart/pChart.inc
pChart::drawFromPNG in pchart/pChart.inc

File

pchart/pChart.inc, line 2393

Class

pChart

Code

function drawFromPicture($PicType, $FileName, $X, $Y, $Alpha = 100) {
  if (file_exists($FileName)) {
    $Infos = getimagesize($FileName);
    $Width = $Infos[0];
    $Height = $Infos[1];
    if ($PicType == 1) {
      $Raster = imagecreatefrompng($FileName);
    }
    if ($PicType == 2) {
      $Raster = imagecreatefromgif($FileName);
    }
    if ($PicType == 3) {
      $Raster = imagecreatefromjpeg($FileName);
    }
    imagecopymerge($this->Picture, $Raster, $X, $Y, 0, 0, $Width, $Height, $Alpha);
    imagedestroy($Raster);
  }
}