xref: /PHP-8.2/ext/gd/tests/imagepolygon_aa.phpt (revision a375d547)
1--TEST--
2antialiased imagepolygon()
3--EXTENSIONS--
4gd
5--FILE--
6<?php
7require_once __DIR__ . DIRECTORY_SEPARATOR . 'func.inc';
8
9$im = imagecreatetruecolor(100, 100);
10$white = imagecolorallocate($im, 255, 255, 255);
11$black = imagecolorallocate($im, 0, 0, 0);
12imagefilledrectangle($im, 0,0, 99,99, $white);
13imageantialias($im, true);
14
15imagepolygon($im, [10,10, 49,89, 89,49], $black);
16
17test_image_equals_file(__DIR__ . DIRECTORY_SEPARATOR . 'imagepolygon_aa.png', $im);
18?>
19--EXPECT--
20The images are equal.
21