当前位置: 首页>>代码示例>>PHP>>正文


PHP Color::HEX2RGB方法代码示例

本文整理汇总了PHP中Color::HEX2RGB方法的典型用法代码示例。如果您正苦于以下问题:PHP Color::HEX2RGB方法的具体用法?PHP Color::HEX2RGB怎么用?PHP Color::HEX2RGB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Color的用法示例。


在下文中一共展示了Color::HEX2RGB方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _tableWriteRow

 private function _tableWriteRow(&$table, $i, $x0)
 {
     $maxh = $this->_getRowHeight($table, $i);
     if ($table['multipage']) {
         $newpage = 0;
         if ($table['lasty'] + $maxh > $this->bottom) {
             if ($this->_checkLimitHeight($table, $maxh)) {
                 return;
             }
             $newpage = 1;
         } elseif (isset($table['pbr'][$i])) {
             $newpage = 1;
             unset($table['pbr'][$i]);
         } elseif (isset($table['knext'][$i]) && $i < $table['nr'] - 1) {
             $mrowh = $maxh;
             for ($j = $i + 1; $j < $table['nr']; $j++) {
                 $mrowh += $this->_getRowHeight($table, $j);
                 if (!isset($table['knext'][$j])) {
                     break;
                 }
                 unset($table['knext'][$j]);
             }
             if ($this->_checkLimitHeight($table, $mrowh)) {
                 return;
             }
             $newpage = $table['lasty'] + $mrowh > $this->bottom;
         }
         if ($newpage) {
             $this->_tableDrawBorder($table);
             $this->AddPage($this->CurOrientation);
             $table['lasty'] = $this->y;
             if ($table['repeat']) {
                 foreach ($table['repeat'] as $r) {
                     if ($r == $i) {
                         continue;
                     }
                     $this->_tableWriteRow($table, $r, $x0);
                 }
             }
         }
     }
     $y = $table['lasty'];
     for ($j = 0; $j < $table['nc']; $j++) {
         if (isset($table['cells'][$i][$j]['miw'])) {
             $c =& $table['cells'][$i][$j];
             list($x, $w) = $this->_tableGetWCell($table, $i, $j);
             $h = $this->_tableGetHCell($table, $i, $j);
             $x += $x0;
             //Fill
             $fill = isset($c['bgcolor']) ? $c['bgcolor'] : (isset($table['bgcolor'][$i]) ? $table['bgcolor'][$i] : (isset($table['bgcolor'][-1]) ? $table['bgcolor'][-1] : 0));
             if ($fill) {
                 $color = Color::HEX2RGB($fill);
                 $this->SetFillColor($color[0], $color[1], $color[2]);
                 $this->Rect($x, $y, $w, $h, 'F');
             }
             //Content
             if (isset($c['img'])) {
                 $this->Image($c['img'], $x, $y, $c['w'], $c['h']);
             } else {
                 $this->_drawCellAligned($x, $y, $c);
             }
             //Border
             if (isset($c['border'])) {
                 $table['listborder'][] = array($x, $y, $w, $h, $c['border']);
             } elseif (isset($table['border']) && $table['border']) {
                 $table['listborder'][] = array($x, $y, $w, $h, $table['border']);
             }
         }
     }
     $table['lasty'] += $table['hr'][$i];
     $this->y = $table['lasty'];
 }
开发者ID:muguli22,项目名称:house_plan,代码行数:72,代码来源:pdftable.inc.php

示例2: _tableWriteRow

 private function _tableWriteRow(&$table, $i, $x0)
 {
     $maxh = 0;
     for ($j = 0; $j < $table['nc']; $j++) {
         $h = $this->_tableGetHCell($table, $i, $j);
         if ($maxh < $h) {
             $maxh = $h;
         }
     }
     if ($table['lasty'] + $maxh > $this->bottom && $table['multipage']) {
         if ($maxh + $table['repeatH'] > $this->height) {
             $msg = 'Height of this row is greater than page height!';
             $this->SetFillColor(255, 0, 0);
             $h = $this->bottom - $table['lasty'];
             $this->Rect($this->x, $this->y = $table['lasty'], $table['w'], $h, 'F');
             $this->MultiCell($table['w'], $h, $msg);
             $table['lasty'] += $h;
             return;
         }
         $this->_tableDrawBorder($table);
         $this->AddPage($this->CurOrientation);
         $table['lasty'] = $this->y;
         if ($table['repeat']) {
             foreach ($table['repeat'] as $r) {
                 if ($r == $i) {
                     continue;
                 }
                 $this->_tableWriteRow($table, $r, $x0);
             }
         }
     }
     $y = $table['lasty'];
     for ($j = 0; $j < $table['nc']; $j++) {
         if (isset($table['cells'][$i][$j]['miw'])) {
             $c =& $table['cells'][$i][$j];
             list($x, $w) = $this->_tableGetWCell($table, $i, $j);
             $h = $this->_tableGetHCell($table, $i, $j);
             $x += $x0;
             //Fill
             $fill = isset($c['bgcolor']) ? $c['bgcolor'] : (isset($table['bgcolor'][$i]) ? $table['bgcolor'][$i] : (isset($table['bgcolor'][-1]) ? $table['bgcolor'][-1] : 0));
             if ($fill) {
                 $color = Color::HEX2RGB($fill);
                 $this->SetFillColor($color[0], $color[1], $color[2]);
                 $this->Rect($x, $y, $w, $h, 'F');
             }
             //Content
             if (isset($c['img'])) {
                 $this->Image($c['img'], $x, $y, $c['w'], $c['h']);
             } else {
                 $this->_drawCellAligned($x, $y, $c);
             }
             //Border
             if (isset($c['border'])) {
                 $table['listborder'][] = array($x, $y, $w, $h, $c['border']);
             } elseif (isset($table['border']) && $table['border']) {
                 $table['listborder'][] = array($x, $y, $w, $h, $table['border']);
             }
         }
     }
     $table['lasty'] += $table['hr'][$i];
     $this->y = $table['lasty'];
 }
