Php Graphics-image Examples Draw Filled Arc Drawing a Circle Drawing a Circle with imagearc() Paint string value with different colors and position Draw char with color Draw string and fill rectangle Using a Bounding Box to Center Text Drawing a Square and a string Draw Filled Ellipse Draw ellipse Filled ellipse Set font Create Color for paint ColorWriting a String with imageTTFtext() A Dynamically Created Image Use specified font Set Font size Image copy Using imagearc() to Draw Spirals A simple image using a single color (red) Allocate image color Creating and Using Colors Using imagecolorallocatealpha Color-retrieval functions could be combined into a custom function Adding Transparency Making Colors Transparent with imagecolortransparent() Using Brushes Using the imagecopymerge() Function Using the imagecopyresized() Function GIF creation with PHP Creating an Image from an Existing Image Saving and Outputting the Modified Image Color and Image Fills Create image object from PNG Loading Existing Images Scaling and Rotating Using imagedeallocate() Using the imageellipse() and imagearc() Functions Using imagefill() Creating a Pie Graph Using imagefilledarc() Using imagefilledarc() Ellipses and circles Create a larger image, recreate that brush, and use it as the outline for a shape. More Shapes Complex Shapes Drawing a Polygon with imagefilledpolygon() Changing colors with a loop Drawing a Filled Rectangle with imagefilledrectangle() Creating and Applying Different Shapes and Patterns Draw a rectangle Using imagefill() and imagefilltoborder() Special Effects Using imagefilter( )IMG_FILTER_COLORIZE IMG_FILTER_CONTRAST IMG_FILTER_EDGEDETECT and IMG_FILTER_EMBOSS filters IMG_FILTER_GAUSSIAN_BLUR and IMG_FILTER_SELECTIVE_BLUR IMG_FILTER_GRAYSCALE and IMG_FILTER_NEGATE smooths the picture just a little Working with GIFs Interlacing an Image Basic image script Loading an Existing Image Working with JPGs Drawing a Line with imageline() Include color information Working with PNGs Drawing Polygons Using imagepolygon() Drawing a Button Image Using imagesetstyle() and imagesetbrush() Together Using the imagesetbrush() Function Points and Lines Using the imagesetstyle() Function Using imagesettile() Using the imagestring() Function Applying TrueType Fonts to an Image The eight elements in the array returned by imagettfbox( ) Using the imagettfbbox() Function Using the imagettftext() Function Draw with form data Outputting Text Test whether JPEGs are supported Getting an Image's MIME Type Load jpg image file Paint on a jpg image file Drawing Lines Fill Rectangle Round rectangle Demo Aligning Text Within a Fixed Space Using imageTTFbbox() Drawing a Triangler Use TrueType Fonts The TrueType Font Bounding Box Water mark Effect

Php Code : Draw A Rectangle

Draw a rectangle in php

 
<?php
    $image = imagecreate(400,300);
    $white = imagecolorallocate($image, 255, 255, 255);
    imagefilledrectangle($image, 10, 10, 390, 290, $white);
?>