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


PHP ImageColorResolve函数代码示例

本文整理汇总了PHP中ImageColorResolve函数的典型用法代码示例。如果您正苦于以下问题:PHP ImageColorResolve函数的具体用法?PHP ImageColorResolve怎么用?PHP ImageColorResolve使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: callback

 function callback($img, $arg)
 {
     #fwrite(STDERR, "callback in object: arg=" . print_r($arg, True) . "\nimg=" . print_r($img, True) . "\n");
     # fwrite(STDERR, print_r($this, True));
     #fwrite(STDERR, "Plot area: ({$this->plot_area[0]}, {$this->plot_area[1]}) :");
     #fwrite(STDERR, " ({$this->plot_area[2]}, {$this->plot_area[2]})\n");
     # Draw an X across the plot area.
     $red = ImageColorResolve($img, 255, 0, 0);
     ImageLine($img, $this->plot_area[0], $this->plot_area[1], $this->plot_area[2], $this->plot_area[3], $red);
     ImageLine($img, $this->plot_area[0], $this->plot_area[3], $this->plot_area[2], $this->plot_area[1], $red);
 }
开发者ID:myfarms,项目名称:PHPlot,代码行数:11,代码来源:callback2.php

示例2: SetIndexDarkColor

 function SetIndexDarkColor($which_color)
 {
     list($r, $g, $b) = $this->SetRGBColor($which_color);
     $r = max(0, $r - 0x30);
     $g = max(0, $g - 0x30);
     $b = max(0, $b - 0x30);
     return ImageColorResolve($this->img, $r, $g, $b);
 }
开发者ID:ViniciusFelix,项目名称:ProjetoPadrao,代码行数:8,代码来源:phplot.php

示例3: PrintError

 function PrintError($error_message)
 {
     // Be sure not to loop recursively, e.g. PrintError - PrintImage - PrintError.
     if (isset($this->in_error)) {
         return FALSE;
     }
     $this->in_error = TRUE;
     // Output an image containing the error message:
     if (!empty($this->img)) {
         $ypos = $this->image_height / 2;
         $xpos = $this->image_width / 2;
         $bgcolor = ImageColorResolve($this->img, 255, 255, 255);
         $fgcolor = ImageColorResolve($this->img, 0, 0, 0);
         ImageFilledRectangle($this->img, 0, 0, $this->image_width, $this->image_height, $bgcolor);
         // Switch to built-in fonts, in case of error with TrueType fonts:
         $this->SetUseTTF(FALSE);
         $this->DrawText($this->fonts['generic'], 0, $xpos, $ypos, $fgcolor, wordwrap($error_message), 'center', 'center');
         $this->PrintImage();
     } elseif (!$this->is_inline) {
         Header('HTTP/1.0 500 Internal Server Error');
     }
     trigger_error($error_message, E_USER_ERROR);
     unset($this->in_error);
     return FALSE;
     # In case error handler returns, rather than doing exit().
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:26,代码来源:phplot.php

示例4: SetIndexDarkColor

 function SetIndexDarkColor($which_color)
 {
     list($r, $g, $b) = $this->SetRGBColor($which_color);
     $r -= 0x30;
     $r = $r < 0 ? 0 : $r;
     $g -= 0x30;
     $g = $g < 0 ? 0 : $g;
     $b -= 0x30;
     $b = $b < 0 ? 0 : $b;
     $index = ImageColorExact($this->img, $r, $g, $b);
     if ($index == -1) {
         return ImageColorResolve($this->img, $r, $g, $b);
     } else {
         return $index;
     }
 }
开发者ID:eruedin,项目名称:cats,代码行数:16,代码来源:phplot.php

示例5: SetIndexColor

 function SetIndexColor($which_color)
 {
     //Color is passed in as anything
     list($r, $g, $b) = $this->SetRgbColor($which_color);
     //Translate to RGB
     $index = ImageColorExact($this->img, $r, $g, $b);
     if ($index == -1) {
         //return ImageColorAllocate($this->img, $r, $g, $b);
         //return ImageColorClosest($this->img, $r, $g, $b);
         return ImageColorResolve($this->img, $r, $g, $b);
         //requires PHP 3.0.2 and later
     } else {
         return $index;
     }
 }
开发者ID:othreed,项目名称:osCommerce-234-bootstrap-wADDONS,代码行数:15,代码来源:phplot.php


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