PHP Classes

File: example/horse.php

Recommend this page to a friend!
  Classes of Patrick Van Bergen   Move Me GIF   example/horse.php   Download  
File: example/horse.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Move Me GIF
Create animated GIF images in pure PHP
Author: By
Last change: Use first-frame dimensions when not specified in GifBuilder constructor.
Use imagegif to create compressed pixel data if possible, which is much faster.
Date: 6 years ago
Size: 725 bytes


Class file image Download
 * A simple animation created from with 8 png images.
 * The horse images were taken from this Wikipedia page

use movemegif\domain\FileImageCanvas;

// just for debugging
ini_set('display_errors', 1);

// include movemegif's namespace
require_once __DIR__ . '/../php/autoloader.php';

// no width and height specified: they will be taken from the first frame
$builder = new GifBuilder();

for (
$i = 1; $i <= 8; $i++) {

setCanvas(new FileImageCanvas(__DIR__ . '/horse/' . $i . '.png'))