當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Graph::LoadBkgImage方法代碼示例

本文整理匯總了PHP中Graph::LoadBkgImage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Graph::LoadBkgImage方法的具體用法?PHP Graph::LoadBkgImage怎麽用?PHP Graph::LoadBkgImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Graph的用法示例。


在下文中一共展示了Graph::LoadBkgImage方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct($aIcon, $aScale = 1)
 {
     global $_gPredefIcons;
     if (is_string($aIcon)) {
         $this->iGDImage = Graph::LoadBkgImage('', $aIcon);
     } elseif (is_integer($aIcon)) {
         // Builtin image
         $this->iGDImage = $_gPredefIcons->GetImg($aIcon);
     } else {
         Util\JpGraphError::RaiseL(6011);
         //('Argument to IconImage must be string or integer');
     }
     $this->iScale = $aScale;
     $this->iWidth = Image::GetWidth($this->iGDImage);
     $this->iHeight = Image::GetHeight($this->iGDImage);
 }
開發者ID:amenadiel,項目名稱:jpgraph,代碼行數:16,代碼來源:IconImage.php

示例2: Stroke

 function Stroke($aImg)
 {
     if ($this->iFile != '' && $this->iCountryFlag != '') {
         JpGraphError::Raise('It is not possible to specify both an image file and a country flag for the same icon.');
     }
     if ($this->iFile != '') {
         $gdimg = Graph::LoadBkgImage('', $this->iFile);
     } else {
         if (!class_exists('FlagImages')) {
             JpGraphError::Raise('In order to use Country flags as icons you must include the "jpgraph_flags.php" file.');
         }
         $fobj = new FlagImages($this->iCountryStdSize);
         $dummy = '';
         $gdimg = $fobj->GetImgByName($this->iCountryFlag, $dummy);
     }
     if ($this->iX >= 0 && $this->iX <= 1.0) {
         $w = imagesx($aImg->img);
         $this->iX = round($w * $this->iX);
     }
     if ($this->iY >= 0 && $this->iY <= 1.0) {
         $h = imagesy($aImg->img);
         $this->iY = round($h * $this->iY);
     }
     $iconw = imagesx($gdimg);
     $iconh = imagesy($gdimg);
     if ($this->iHorAnchor == 'center') {
         $this->iX -= round($iconw * $this->iScale / 2);
     }
     if ($this->iHorAnchor == 'right') {
         $this->iX -= round($iconw * $this->iScale);
     }
     if ($this->iVertAnchor == 'center') {
         $this->iY -= round($iconh * $this->iScale / 2);
     }
     if ($this->iVertAnchor == 'bottom') {
         $this->iY -= round($iconh * $this->iScale);
     }
     $aImg->CopyMerge($gdimg, $this->iX, $this->iY, 0, 0, round($iconw * $this->iScale), round($iconh * $this->iScale), $iconw, $iconh, $this->iMix);
 }
開發者ID:BackupTheBerlios,項目名稱:zvs,代碼行數:39,代碼來源:jpgraph_iconplot.php

示例3: _strokeBackgroundImage

 function _strokeBackgroundImage()
 {
     if ($this->background_image == '') {
         return;
     }
     $bkgimg = Graph::LoadBkgImage('', $this->background_image);
     // Background width & Heoght
     $bw = imagesx($bkgimg);
     $bh = imagesy($bkgimg);
     // Canvas width and height
     $cw = imagesx($this->img);
     $ch = imagesy($this->img);
     if ($this->doshadow) {
         $cw -= $this->shadow_width;
         $ch -= $this->shadow_width;
     }
     if ($this->background_image_x === NULL || $this->background_image_y === NULL) {
         if ($this->background_image_center) {
             // Center original image in the plot area
             $x = round($cw / 2 - $bw / 2);
             $y = round($ch / 2 - $bh / 2);
         } else {
             // Just copy the image from left corner, no resizing
             $x = 0;
             $y = 0;
         }
     } else {
         $x = $this->background_image_x;
         $y = $this->background_image_y;
     }
     imagecopymerge($this->img, $bkgimg, $x, $y, 0, 0, $bw, $bh, $this->background_image_mix);
 }
開發者ID:nbgmaster,項目名稱:happify,代碼行數:32,代碼來源:jpgraph_mgraph.php

