2
I’m putting up a painting and inserting the background, but the image is on top. I wonder if you have any way to send backwards, like what graphic editors do, I’ve tried to invert the code, inserted first the background and then the frame, but the image only gets the size of the background.
Code
$imagem = imageCreateFromPng('imgs/quadro.png');
imageAlphaBlending($imagem, true);
imageSaveAlpha($imagem, true);
$fundo = imageCreateFromPng('imgs/bg.png');
imageAlphaBlending($fundo, true);
imageSaveAlpha($fundo, true);
imagecopy($imagem, $fundo, 60, 30, 0, 0, imagesx($fundo), imagesy($fundo) );
header('Content-type: image/png');
imagepng($imagem);
You have to invert even, otherwise it will be on top. the size of the image you choose in the imagesx() and imagesy(), whether it is the front or the bottom. And since you’re setting the bar, you have to reverse the origins too, or cut.
– Bacco
But I put the margins 0, still not right, gets cut
– Rubens Ventura
imagecopy($background, $image, 0, 0, 0, 0, 0, imagesx($image), imagesy($image) );
– Rubens Ventura
see how https://uploaddeimagens.com.br/images/000/800/original/download_%281%29.png? 1483017342
– Rubens Ventura