Location: PHPKode > scripts > Imaging > imaging-2/imaging2test.php
<?php


require_once('class.imaging2.php');
$filepath='./imaging2.png';
$imaging_o=new imaging;
$imaging_o->imageCreateTCObjFile($filepath,false);

if($_GET['action']=='html' or !isset($_GET['action']) ){

$imaging_o->imageCropyze( 40, 30,400,300,0,0,  0,0 );
 echo 'Resize , HTML<br />';
 echo $imaging_o->imageObjHTMLTABLE(9);

echo '<br />Image info<br /><pre>';
print_r( $imaging_o->imageObjInfo(true) );
echo '</pre>';
echo '<img src="?action=img&item=1" width="400" height="300" /><br />';
echo '<img src="?action=img&item=3" width="120" height="90" /><br />';
echo '<img src="?action=img&item=4" width="300" height="300" /><br />';
echo '<img src="?action=img&item=6" width="400" height="300" /><br />';
echo '<img src="?action=img&item=8" width="414" height="314" /><br />';
echo '<img src="?action=img&item=7" width="300" height="100" /><br />';

}
elseif($_GET['action']=='img'){
    $tx=20;$ty=20;
    if($_GET['item']==0){  }
    elseif($_GET['item']==1 ){

    						$imaging_o->gradient('FF00F0','99F00F',45,50,60,150,'h',0 );
                            $imaging_o->greyscale(65,50,  145,200,  255 );



							$imaging_o->gradient('FF00F0','99F00F',170,50,60,150,'h',0 );
                            $imaging_o->greyscale(200,50,  250,200,  32 );

							$imaging_o->colourize(45,170,250,300,'D3C17B',0.50);


                            $imaging_o->writeString('greyscale 255','FF0000','fff000',4,$tx,$ty,12,0);
                            $imaging_o->writeString('greyscale 16','FF0000','fff000',4,$tx+200,$ty,12,0);
                            $imaging_o->writeString('Colourize #D3C17B 0.50','FF0000','fff000',4,$tx+40,$ty+180,12,0);

                      }


    elseif($_GET['item']==3){       imageReized($filepath,true,120,90); }

    elseif($_GET['item']==4){ $imaging_o->imageCropyze( 180, 180,120,120,0,0,  100,100 );

                            $imaging_o->ImageRotate(90);
    						$imaging_o->writeString('rotate, resize','FF0000','fff000',4,$tx,$ty,12,0);
    						$imaging_o->ImageRotate(90);

                              $imaging_o->imageCropyze( 300, 300,180,180,0,0, 0, 0 );

    						  $imaging_o->writeString('crop, resize','FF0000','fff000',4,$tx,$ty,12,0);


    }
    elseif($_GET['item']==6){
    						// not image resized
    						$imaging_o->shadowAdd('838383','#FFFFFF',5,2,false);
                            $imaging_o->writeString('shadowAdd inside','FF0000','fff000',4,$tx,$ty,12,0);
    }
    elseif($_GET['item']==8){
							// now image size is 414 x 314
    						$imaging_o->shadowAdd('838383','#FFFFFF',8,3,true);
                            $imaging_o->writeString('shadowAdd outside','FF0000','fff000',4,$tx,$ty,12,0);

    }
    elseif($_GET['item']==7){
							$imaging_o = new imaging;
							$imaging_o->imageCreateTCObj(300,100);
							$bg = imagecolorallocate($imaging_o->imageObj, 50,50,200);
							ImageFill( $imaging_o->imageObj,0,0,$bg );

    						$imaging_o->gradient_vertical('000000','FFFFFF',0,0,50,50);
                            $imaging_o->gradient_horizontal('000000','FFFFFF',50,0,50,50);
                            $imaging_o->gradient_diagonal('000000','FFFFFF',100,0,50,50);
                            $imaging_o->gradient_r_diagonal('000000','FFFFFF',150,0,50,50);

                            $imaging_o->gradient_sphere('ffffff','rgb(50,50,200)',200,0,75,75);

                            $imaging_o->writeString('gradients','FF0000','fff000',4,$tx,$ty,12,0);

    } else {  }

    $imaging_o->outputto_bfo('png','bro','');

}


?>
Return current item: Imaging