How to Make an Image with php

Asked

Viewed 45 times

0

I’d like to instead of the black background for an image, do you have how? I’d like to do the same: inserir a descrição da imagem aqui

<?php
header("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);
?>
  • have tried using a widemagic library?

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 function imagecopy.

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

Besides, I think it’s best to use relative positions. That is, it puts the image sizes into variables and uses these values, with sums and subtractions, to draw.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.