开发者ID:WisnuDiStefano,项目名称:sinar,代码行数:62,代码来源:pdftable.inc.php

示例3: _tableWriteRow

 function _tableWriteRow(&$table, $i, $x0)
 {
     $maxh = 0;
     for ($j = 0; $j < $table['nc']; $j++) {
         $h = $this->_tableGetHCell($table, $i, $j);
         if ($maxh < $h) {
             $maxh = $h;
         }
     }
     if ($table['lasty'] + $maxh > $this->bottom && $table['multipage']) {
         if ($maxh + $table['repeatH'] > $this->height) {
             $msg = 'Height of this row is greater than page height!';
             $h = $this->countLine(0, $msg) * $this->getLineHeight();
             $this->SetFillColor(255, 0, 0);
             $this->Rect($this->x, $this->y = $table['lasty'], $table['w'], $h, 'F');
             $this->MultiCell($table['w'], $this->getLineHeight(), $msg);
             $table['lasty'] += $h;
             return;
         }
         $this->_tableDrawBorder($table);
         $this->AddPage($this->CurOrientation);
         $table['lasty'] = $this->y;
         if ($table['repeat']) {
             foreach ($table['repeat'] as $_z => $r) {
                 if ($r == $i) {
                     continue;
                 }
                 $this->_tableWriteRow($table, $r, $x0);
             }
         }
     }
     $y = $table['lasty'];
     for ($j = 0; $j < $table['nc']; $j++) {
         if (isset($table['cells'][$i][$j]) && $table['cells'][$i][$j]) {
             $c =& $table['cells'][$i][$j];
             list($x, $w) = $this->_tableGetWCell($table, $i, $j);
             $h = $this->_tableGetHCell($table, $i, $j);
             $x += $x0;
             //Align
             $this->x = $x;
             $this->y = $y;
             $align = isset($c['a']) ? $c['a'] : 'L';
             //Vertical align
             $verticalAlign = !isset($c['va']) ? 'T' : $c['va'];
             $verticalAlign = strpos('TMB', $verticalAlign) === false ? 'T' : $verticalAlign;
             if ($verticalAlign == 'M') {
                 $this->y += $c['mih'] > $c['ch'] ? ($h - $c['ch']) / 2 : ($h - $c['mih']) / 2;
             } elseif ($verticalAlign == 'B') {
                 $this->y += $c['mih'] > $c['ch'] ? $h - $c['ch'] : $h - $c['mih'];
             }
             //Fill
             $fill = isset($c['bgcolor']) ? $c['bgcolor'] : (isset($table['bgcolor'][$i]) ? $table['bgcolor'][$i] : (isset($table['bgcolor'][-1]) ? $table['bgcolor'][-1] : 0));
             if ($fill) {
                 $color = Color::HEX2RGB($fill);
                 $this->SetFillColor($color[0], $color[1], $color[2]);
                 $this->Rect($x, $y, $w, $h, 'F');
             }
             //Content
             $f = $this->_setFontText($c);
             if (isset($c['color'])) {
                 $color = Color::HEX2RGB($c['color']);
                 $this->SetTextColor($color[0], $color[1], $color[2]);
             } else {
                 unset($color);
             }
             $this->MultiCell($w, $this->getLineHeight($f), implode("\n", $c['text']), 0, $align);
             if (isset($color)) {
                 $this->SetTextColor(0);
             }
             //Border
             if (isset($c['border'])) {
                 $table['listborder'][] = array($x, $y, $w, $h, $c['border']);
             } elseif (isset($table['border']) && $table['border']) {
                 $table['listborder'][] = array($x, $y, $w, $h, $table['border']);
             }
         }
     }
     $table['lasty'] += $table['hr'][$i];
     $this->y = $table['lasty'];
 }
开发者ID:rosyid33,项目名称:sppam,代码行数:80,代码来源:pdftable.inc.php


注:本文中的Color::HEX2RGB方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。