PHP Classes

File: example-07.php

Recommend this page to a friend!
  Classes of Krzysztof Kardasz   Nweb Image   example-07.php   Download  
File: example-07.php
Role: Example script
Content type: text/plain
Description: Example
Class: Nweb Image
Perform several image manipulation operations
Author: By
Last change:
Date: 17 years ago
Size: 1,223 bytes
 

Contents

Class file image Download
<?php
/**
 * Nweb Extension Script
 *
 * Example
 *
 * @category Nweb
 * @package Nweb_Scripts
 * @author Krzysztof Kardasz
 * @copyright Copyright (c) euo.pl
 */


   
include 'lib/Image.php';
    include
'lib/ImageException.php';
try {

   
$obj = new Image('photos/image-02.jpg');
   
$obj->open();

   
/**
     * Spis dostepnych pozycji:
     *
     * Względem wysokości:
     * Image::TOP
     * Image::MIDDLE
     * Image::BOTTOM
     *
     * Względem szerokości:
     * Image::LEFT
     * Image::CENTER
     * Image::RIGHT
     *
     * Wycentrowanie:
     * Image::CENTERED
     *
     * Można łączyć (wysokość + szerokość) np:
     * Image::TOP + Image::RIGHT
     * Image::BOTTOM + Image::CENTER
     */

    # Zmiana rozmiaru obszaru roboczego
    # ResizeCanvas ($Width, $Height, $Place = Image::CENTERED, $Background = '#fff', $FixedX = null, $FixedY = null)
   
$obj->ResizeCanvas (1024, 760, Image::CENTERED , '#FF0000');

   
# Wyświetlenie zdjęcia
   
$obj->Display();

   
# Wyczyszczenie pamięci przydzielonej dla zdjęcia
   
$obj->ImageClear();

}
catch (
ImageException $e)
{
    echo
$e->Message();
}
?>