PHP: PDF_setrgbcolor_fill - Manual

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

search for in the

PDF_setrgbcolor_stroke PDF_setpolydash

Last updated: Fri, 26 Jan 2007

view this page in

# PDF_setrgbcolor_fill

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

PDF_setrgbcolor_fill -- Set fill rgb color values [deprecated]

## Описание

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

Sets the current fill color to the supplied RGB values. Возвращает `TRUE` в случае успешного завершения или `FALSE` в случае возникновения ошибки.

This function is deprecated since PDFlib version 4, use PDF_setcolor() instead.

add a note User Contributed Notes
PDF_setrgbcolor_fill
philipp dot maske at location-bretagne dot de
12-Jun-2003 06:33
`It took some time to understand, that the float values have to be beetween beetween 0 and 1. If you use graphic tools like color-pickers etc. it is necessary to convert the RGB values frome the scale of 1 to 255 to 0 to 1.
Use this small function to make your life easier:
function pdf_setrgbcolor_fill_better($intPdfObj, $intRed, $intGreen, $intBlue) {
if($intRed<=0||$intRed>255|| $intGreen<=0|| $intGreen>255|| $intBlue<=0|| $intBlue>255) return false;
$floatRed = $intRed/255;
$floatGreen = $intGreen/255;
$floatBlue = $intBlue/255;
return pdf_setrgbcolor_fill ($intPdfObj, $floatRed, $floatGreen, $floatBlue);
}
Have Fun!
Philipp
--
Mail: philipp.maske@location-bretagne.de
WWW: http://www.location-bretagne.de`
maske at chiquadrat dot de
01-Nov-2001 07:16
`the double values for each RGB color start at '0' and end at '1'. So use e.g. pdf_setrgbcolor_fill(int pdf_document,1,1,1) for white, pdf_setrgbcolor_fill(int pdf_document,0,0,0) for black or something in between for a mixed color.`
add a note
PDF_setrgbcolor_stroke PDF_setpolydash

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST