Create PNG file : PNG : Language Basics PHP Source Code


PHP Source Code » Language Basics » PNG »

 

Create PNG file



<html>
<body>
<?php
    $img=ImageCreate(300,300);
    $bgcolor=ImageColorAllocate($img,200,200,200);
    $red=ImagecolorAllocate($img,255,0,0)
                                                            
    Imagerectangle($img,50,50,150,150,$red);
    Imagefilledrectangle($img,50,170,150,270,$red);
                                                            
    ImagePNG($img,"pic.png");
    ImageDestroy($img);
?>
<img src="pic.png" border=0>
</body>
</html>

           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Language Basics
» PNG