public function partFromFile($file, Box $box)
    {
        $this->isValidFile($file);
        $this->assertGdFile($file);
        $x = $box->getX();
        $y = $box->getY();
        $width = $box->getWidth();
        $height = $box->getHeight();
        $result = @imagecreatefromgd2part($file, $x, $y, $width, $height);
        if (false == $result) {
            throw new CanvasCreationException(sprintf(
                    'Faild To Create The Part "%s" Of The Gd Canvas From The File "%s"'
                    , $file, (string) $box
            ));
        }
        $this->setHandler($result);

        return $this;
    }
public function partFromFile($file, Box $box)
    {
        $this->isValidFile($file);
        $this->assertGdFile($file);
        $x = $box->getX();
        $y = $box->getY();
        $width = $box->getWidth();
        $height = $box->getHeight();
        $result = @imagecreatefromgd2part($file, $x, $y, $width, $height);
        if (false == $result) {
            throw new CanvasCreationException(sprintf(
                    'Faild To Create The Part "%s" Of The Gd Canvas From The File "%s"'
                    , $file, (string) $box
            ));
        }
        $this->setHandler($result);

        return $this;
    }
public function partFromFile ( $ file , Box $ box ) { $ this -> isValidFile ( $ file ) ; $ this -> assertGdFile ( $ file ) ; $ x = $ box -> getX ( ) ; $ y = $ box -> getY ( ) ; $ width = $ box -> getWidth ( ) ; $ height = $ box -> getHeight ( ) ; $ result = @ imagecreatefromgd2part ( $ file , $ x , $ y , $ width , $ height ) ; if ( false == $ result ) { throw new CanvasCreationException ( sprintf ( 'Faild To Create The Part "%s" Of The Gd Canvas From The File "%s"' , $ file , ( string ) $ box ) ) ; } $ this -> setHandler ( $ result ) ; return $ this ; }
Load Part Of gd canvas from file

<b>Note :</b>
This method will not check if the coordinat is valid coordinate for the
resource and it won't check the Dimension either.

@param string      $file
@param \Jaguar\Box $box

@return \Jaguar\Format\Gd

@throws \InvalidArgumentException
@throws \Jaguar\Exception\CanvasCreationException
Load Part Of gd canvas from file