YANA 4 PHP Framework
Docs For Class Brush
Brush wrapper class
This class is meant as an add-on to the framework's Image class. It is intended to handle predefined brushes in PNG format, which reside in the directory "common_files/brush/*.png" to ease work with images.
Brush images need to be 2-colored black/white images with color index 0 being black and index 1 being the transparent color and width == height.
Located in /includes/class_image_brush.php
Object | --Brush
Name | Type | Description |
---|---|---|
$brushname | string | see list |
The argument $brushname determines wich brush to take the input from. If $brushname is not provided, a 1px square is used.
The brush name can be any name of an existing PNG image (without the file extension), that must reside in the "common_files/brush/*.png" directory.
Here are some examples:
Creates a copy of this object. You are encouraged to reimplement this for each subclass.
Redefinition of: Object::cloneObject()
Name | Type | Description |
---|---|---|
$anotherObject | object | any var to compare this object with |
Returns bool(true) if this object and $anotherObject are the booth object which have an image resource that is the same, or $anotherObject is an image resource and identical to the one of this object.
Returns bool(false) otherwise.
Redefinition of: Object::equals()
Returns an associative array of the red, green and blue values of the current brush color. Returns bool(false) on error.
Returns bool(false) on error.
Returns the brush's dimension in pixel or bool(false) on error.
Name | Type | Description |
---|---|---|
$r | int | red value |
$g | int | green value |
$b | int | blue value |
This function sets the color of the brush to a certain value, where the input is the red, green and blue values of this color.
The arguments $r, $g and $b need to be integer values between 0 and 255. For example, $r = 0 is interpreted as "0% red" and $r = 255 is interpreted as "100% red".
Name | Type | Description |
---|---|---|
$size | int | brush size in pixel |
This resizes the brush.
The argument $size is the new size in pixel.
Returns bool(false) on error.
Name | Type | Description |
---|---|---|
$directory | string | new source directory |
This function will set the source directory for brushes. The next time you create a Brush object, the png image will automatically be searched for in the directory you provided here.
Returns bool(true) on success and bool(false) on error.
}
This function is intended to be called when the object is used in a string context.
Redefinition of: Object::toString()
Inherited From Object
Documentation generated on Sun, 11 Mar 2007 15:02:36 +0100 by phpDocumentor 1.3.1