PHP Classes

File: example.php

Recommend this page to a friend!
  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: 15 years ago
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');