Я в замешательстве, я пытаюсь просто нарисовать многоугольник и надеть его, как слой png с прозрачными пленками. Без успеха.Один раз, когда фон черный, один раз, когда полигон становится невидимым ..
вот мой php-код:
header ("Content-type: image/png");
// The png layer
$png = imagecreatefrompng("./300.png");
imagealphablending($png, false);
$largeur_source = imagesx($png);
$hauteur_source = imagesy($png);
// The polygon
$polygon_image = imagecreate($largeur_source,$hauteur_source);
$polygon_image_background = imagecolorallocate($polygon_image, 255, 255, 255);
imagecolortransparent($polygon_image, $polygon_image_background); // On rend le fond blanc transparent
$polygon_color = imagecolorallocate($polygon_image,100, 200, 225);
$polygon = array(0,0,
982,0,
982,48,
6,48,
6,53,
0,47,
0,0
);
imagefilledpolygon($polygon_image , $polygon , 6 , $polygon_color);
imagecopymerge($polygon_image, $png, 0, 0, 0, 0, $largeur_source, $hauteur_source,100); // black !
//imagecopy($polygon_image, $png, 0, 0, 0, 0, $largeur_source, $hauteur_source); // transparent but no polygon..
imagepng($polygon_image);
Я гуглил в течение нескольких часов, проверяя множество вещей, но ...
Заранее спасибо