For this PHP GD is required on your server
$imageWidth=300; //width of your image $imageHeight=200;// height of your image $logoimg = imagecreatetruecolor($imageWidth, $imageHeight); //create Image //for transparent background imagealphablending($logoimg, false); imagesavealpha($logoimg, true); $col=imagecolorallocatealpha($logoimg,255,255,255,127); imagefill($logoimg, 0, 0, $col); //for transparent background $white = imagecolorallocate($logoimg, 255, 255, 255); //for font color $font = "advanced_pixel_lcd-7.ttf"; //font path $text="Your Text..."; //your text which you want to show in image $fontsize=20; // size of your font $x=100; // x- position of your text $y=100; // y- position of your text $angle=0; //angle of your text imagettftext($logoimg, $fontsize,$angle , $x, $y, $white, $font, $text); //fill text in your image $target="temp.png"; //path of target where you want to save image imagepng($logoimg,$target); //save your image at new location $target
Be the first to comment.