English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
imageantialias — whether to use antialiasing (antialias) feature.
bool imageantialias ( resource $image , bool $enabled )
Enable fast drawing antialiasing method for line segments and polygons. The alpha channel is not supported. Use direct blending operations. Only for truecolor images.
Line width and style are not supported.
Using antialiasing and transparent background color may result in unexpected results. The blending method treats the background color as any other color. Lack of alpha channel support leads to the inability to use alpha-based antialiasing methods.
image: image resource returned by image creation functions (e.g., imagecreatetruecolor()).
enabled: whether antialiasing is enabled.
returns TRUE on success, or FALSE on failure.
<?php // use antialiasing image and a normal image $aa = imagecreatetruecolor(400, 100); $normal = imagecreatetruecolor(200, 100); // use antialiasing feature imageantialias($aa, true); // set color $red = imagecolorallocate($normal, 255, 0, 0); $red_aa = imagecolorallocate($aa, 255, 0, 0); // draw two lines imageline($normal, 0, 0, 200, 100, $red); imageline($aa, 0, 0, 200, 100, $red_aa); // merge images imagecopymerge($aa, $normal, 200, 0, 0, 0, 200, 100, 100); // output image header('Content-type: image/png'); imagepng($aa); imagedestroy($aa); imagedestroy($normal); ?>