PHP Classes

File: example1.php

Recommend this page to a friend!
  Classes of Miguel   pixpic   example1.php   Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: basic example
Class: pixpic
Render images in the browser using color DIV tags
Author: By
Last change: update this script
Date: 8 years ago
Size: 663 bytes
 

Contents

Class file image Download
<style>
    .imgPixpic{display:block;margin-bottom:20px;}
</style>
<?php

include "pixpic.class.php";
$px=new Pixpic();
$img="./elephpant.png";
//Set the image
$px->setImage($img);
//set property zoom =1 original size span=1 not separated
$px->zoom=1;
$px->span=1;
$pro=$px->getProperty();
if(!
$px->error()){
    echo
$px->image2div();
    echo
$px->image2siluet("000000");
    echo
$px->image2alpha("000000");
    echo
"<p>Attributes Image:</p>";
    echo
"<p>Width:".$pro[0]."</p>";
    echo
"<p>Height:".$pro[1]."</p>";
    echo
"<p>Bits:".$pro["bits"]."</p>";
    echo
"<p>Type:".$pro["mime"]."</p>";
}else{
    echo
$px->error();
}


?>