Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 96dc6df78b97fbd98de793edb6fcd7a4 > files > 9

php-pear-Image_Tools-0.4.2-4mdv2010.0.noarch.rpm

<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker */
// CVS: $Id: mask.php,v 1.1 2005/10/02 17:53:00 firman Exp $

/**
 * Load Image_Tools.
 */
require_once 'Image/Tools.php';

// Sets mask and sample image.
$options = array(
    'image'     => 'images/master.png',
    'mask'      => 'images/mask.png',
    'sample'    => 'images/pear.png'
);

// Create new instance of Image_Mask
$toolMask =& Image_Tools::factory('mask', $options);
if (PEAR::isError($toolMask)) {
    die($toolMask->toString());
}

// Apply mask and send the result image to browser
$err = $toolMask->display();
if (PEAR::isError($err)) {
    die($err->toString());
}

/*
 * Local variables:
 * mode: php
 * tab-width: 4
 * c-basic-offset: 4
 * c-hanging-comment-ender-p: nil
 * End:
 */
?>