src/UI/Image.php
public function setResource( $resource )
	{
		if( !is_resource( $resource ) )
			throw new InvalidArgumentException( 'Must be a valid image resource' );
		if( $this->resource )
			imagedestroy( $this->resource );

		$this->resource	= $resource;
		$this->width	= imagesx( $resource );
		$this->height	= imagesy( $resource );

		if( function_exists( 'imageantialias' ) )
			imageantialias( $this->resource, TRUE );

		imagealphablending( $this->resource, FALSE );											//  disable alpha blending in favour to
		imagesavealpha( $this->resource, TRUE );											//  copying the complete alpha channel
	}
public function setResource( $resource )
	{
		if( !is_resource( $resource ) )
			throw new InvalidArgumentException( 'Must be a valid image resource' );
		if( $this->resource )
			imagedestroy( $this->resource );

		$this->resource	= $resource;
		$this->width	= imagesx( $resource );
		$this->height	= imagesy( $resource );

		if( function_exists( 'imageantialias' ) )
			imageantialias( $this->resource, TRUE );

		imagealphablending( $this->resource, FALSE );											//  disable alpha blending in favour to
		imagesavealpha( $this->resource, TRUE );											//  copying the complete alpha channel
	}
public function setResource ( $ resource ) { if ( ! is_resource ( $ resource ) ) throw new InvalidArgumentException ( 'Must be a valid image resource' ) ; if ( $ this -> resource ) imagedestroy ( $ this -> resource ) ; $ this -> resource = $ resource ; $ this -> width = imagesx ( $ resource ) ; $ this -> height = imagesy ( $ resource ) ; if ( function_exists ( 'imageantialias' ) ) imageantialias ( $ this -> resource , TRUE ) ; imagealphablending ( $ this -> resource , FALSE ) ; //  disable alpha blending in favour to imagesavealpha ( $ this -> resource , TRUE ) ; //  copying the complete alpha channel }
Binds image resource to this image object.
@access		public
@param		resource	$resource		Image resource
@return		void
Binds image resource to this image object .