1. Trang chủ
  2. » Công Nghệ Thông Tin

PHP Developer''''s Dictionary- P110 ppsx

5 154 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 5
Dung lượng 361,27 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Description The imagecolorallocate function returns the color identifier for the passed red , green , and blue RGB parameters.. imagecolordeallocate Syntax int imagecolordeallocateint

Trang 1

Description

The imagecolorallocate() function returns the color identifier for the passed red ,

green , and blue (RGB) parameters The image is the return value of the

imagecreate() function

imagecolordeallocate()

Syntax

int imagecolordeallocate(int image, int variable)

Description

The imagecolordeallocate() function, which was added in PHP 3.0.6, deallocates a color in image that was previously defined in variable by calling the

imagecolorallocate() function

imagecolorat()

Syntax

int imagecolorat(int image, int x, int y)

Description

The imagecolorat() function returns the index number of the color located at x and

y

imagecolorclosest()

Syntax

int imagecolorclosest(int image, int red, int green, int blue)

Description

The imagecolorclosest() function returns the index number of the color closest to

Trang 2

Syntax

int imagecolorexact(int image, int red, int green, int blue)

Description

The imagecolorexact() function returns the index number of the color specified by the passed red , green , and blue (RGB) values If there is no color at that location,

–1 is returned

imagecolorresolve()

Syntax

int imagecolorresolve(int image, int red, int green, int blue)

Description

The imagecolorresolve() function, which was added in PHP 3.0.2, returns the index number of the color specified by the passed red , green , and blue (RGB)

values, or the color closest to that value

imagegammacorrect()

Syntax

int imagegammacorrect(int image, double input_gamma, double

output_gamma)

Description

The imagegammacorrect() function, which was added in PHP 3.0.13, applies the gamma correction to the image based on the input_gamma and output_gamma

imagecolorset()

Syntax

Trang 3

boolean imagecolorset(int image, int index, int red, int green, int blue)

Description

The imagecolorset() function sets the color located at the index number passed to

the specified red , green , and blue (RGB) values for the image

imagecolorsforindex()

Syntax

array imagecolorsforindex(int image, int index)

Description

The imagecolorsforindex() function returns an associative array ("key" with an associated value) where the keys are red, green, and blue, and the values are their respective values at the index position in the image

imagecolorstotal()

Syntax

int imagecolorstotal(int image)

Description

The imagecolorstotal() function returns the total number of colors in the palette of the image passed

imagecolortransparent()

Syntax

int imagecolortransparent(int image [, int color])

Trang 4

The imagecolortransparent() function defines the color passed as transparent in

the image

imagecopy()

Syntax

int imagecopy(int destination_image, int source_image, int

destination_x,

int destination_y, int source_x, int source_y, int source_width, int source_height)

Description

The imagecopy() function, which was added in PHP 3.0.6, copies the part of the

source_image , starting at the source_x and source_y point and constrained by the

source_width and source_height to the destination_image The copied portion is

placed on this image, starting at the destination_x and destination_y location

imagecopyresized()

Syntax

int imagecopyresized(int destination_image, int source_image,

int destination_x, int destination_y int source_x, int source_y, int destination_width, int destination_height, int source_width, int source_height)

Description

The imagecopyresized() function copies the part of the source_image , starting at

the source_x and source_y point and constrained by the source_width and

source_height to the destination_image The copied portion is placed on this

image starting at the destination_x and destination_y location, and stretched to

the destination_width and destination_height parameters

imagecreate()

Syntax

int imagecreate(int width, int height)

Trang 5

Description

The imagecreate() function returns a blank image identifier of the size defined by the width and height parameters

imagecreatefromgif()

Syntax

int imagecreatefromgif(string location)

Description

The imagecreatefromgif() function returns an image identifier for the GIF image at

location , which can be a filename or URL If the process fails, the function returns

an error message To avoid this, you can use the following type of code in which you create an image if the one you seek is not there:

$image = imagecreatefromgif("myimage.gif");

if(!$image){ // check for error

$image = imagecreate(1, 1); // create blank image

$background = imagecolorallocate($image, 0, 0, 0); // white

imagefill($image, 0, 0, $background); // create white image

}

return $image;

imagecreatefromjpeg()

Syntax

int imagecreatefromjpeg(string location)

Description

The imagecreatefromjpeg() function returns an image identifier for the JPEG image

at location , which can be a filename or URL If the process fails, the function

returns an error message To avoid this, you can use the following type of code in which you create an image if the one you seek is not there:

$image = imagecreatefromjpeg("myimage.jpg");

if(!$image){ // check for error

Ngày đăng: 07/07/2014, 05:20