apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: Image_XBM

Source Location: /Image_XBM-0.2.0/XBM.php

Class Overview




Methods


Inherited Variables

Inherited Methods


Class Details

[line 40]


[ Top ]


Method Detail

Image_XBM (Constructor)   [line 92]

Image_XBM Image_XBM( )

Constructor. Init all variables.
  • Access: public

[ Top ]

copy   [line 435]

bool copy( &$src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h, object $src_im)

Copy part of an image
  • Return: always true
  • Access: public

Parameters:

object   $src_im   —  destination Image_XBM object
int   $dst_x   —  starting x coordinate in the destination
int   $dst_y   —  starting y coordinate in the destination
int   $src_x   —  starting x coordinate in the source
int   $src_y   —  starting y coordinate in the source
int   $src_w   —  width of portion
int   $src_h   —  height of portion
   &$src_im   — 

[ Top ]

create   [line 114]

bool create( int $x_size, int $y_size)

Create a new image
  • Return: always true
  • Access: public

Parameters:

int   $x_size   —  image width
int   $y_size   —  image height

[ Top ]

createFromFile   [line 484]

mixed createFromFile( string $filename)

Create a new image from XBM file or URL
  • Return: PEAR_error or true for success
  • Access: public

Parameters:

string   $filename   —  XBM file name or URL

[ Top ]

destroy   [line 355]

bool destroy( )

Destroy an image
  • Return: always true
  • Access: public

[ Top ]

drawEllipse   [line 537]

bool drawEllipse( int $cx, int $cy, int $w, int $h, int $color)

Draw an ellipse
  • Return: always true
  • Access: public

Parameters:

int   $cx   —  center of ellipse (X coordinate)
int   $cy   —  center of ellipse (Y coordinate)
int   $w   —  width of ellipse
int   $h   —  height of ellipse
int   $color   —  color for drawing

[ Top ]

drawFigletText   [line 571]

mixed drawFigletText( string $text, string $font, mixed $size, int $fgcolor, int $bgcolor, int $x, int $y)

To draw a text string over an image using Figlet fonts
  • Return: PEAR_error or true for success
  • Access: public

Parameters:

string   $text   —  text for drawing
string   $font   —  font file name
mixed   $size   —  integer (font ratio) or string 'X:Y' (X size ratio and Y size ratio)
int   $fgcolor   —  foreground font color
int   $bgcolor   —  background font color
int   $x   —  start drawing from
int   $y   —  start drawing from

[ Top ]

drawFilledEllipse   [line 553]

bool drawFilledEllipse( int $cx, int $cy, int $w, int $h, int $color)

Draw a filled ellipse
  • Return: always true
  • Access: public

Parameters:

int   $cx   —  center of ellipse (X coordinate)
int   $cy   —  center of ellipse (Y coordinate)
int   $w   —  width of ellipse
int   $h   —  height of ellipse
int   $color   —  color for drawing

[ Top ]

drawFilledRectangle   [line 313]

bool drawFilledRectangle( int $x1, int $y1, int $x2, int $y2, int $color)

Draw a filled rectangle
  • Return: always true
  • Access: public

Parameters:

int   $x1   —  left coordinate
int   $y1   —  top coordinate
int   $x2   —  right coordinate
int   $y2   —  bottom coordinate
int   $color   —  drawing color

[ Top ]

drawLine   [line 159]

bool drawLine( int $x1, int $y1, int $x2, int $y2, int $color)

Draw a line
  • Return: always true
  • Access: public

Parameters:

int   $x1   —  from X
int   $y1   —  from Y
int   $x2   —  to X
int   $y2   —  to Y
int   $color   —  line color

[ Top ]

drawPixel   [line 203]

bool drawPixel( int $x, int $y, int $color)

Draw a single pixel
  • Return: always true
  • Access: public

Parameters:

int   $x   —  X ordinate
int   $y   —  Y ordinate
int   $color   —  pixel color

[ Top ]

drawPolygon   [line 334]

bool drawPolygon( array $points, int $num_points, int $color)

Draw a polygon
  • Return: always true
  • Access: public

Parameters:

array   $points   —  is a PHP array containing the polygon's vertices
int   $num_points   —  is the total number of points (vertices).
int   $color   —  drawing color

[ Top ]

drawRectangle   [line 292]

bool drawRectangle( int $x1, int $y1, int $x2, int $y2, int $color)

Draw a rectangle
  • Return: always true
  • Access: public

Parameters:

int   $x1   —  left coordinate
int   $y1   —  top coordinate
int   $x2   —  right coordinate
int   $y2   —  bottom coordinate
int   $color   —  drawing color

[ Top ]

fill   [line 389]

bool fill( int $x, int $y, int $color)

Flood fill
  • Return: always true
  • Access: public

Parameters:

int   $x   —  starting coordinate
int   $y   —  starting coordinate
int   $color   —  color

[ Top ]

getColorAt   [line 233]

mixed getColorAt( int $x, int $y)

Get the index of the color of a pixel
  • Return: returns color of the pixel or null if pixel out of bounds
  • Access: public

Parameters:

int   $x   —  X ordinate
int   $y   —  Y ordinate

[ Top ]

getHeight   [line 143]

int getHeight( )

Get image height
  • Return: returns the height of the image
  • Access: public

[ Top ]

getWidth   [line 132]

int getWidth( )

Get image width
  • Return: returns the width of the image
  • Access: public

[ Top ]

output   [line 249]

bool output( [string $filename = false])

Output image to browser or file
  • Return: PEAR_Error or true
  • Access: public

Parameters:

string   $filename   —  (optional) filename for output

[ Top ]

setStyle   [line 370]

bool setStyle( array $style)

Sets the style to be used by all line drawing functions (such as imageline() and imagepolygon()) when drawing with the special color IMG_COLOR_STYLED
  • Return: always true
  • Access: public

Parameters:

array   $style   —  is an array of pixels.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:28:41 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.