示例4: Stroke

 function Stroke($img, $x, $y)
 {
     if (!$this->show) {
         return;
     }
     if ($this->iFormatCallback != '' || $this->iFormatCallback2 != '') {
         if ($this->iFormatCallback != '') {
             $f = $this->iFormatCallback;
             list($width, $color, $fcolor) = call_user_func($f, $this->yvalue);
             $filename = $this->iFileName;
             $imgscale = $this->iScale;
         } else {
             $f = $this->iFormatCallback2;
             list($width, $color, $fcolor, $filename, $imgscale) = call_user_func($f, $this->yvalue, $this->xvalue);
             if ($filename == "") {
                 $filename = $this->iFileName;
             }
             if ($imgscale == "") {
                 $imgscale = $this->iScale;
             }
         }
         if ($width == "") {
             $width = $this->width;
         }
         if ($color == "") {
             $color = $this->color;
         }
         if ($fcolor == "") {
             $fcolor = $this->fill_color;
         }
     } else {
         $fcolor = $this->fill_color;
         $color = $this->color;
         $width = $this->width;
         $filename = $this->iFileName;
         $imgscale = $this->iScale;
     }
     if ($this->type == MARK_IMG || $this->type >= MARK_FLAG1 && $this->type <= MARK_FLAG4 || $this->type >= MARK_IMG_PUSHPIN) {
         // Note: For the builtin images we use the "filename" parameter
         // to denote the color
         $anchor_x = 0.5;
         $anchor_y = 0.5;
         switch ($this->type) {
             case MARK_FLAG1:
             case MARK_FLAG2:
             case MARK_FLAG3:
             case MARK_FLAG4:
                 $this->markimg = FlagCache::GetFlagImgByName($this->type - MARK_FLAG1 + 1, $filename);
                 break;
             case MARK_IMG:
                 // Load an image and use that as a marker
                 // Small optimization, if we have already read an image don't
                 // waste time reading it again.
                 if ($this->markimg == '' || !($this->oldfilename === $filename)) {
                     $this->markimg = Graph::LoadBkgImage('', $filename);
                     $this->oldfilename = $filename;
                 }
                 break;
             case MARK_IMG_PUSHPIN:
             case MARK_IMG_SPUSHPIN:
             case MARK_IMG_LPUSHPIN:
                 if ($this->imgdata_pushpins == null) {
                     require_once 'imgdata_pushpins.inc.php';
                     $this->imgdata_pushpins = new ImgData_PushPins();
                 }
                 $this->markimg = $this->imgdata_pushpins->GetImg($this->type, $filename);
                 list($anchor_x, $anchor_y) = $this->imgdata_pushpins->GetAnchor();
                 break;
             case MARK_IMG_SQUARE:
                 if ($this->imgdata_squares == null) {
                     require_once 'imgdata_squares.inc.php';
                     $this->imgdata_squares = new ImgData_Squares();
                 }
                 $this->markimg = $this->imgdata_squares->GetImg($this->type, $filename);
                 list($anchor_x, $anchor_y) = $this->imgdata_squares->GetAnchor();
                 break;
             case MARK_IMG_STAR:
                 if ($this->imgdata_stars == null) {
                     require_once 'imgdata_stars.inc.php';
                     $this->imgdata_stars = new ImgData_Stars();
                 }
                 $this->markimg = $this->imgdata_stars->GetImg($this->type, $filename);
                 list($anchor_x, $anchor_y) = $this->imgdata_stars->GetAnchor();
                 break;
             case MARK_IMG_BEVEL:
                 if ($this->imgdata_bevels == null) {
                     require_once 'imgdata_bevels.inc.php';
                     $this->imgdata_bevels = new ImgData_Bevels();
                 }
                 $this->markimg = $this->imgdata_bevels->GetImg($this->type, $filename);
                 list($anchor_x, $anchor_y) = $this->imgdata_bevels->GetAnchor();
                 break;
             case MARK_IMG_DIAMOND:
                 if ($this->imgdata_diamonds == null) {
                     require_once 'imgdata_diamonds.inc.php';
                     $this->imgdata_diamonds = new ImgData_Diamonds();
                 }
                 $this->markimg = $this->imgdata_diamonds->GetImg($this->type, $filename);
                 list($anchor_x, $anchor_y) = $this->imgdata_diamonds->GetAnchor();
                 break;
//.........這裏部分代碼省略.........
開發者ID:Arrray,項目名稱:PHPpractice,代碼行數:101,代碼來源:jpgraph_plotmark.inc.php

示例5: _Stroke

 function _Stroke($aImg, $x = null, $y = null, $aReturnWidthHeight = false)
 {
     if ($this->iFile != '' && $this->iCountryFlag != '') {
         JpGraphError::RaiseL(8003);
         //('It is not possible to specify both an image file and a country flag for the same icon.');
     }
     if ($this->iFile != '') {
         $gdimg = Graph::LoadBkgImage('', $this->iFile);
     } elseif ($this->iImgString != '') {
         $gdimg = Image::CreateFromString($this->iImgString);
     } else {
         if (!class_exists('FlagImages', false)) {
             JpGraphError::RaiseL(8004);
             //('In order to use Country flags as icons you must include the "jpgraph_flags.php" file.');
         }
         $fobj = new FlagImages($this->iCountryStdSize);
         $dummy = '';
         $gdimg = $fobj->GetImgByName($this->iCountryFlag, $dummy);
     }
     $iconw = imagesx($gdimg);
     $iconh = imagesy($gdimg);
     if ($aReturnWidthHeight) {
         return array(round($iconw * $this->iScale), round($iconh * $this->iScale));
     }
     if ($x !== null && $y !== null) {
         $this->iX = $x;
         $this->iY = $y;
     }
     if ($this->iX >= 0 && $this->iX <= 1.0) {
         $w = imagesx($aImg->img);
         $this->iX = round($w * $this->iX);
     }
     if ($this->iY >= 0 && $this->iY <= 1.0) {
         $h = imagesy($aImg->img);
         $this->iY = round($h * $this->iY);
     }
     if ($this->iHorAnchor == 'center') {
         $this->iX -= round($iconw * $this->iScale / 2);
     }
     if ($this->iHorAnchor == 'right') {
         $this->iX -= round($iconw * $this->iScale);
     }
     if ($this->iVertAnchor == 'center') {
         $this->iY -= round($iconh * $this->iScale / 2);
     }
     if ($this->iVertAnchor == 'bottom') {
         $this->iY -= round($iconh * $this->iScale);
     }
     $aImg->CopyMerge($gdimg, $this->iX, $this->iY, 0, 0, round($iconw * $this->iScale), round($iconh * $this->iScale), $iconw, $iconh, $this->iMix);
 }
開發者ID:nbgmaster,項目名稱:happify,代碼行數:50,代碼來源:jpgraph_iconplot.php

示例6: IconImage

 function IconImage($aIcon, $aScale = 1)
 {
     global $_gPredefIcons;
     if (is_string($aIcon)) {
         $this->iGDImage = Graph::LoadBkgImage('', $aIcon);
     } elseif (is_integer($aIcon)) {
         $this->iGDImage = $_gPredefIcons->GetImg($aIcon);
     } else {
         JpGraphError::RaiseL(6011);
     }
     $this->iScale = $aScale;
     $this->iWidth = Image::GetWidth($this->iGDImage);
     $this->iHeight = Image::GetHeight($this->iGDImage);
 }
開發者ID:natanoj,項目名稱:nuBuilderPro,代碼行數:14,代碼來源:jpgraph_gantt.php

示例7: _Stroke

 function _Stroke(&$aImg, $x = null, $y = null, $aReturnWidthHeight = false)
 {
     if ($this->iFile != '' && $this->iCountryFlag != '') {
         JpGraphError::RaiseL(8003);
     }
     if ($this->iFile != '') {
         $gdimg = Graph::LoadBkgImage('', $this->iFile);
     } elseif ($this->iImgString != '') {
         $gdimg = Image::CreateFromString($this->iImgString);
     } else {
         if (!class_exists('FlagImages')) {
             JpGraphError::RaiseL(8004);
         }
         $fobj = new FlagImages($this->iCountryStdSize);
         $dummy = '';
         $gdimg = $fobj->GetImgByName($this->iCountryFlag, $dummy);
     }
     $iconw = imagesx($gdimg);
     $iconh = imagesy($gdimg);
     if ($aReturnWidthHeight) {
         return array(round($iconw * $this->iScale), round($iconh * $this->iScale));
     }
     if ($x !== null && $y !== null) {
         $this->iX = $x;
         $this->iY = $y;
     }
     if ($this->iX >= 0 && $this->iX <= 1.0) {
         $w = imagesx($aImg->img);
         $this->iX = round($w * $this->iX);
     }
     if ($this->iY >= 0 && $this->iY <= 1.0) {
         $h = imagesy($aImg->img);
         $this->iY = round($h * $this->iY);
     }
     if ($this->iHorAnchor == 'center') {
         $this->iX -= round($iconw * $this->iScale / 2);
     }
     if ($this->iHorAnchor == 'right') {
         $this->iX -= round($iconw * $this->iScale);
     }
     if ($this->iVertAnchor == 'center') {
         $this->iY -= round($iconh * $this->iScale / 2);
     }
     if ($this->iVertAnchor == 'bottom') {
         $this->iY -= round($iconh * $this->iScale);
     }
     $aImg->CopyMerge($gdimg, $this->iX, $this->iY, 0, 0, round($iconw * $this->iScale), round($iconh * $this->iScale), $iconw, $iconh, $this->iMix);
 }
開發者ID:natanoj,項目名稱:nuBuilderPro,代碼行數:48,代碼來源:jpgraph_iconplot.php

示例8: IconImage

    function IconImage($aIcon,$aScale=1) {
	GLOBAL $_gPredefIcons ; 
	if( is_string($aIcon) ) {
	    $this->iGDImage = Graph::LoadBkgImage('',$aIcon);
	}
	elseif( is_integer($aIcon) ) {
	    // Builtin image
	    $this->iGDImage = $_gPredefIcons->GetImg($aIcon);
	}
	else {
	    JpGraphError::Raise('Argument to IconImage must be string or integer');
	}
	$this->iScale = $aScale;
	$this->iWidth = Image::GetWidth($this->iGDImage);
	$this->iHeight = Image::GetHeight($this->iGDImage);
    }
開發者ID:reekoheek,項目名稱:srmis,代碼行數:16,代碼來源:jpgraph_gantt.php


注:本文中的Graph::LoadBkgImage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。