Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/matt/src/cvs/imlib/docs/class.ImlibPoly.php
PHP Imlib2 Classes - Imlib

ImlibPoly

ImlibColor
   |
  +-- ImlibCliprect
     |
    +-- ImlibPoly

Does everything relevant to creating and drawing or filling an n-point polygon

 

public class ImlibPoly extends ImlibCliprect

Does everything relevant to creating and drawing or filling an n-point polygon
The routine for getting a polygon onto an image is generally to create one,add all its points (The order in which the points are added determines howthe polygon will be drawn), set the image to draw on, and draw.

AuthorsMatt McClanahan <cardinal@dodds.net>
Version0.3

 

Methods inherited from ImlibCliprect

imlibcliprect, get_cliprect, get_cliprect_array, get_cliprect_inuse, set_cliprect, set_cliprect_array, set_cliprect_inuse

Methods inherited from ImlibColor

imlibcolor, get_color, get_color_array, set_color, set_color_array

Public Method Summary

void

ImlibPoly()

ImlibPoly constructor
bool

add_point(int $x, int $y)

Add a point to the current polygon
bool

contains_point(int $x, int $y)

Checks if the current polygon contains a given point
bool

draw([ integer $closed ])

Draw the current polygon on the current image
bool

fill()

Fill the current polygon on the current image
bool

free()

Free the current polygon
bool

get_bounds(int &$x1, int &$y1, int &$x2, int &$y2)

Get the bounds of the polygon
int

get_image()

Get the current image resource id#
int

new_poly()

Create a new polygon
void

set_image(int $im)

Set the image resource id# to draw on

Fields inherited from ImlibCliprect

$cliprect, $cliprect_inuse

Fields inherited from ImlibColor

$color

Private Field Summary

unknown

$im

Resource id# of the image to draw on
unknown

$poly

The resource id# of the current polygon

Public Method Details

ImlibPoly

public void ImlibPoly( )

  ImlibPoly constructor

Returns void


add_point

public bool add_point( int $x, int $y )

  Add a point to the current polygon

Parameter
int $x
coordinate
int $y
coordinate
Returns bool

False if there is no polygon set


contains_point

public bool contains_point( int $x, int $y )

  Checks if the current polygon contains a given point

Parameter
int $x
coordinate
int $y
coordinate
Returns bool

True if it does, false otherwise


draw

public bool draw( [ integer $closed ] )

  Draw the current polygon on the current image

Parameter
integer $closed = >>1<<
true, the polygon will be drawn with the endpoints connected
Returns bool

False if there is no polygon or image set


fill

public bool fill( )

  Fill the current polygon on the current image

Returns bool

False if there is no polygon or image set


free

public bool free( )

  Free the current polygon

Returns bool

False if there is no polygon or image set


get_bounds

public bool get_bounds( int &$x1, int &$y1, int &$x2, int &$y2 )

  Get the bounds of the polygon

Parameter
int &$x1
left X coordinate
int &$y1
left Y coordinate
int &$x2
right X coordinate
int &$y2
right Y coordinate
Returns bool

False if there is no polygon or image set


get_image

public int get_image( )

  Get the current image resource id#

Returns int

Current image resource id#


new_poly

public int new_poly( )

  Create a new polygon

Returns int

Resource id# of the new polygon


set_image

public void set_image( int $im )

  Set the image resource id# to draw on

Parameter
int $im
resource id#
Returns void


Private Field Details

$im

private unknown $im

>><<

Resource id# of the image to draw on


$poly

private unknown $poly

>><<

The resource id# of the current polygon



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta