Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Diego Feitosa  >  Pic2X  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Instructions
Class: Pic2X
Convert images to the XPM format
Author: By
Last change: Note Added
Date: 8 years ago
Size: 613 bytes
 

Contents

Class file image Download
<?php

// See guitar.php for another usage

require_once("pic2x.inc");

// Using a GD resource
$gd imagecreate(50,50);
imagecolorallocate($gd0,0,0);

$img = new Pic2X($gd);
echo 
$img->convert(); // return a string with the image to use
$img->save('name.xpm'); // or save into a file - return false if file exists

/*=================================================================================*/

// Using a file
$img = new Pic2X('php.gif');
echo 
$img->convert(); // return a string with the image to use
$img->save('php.xpm'); // or save into a file - return false if file exists
?>