<<

. 109
( 132 .)



>>

imagefilledellipse(resource
im, int cx, int cy, int w,
int h, int color)

int Draws a filled partial ellipse
imagefilledarc(int im, int cx,
int cy, int w, int h, int s,
int e, int col, int style)

void Turns alpha-blending mode
imagealphablending(resource
on or off for the given image
im, bool on)

int Resolves/allocates a color
imagecolorresolvealpha(resource
with an alpha level. Works
im, int red, int green, int
for true-color and palette-
blue, int alpha)
based images
int Finds the closest matching
imagecolorclosestalpha(resource
color with alpha
im, int red, int green, int
transparency
blue, int alpha)
Appendix F: PHP Function Reference 645



Function Return Value Action

int Finds an exact match for the
imagecolorexactalpha(resource
color with transparency
im, int red, int green, int
blue, int alpha)

int Copies and resizes part of an
imagecopyresampled(int dst_im,
image using resampling to
int src_im, int dst_x, int
help ensure clarity
dst_y, int src_x, int src_y,
int dst_w, int dst_h, int
src_w, int src_h)

int Sets the tile image to $tile
imagesettile(resource image,
when filling $image with
resource tile)
the IMG_COLOR_TILED
color
int Sets the brush image to
imagesetbrush(resource image,
$brush when filling
resource brush)
$image with the
IMG_COLOR_BRUSHED color

int Creates a new image
imagecreate(int x_size,
int y_size)

int Returns the types of images
imagetypes(void)
supported in a bitfield ” 1 =
GIF, 2 = JPEG, 4 = PNG,
8 = WBMP, 16 = XPM

int Creates a new image from
imagecreatefromstring(string
the image stream in the
image)
string
int Creates a new image from a
imagecreatefromgif(string
GIF file or URL
filename)

int Creates a new image from a
imagecreatefromjpeg(string
JPEG file or URL
filename)

int Creates a new image from a
imagecreatefrompng(string
PNG file or URL
filename)

int Creates a new image from
imagecreatefromxbm(string
an XBM file or URL
filename)

Continued
646 Part V: Appendixes


TABLE F-26 GD FUNCTIONS (Continued)

Function Return Value Action

int Creates a new image from
imagecreatefromxpm(string
an XPM file or URL
filename)

int Creates a new image from a
imagecreatefromwbmp(string
WBMP file or URL
filename)

int Creates a new image from a
imagecreatefromgd(string
GD file or URL
filename)

int Creates a new image from a
imagecreatefromgd2(string
GD2 file or URL
filename)

int Creates a new image from a
imagecreatefromgd2part(string
given part of a GD2 file or
filename, int srcX, int srcY,
URL
int width, int height)

int Outputs a GIF image to a
imagegif(int im [, string
browser or file
filename])

int Outputs a PNG image to a
imagepng(int im [, string
browser or file
filename])

int Outputs a JPEG image to a
imagejpeg(int im [, string
browser or file
filename [, int quality]])

int Outputs a WBMP image to a
imagewbmp(int im [, string
browser or file
filename, [, int foreground]])

int Outputs a GD image to a
imagegd(int im [, string
browser or file
filename])

int Outputs a GD2 image to a
imagegd2(int im [, string
browser or file
filename])

int Destroys an image
imagedestroy(int im)

int Allocates a color for an
imagecolorallocate(int im,
image
int red, int green, int blue)

int Copies the palette from the
imagepalettecopy(int dst,
src image onto the dst
int src)
image
int Gets the index of the color
imagecolorat(int im, int x,
of a pixel
int y)
Appendix F: PHP Function Reference 647



Function Return Value Action

int Gets the index of the closest
imagecolorclosest(int im, int
color to the specified color
red, int green, int blue)

int Gets the index of the color
imagecolorclosesthwb(int im,
that has the hue, white, and
int red, int green, int blue)
blackness nearest to those of
the given color
int De-allocates a color for an
imagecolordeallocate(int im,
image
int index)

int Gets the index of the
imagecolorresolve(int im, int
specified color or its closest
red, int green, int blue)
possible alternative
int Gets the index of the
imagecolorexact(int im, int red,
specified color
int green, int blue)

int Sets the color for the
imagecolorset(int im, int col,
specified palette index
int red, int green, int blue)

array Gets the colors for an index
imagecolorsforindex(int im,
int col)

int Applies gamma correction to
imagegammacorrect(int im,
a GD image
float inputgamma, float
outputgamma)

int Sets a single pixel
imagesetpixel(int im, int x,
int y, int col)

int Draws a line
imageline(int im, int x1, int
y1, int x2, int y2, int col)

int Draws a dashed line
imagedashedline(int im, int x1,
int y1, int x2, int y2, int col)

int Draws a rectangle
imagerectangle(int im, int x1,
int y1, int x2, int y2,
int col)

int Draws a filled rectangle
imagefilledrectangle(int im,
int x1, int y1, int x2, int y2,
int col)

Continued
648 Part V: Appendixes


TABLE F-26 GD FUNCTIONS (Continued)

Function Return Value Action

int Draws a partial ellipse
imagearc(int im, int cx, int
cy, int w, int h, int s, int
e, int col)

int Flood fills the image to the
imagefilltoborder(int im, int x,
specific color
int y, int border, int col)

int Flood fills the image
imagefill(int im, int x, int y,
int col)

int Finds out the number of

<<

. 109
( 132 .)



>>