1

I don't manage to make it transparent and at the bottom makes the last 7 lines black.

<?php
/* header ('Content-Type: image/png'); */
$x = 20;
$y = 34;
$padding=2;

$finalImage = imagecreate($x+$padding,$y+$padding) or die('Cannot Initialize new GD image stream');

$white = imagecolorallocatealpha($finalImage, 255, 255, 255, 127);
imagefill($finalImage, 0, 0, $white);
imagefill($finalImage,0,0,0x7fff0000); // this is suppose to make it transparent

$url = 'http://65.82.88.75/queuecam/marker_red.png';
$originalImage = imagecreatefrompng($url);
imagecopymerge($finalImage,$originalImage,($padding/2),($padding/2),0,0,$x,$y,100);
// final, Original, final x, final y, Original x, Original y, Source width, Source height, **ptc

$text_color = imagecolorallocate($finalImage,0,0,0); // color of text
imagefill($finalImage,0,0,0x7fff0000);
imagestring($finalImage,5, 6, 2, '1', $text_color); // finalImage, font size, left, top, TEXT, color
imagepng($finalImage,'test.png');
imagedestroy($finalImage);
?>

this requires GD library. Is it possible that all this happens because I dont' have it installed in my computer? Is there a way to do the same without GD?

Sebastian
  • 475
  • 2
  • 8
  • 19

0 Answers0