0
I have this code to overlay two images, one on top of the other
<?php
$img = $_POST['img'];
$user = imagecreatefromjpeg($img);
$mask = imagecreatefromgif('imgs/logo.gif');
$width = imagesx($user);
$height = imagesy($user);
$metade = $width/50;
$altura = $height/3.4;
imagealphablending($user, false);
imagesavealpha($user, true);
imagecopymerge($user, $mask, $metade, $altura, 0, 0, 620, 360, 60);
header('Content-Type: image/png');
imagepng($user);
imagedestroy($user);
imagedestroy($mask);
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="listra"></div>
<?php
?>
</body>
</html>
Only that the
header('Content-Type: image/png');
not letting use html,css would have some solution?
A solution would be to save the image instead of showing it on the screen. Then you wouldn’t need the header.
imagepng($user,'imagemgerada.png')
and then include 'imagemgerada.php' in HTML. Just be careful with the cache. Depending on the usage, can you put 'imagemgerada.php? incremental counter or time 'not to pick up cache.– Bacco