Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: PDF_setrgbcolor - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net

search for in the

PDF_shading_pattern" width="11" height="7"/> <PDF_setrgbcolor_stroke
Last updated: Wed, 01 Nov 2006
view this page in

PDF_setrgbcolor

(PHP 3 >= 3.0.6, PHP 4, PECL)

PDF_setrgbcolor -- 描画および塗りつぶし RGB 色を設定する [古い関数]

説明

bool PDF_setrgbcolor ( resource p, float red, float green, float blue )

カレントの塗りつぶし色と輪郭色を指定した RGB 値に設定します。 成功した場合に TRUE を、失敗した場合に FALSE を返します。

この関数は PDFlib バージョン 4 で廃止されました。かわりに PDF_setcolor() を使用してください。



add a note add a note User Contributed Notes
PDF_setrgbcolor
n dot gaertner at gmx dot net
09-Jul-2001 09:19
<b>Use this code to convert HEX colors to RGB that you can use with pdf_setrgbcolor:</b>
<?
$color
= "#FF00FF";
$string = str_replace("#","",$color);
$red = hexdec(substr($string,0,2)) / 255;
$green = hexdec(substr($string,2,2)) / 255;
$blue = hexdec(substr($string,4,2)) / 255;
pdf_rect($pdf, 110, 600, 20, 30);
pdf_setrgbcolor_fill($pdf, $red, $green, $blue);
pdf_fill($pdf);
?>

This gives you a pink rectangle!
skuenzli at u dot arizona dot edu
27-Apr-2000 04:17
/*
*pdf_setrgbcolor(pdf_file, float red, float green, float blue);
*red/green/blue are values between 0 and 1.
*It appears that the value is supposed to be a percentage intensity.
*0.0 means a 0% intensity for that color (0 in RGB-scale)
*0.5 means a 50% intensity of that color (127 in RGB-scale)
*1.0 means a 100% intensity of that color (255 in RGB-scale)
*/
Here is a snippet of code to create a blue rectangle:
<pre>
//Create blue rectangle
pdf_rect($pdf, 110, 600, 20, 30);
pdf_setrgbcolor_fill($pdf, 0, 0, 1.0);
pdf_fill($pdf);
</pre>

 
show source | credits | sitemap | contact | advertising | mirror sites