PHP code example of bjorvack / image-stacker

1. Go to this page and download the library: Download bjorvack/image-stacker library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bjorvack / image-stacker example snippets


$stacker = new Stacker('name');
$stacker = new Stacker('name', <int maxWidth>, <int maxWidth>, <bool growVertical>, <bool growHorizontal>);

$image = new Image('path', 'name', <int width>, <int height>);
$stacker->addImage($image);

$image = Image::createFromStacker($stacker, 'storagepath');

foreach($stacker->getImages() as $image) {
    $image->getY();
    $image->getX();
}

$stacker = new Stacker('name');

JsonExporter::save($stacker, 'path');
StylesheetExporter::save($stacker, 'path');