PHP Classes

File: example-10.php

Recommend this page to a friend!
  Classes of Krzysztof Kardasz   Nweb Image   example-10.php   Download  
File: example-10.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,368 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_1 = new Image('photos/image-01.jpg');
   
$obj_1->open();

   
$obj_2 = new Image('photos/image-01.jpg');
   
$obj_2->open();
   
$obj_2->ResizeToWidth(200);

   
# Wpisanie tekstu w obrazek
    # Text (Image $Image = null, $text = null, $font, $Border = 1, $Background = '#000000', $FontColor = '#FFFFFF', $position = self::BOTTOM, $Space = 3, $Separator = ' ', $Size = 'KB')

    # Examples:
    // $obj->Text (null, 'ZDJECIE TESTOWE', 'terminal6.gdf');
    // $obj->Text (null, array(Image::Resolution, 'ZDJECIE TESTOWE'), 'terminal6.gdf');
    // $obj->Text (null, array(Image::Size, 'ZDJECIE TESTOWE'), 'terminal6.gdf');
    // $obj->Text (null, array('ZDJECIE TESTOWE', Image::Size . Image::Resolution), 'terminal6.gdf');
   
$obj_2->Text ($obj_1, array('KLIKNIJ ZEBY POWIEKSZYC', Image::Resolution . Image::Size), 'terminal6.gdf');

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

   
# Wyczyszczenie pamięci przydzielonej dla zdjęcia
   
$obj_1->ImageClear();
   
$obj_2->ImageClear();
}
catch (
ImageException $e)
{
    echo
$e->Message();
}

?>