How to make an image with php

0

I would like instead of the black background for an image, how? I would like to do this:

<?phpheader("Content-type:image/gif");
$img = imagecreate(470,246);
$azul = imagecolorallocate($img,0,0,0);
$branco = imagecolorallocate($img,255,255,255);

imagettftext($img,25,0,10,50,$branco,"fonts/SourceSansPro-Light.ttf","NARUTO SHIPPUDEN");
imagettftext($img,14,0,14,75,$branco,"fonts/SourceSansPro-Light.ttf","ASSISTA GRATIS NO ANIMEZONE");
imagettftext($img,14,0,14,75,$branco,"fonts/SourceSansPro-Light.ttf","ASSISTA GRATIS NO ANIMEZONE");
imagettftext($img,14,0,14 ,100,$branco,"fonts/SourceSansPro-Light.ttf","LEGENDADO / DUBLADO");
imagettftext($img,14,0,14 ,100,$branco,"fonts/SourceSansPro-Light.ttf","LEGENDADO / DUBLADO");
imagettftext($img,14,0,14 ,100,$branco,"fonts/SourceSansPro-Light.ttf","LEGENDADO / DUBLADO");
imagettftext($img,14,0,14 ,100,$branco,"fonts/SourceSansPro-Light.ttf","LEGENDADO / DUBLADO");
imagettftext($img,14,0,14 ,100,$branco,"fonts/SourceSansPro-Light.ttf","LEGENDADO / DUBLADO");

imagegif($img);
imagedestroy($img);
?>
    
asked by anonymous 01.04.2018 / 20:19

1 answer

1

If you can put the image to the right, you should also be able to put the background image.

With GD, just use the imagecopy function.

Of course it should be the first function to be called that changes the image.

Also, I think it's best to use relative positions. That is, it places the image sizes into variables and uses those values, with sums and subtractions, to draw.

    
02.04.2018 / 12:51