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 Andrey Nikishaev  >  Draw Blocks  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: Draw Blocks
Generate an image with mapped colored squares
Author: By
Last change: new version
Date: 2008-11-20 03:58
Size: 445 bytes
 

Contents

Class file image Download
<?php
include('blocks.php')

$str2='
*******
*+++***
****+**
***+***
****+**
*+++***
*******
'
;
$str1='
********
**+***+*
***+*+**
****+***
***+*+**
**+***+*
********
'
;
$colors=array(
                
"0"=>"000000",  //background. To set background use only "0"
        
"."=>"ccffff",
        
"*"=>"666666",
        
"+"=>"cccccc"
        
);


$a=new blocks(5,2,5,$colors);
$a->addMatrix($str1);
$a->addMatrix($str2);
$a->render('jpg');